From: Vladimir Fomichev Date: Wed, 14 Jan 2026 07:30:53 +0000 (+0300) Subject: Актуализация версии апи Яндекс Маркета X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=914f49517d45ee36327ab275dc924e36fe2197bd;p=erp24_rep%2Fyii-erp24%2F.git Актуализация версии апи Яндекс Маркета --- diff --git a/erp24/lib/yandex_market_api/Api/AuthApi.php b/erp24/lib/yandex_market_api/Api/AuthApi.php new file mode 100644 index 00000000..882f9302 --- /dev/null +++ b/erp24/lib/yandex_market_api/Api/AuthApi.php @@ -0,0 +1,524 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getAuthTokenInfo + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getAuthTokenInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + list($response) = $this->getAuthTokenInfoWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getAuthTokenInfoWithHttpInfo + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getAuthTokenInfoWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + $request = $this->getAuthTokenInfoRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getAuthTokenInfoAsync + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAuthTokenInfoAsync(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + return $this->getAuthTokenInfoAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAuthTokenInfoAsyncWithHttpInfo + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAuthTokenInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetTokenInfoResponse'; + $request = $this->getAuthTokenInfoRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAuthTokenInfo' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAuthTokenInfoRequest(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + + + $resourcePath = '/v2/auth/token'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/erp24/lib/yandex_market_api/Api/BidsApi.php b/erp24/lib/yandex_market_api/Api/BidsApi.php index c9b06bea..a59aa86c 100644 --- a/erp24/lib/yandex_market_api/Api/BidsApi.php +++ b/erp24/lib/yandex_market_api/Api/BidsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -136,10 +139,10 @@ class BidsApi * * Информация об установленных ставках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -157,10 +160,10 @@ class BidsApi * * Информация об установленных ставках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -196,196 +199,51 @@ class BidsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -399,34 +257,11 @@ class BidsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -436,7 +271,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -444,7 +279,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -452,7 +287,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -460,7 +295,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -468,7 +303,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -476,7 +311,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -484,8 +319,10 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -495,10 +332,10 @@ class BidsApi * * Информация об установленных ставках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -519,10 +356,10 @@ class BidsApi * * Информация об установленных ставках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -572,10 +409,10 @@ class BidsApi /** * Create request for operation 'getBidsInfoForBusiness' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -595,10 +432,13 @@ class BidsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling BidsApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/bids/info'; + $resourcePath = '/v2/businesses/{businessId}/bids/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -709,7 +549,7 @@ class BidsApi * * Рекомендованные ставки для заданных товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * @@ -728,7 +568,7 @@ class BidsApi * * Рекомендованные ставки для заданных товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * @@ -765,196 +605,51 @@ class BidsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -968,34 +663,11 @@ class BidsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1005,7 +677,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1013,7 +685,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1021,7 +693,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1029,7 +701,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1037,7 +709,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1045,7 +717,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1053,8 +725,10 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1064,7 +738,7 @@ class BidsApi * * Рекомендованные ставки для заданных товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * @@ -1086,7 +760,7 @@ class BidsApi * * Рекомендованные ставки для заданных товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * @@ -1137,7 +811,7 @@ class BidsApi /** * Create request for operation 'getBidsRecommendations' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * @@ -1165,7 +839,7 @@ class BidsApi } - $resourcePath = '/businesses/{businessId}/bids/recommendations'; + $resourcePath = '/v2/businesses/{businessId}/bids/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1258,7 +932,7 @@ class BidsApi * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * @@ -1277,7 +951,7 @@ class BidsApi * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * @@ -1314,196 +988,51 @@ class BidsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1517,34 +1046,11 @@ class BidsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1554,7 +1060,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1562,7 +1068,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1570,7 +1076,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1578,7 +1084,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1586,7 +1092,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1594,7 +1100,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1602,8 +1108,10 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1613,7 +1121,7 @@ class BidsApi * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * @@ -1635,7 +1143,7 @@ class BidsApi * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * @@ -1686,7 +1194,7 @@ class BidsApi /** * Create request for operation 'putBidsForBusiness' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * @@ -1714,7 +1222,7 @@ class BidsApi } - $resourcePath = '/businesses/{businessId}/bids'; + $resourcePath = '/v2/businesses/{businessId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1807,7 +1315,7 @@ class BidsApi * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * @@ -1826,7 +1334,7 @@ class BidsApi * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * @@ -1863,196 +1371,51 @@ class BidsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2066,34 +1429,11 @@ class BidsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2103,7 +1443,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2111,7 +1451,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2119,7 +1459,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2127,7 +1467,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2135,7 +1475,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2143,7 +1483,7 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2151,8 +1491,10 @@ class BidsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2162,7 +1504,7 @@ class BidsApi * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * @@ -2184,7 +1526,7 @@ class BidsApi * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * @@ -2235,7 +1577,7 @@ class BidsApi /** * Create request for operation 'putBidsForCampaign' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * @@ -2263,7 +1605,7 @@ class BidsApi } - $resourcePath = '/campaigns/{campaignId}/bids'; + $resourcePath = '/v2/campaigns/{campaignId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2367,6 +1709,57 @@ class BidsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/BusinessOfferMappingsApi.php b/erp24/lib/yandex_market_api/Api/BusinessOfferMappingsApi.php index 86c9b3c7..40f3927e 100644 --- a/erp24/lib/yandex_market_api/Api/BusinessOfferMappingsApi.php +++ b/erp24/lib/yandex_market_api/Api/BusinessOfferMappingsApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], + 'generateOfferBarcodes' => [ + 'application/json', + ], 'getOfferMappings' => [ 'application/json', ], @@ -98,10 +104,10 @@ class BusinessOfferMappingsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -142,7 +148,7 @@ class BusinessOfferMappingsApi * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request add_offers_to_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * @@ -161,7 +167,7 @@ class BusinessOfferMappingsApi * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * @@ -198,223 +204,57 @@ class BusinessOfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AddOffersToArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -428,34 +268,11 @@ class BusinessOfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -465,7 +282,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -473,7 +290,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -481,7 +298,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -489,7 +306,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -497,7 +314,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -505,7 +322,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -513,7 +330,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -521,8 +338,10 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -532,7 +351,7 @@ class BusinessOfferMappingsApi * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * @@ -554,7 +373,7 @@ class BusinessOfferMappingsApi * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * @@ -605,7 +424,7 @@ class BusinessOfferMappingsApi /** * Create request for operation 'addOffersToArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * @@ -633,7 +452,7 @@ class BusinessOfferMappingsApi } - $resourcePath = '/businesses/{businessId}/offer-mappings/archive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -726,7 +545,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * @@ -745,7 +564,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * @@ -782,223 +601,57 @@ class BusinessOfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1012,34 +665,11 @@ class BusinessOfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1049,7 +679,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1057,7 +687,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1065,7 +695,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1073,7 +703,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1081,7 +711,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1089,7 +719,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1097,7 +727,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1105,8 +735,10 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1116,7 +748,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * @@ -1138,7 +770,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * @@ -1189,7 +821,7 @@ class BusinessOfferMappingsApi /** * Create request for operation 'deleteOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * @@ -1217,7 +849,7 @@ class BusinessOfferMappingsApi } - $resourcePath = '/businesses/{businessId}/offer-mappings/delete'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1310,7 +942,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * @@ -1329,7 +961,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * @@ -1366,223 +998,57 @@ class BusinessOfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1596,34 +1062,11 @@ class BusinessOfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1633,7 +1076,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1641,7 +1084,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1649,7 +1092,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1657,7 +1100,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1665,7 +1108,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1673,7 +1116,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1681,7 +1124,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1689,8 +1132,10 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1700,7 +1145,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * @@ -1722,7 +1167,7 @@ class BusinessOfferMappingsApi * * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * @@ -1773,7 +1218,7 @@ class BusinessOfferMappingsApi /** * Create request for operation 'deleteOffersFromArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * @@ -1801,7 +1246,7 @@ class BusinessOfferMappingsApi } - $resourcePath = '/businesses/{businessId}/offer-mappings/unarchive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/unarchive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1890,44 +1335,40 @@ class BusinessOfferMappingsApi } /** - * Operation getOfferMappings + * Operation generateOfferBarcodes * - * Информация о товарах в каталоге + * Генерация штрихкодов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappings($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + public function generateOfferBarcodes($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + list($response) = $this->generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType); return $response; } /** - * Operation getOfferMappingsWithHttpInfo + * Operation generateOfferBarcodesWithHttpInfo * - * Информация о товарах в каталоге + * Генерация штрихкодов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + public function generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1954,196 +1395,440 @@ class BusinessOfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateOfferBarcodesAsync + * + * Генерация штрихкодов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateOfferBarcodesAsync($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + return $this->generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateOfferBarcodesAsyncWithHttpInfo + * + * Генерация штрихкодов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse'; + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } + if ($returnType !== 'string') { + $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateOfferBarcodes' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling generateOfferBarcodes' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling BusinessOfferMappingsApi.generateOfferBarcodes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'generate_offer_barcodes_request' is set + if ($generate_offer_barcodes_request === null || (is_array($generate_offer_barcodes_request) && count($generate_offer_barcodes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_offer_barcodes_request when calling generateOfferBarcodes' + ); + } + + + $resourcePath = '/v1/businesses/{businessId}/offer-mappings/barcodes/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_offer_barcodes_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_offer_barcodes_request)); + } else { + $httpBody = $generate_offer_barcodes_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferMappings + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOfferMappings($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + return $response; + } + + /** + * Operation getOfferMappingsWithHttpInfo + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2157,34 +1842,11 @@ class BusinessOfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2194,7 +1856,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2202,7 +1864,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2210,7 +1872,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2218,7 +1880,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2226,7 +1888,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2234,7 +1896,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2242,8 +1904,10 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2253,18 +1917,19 @@ class BusinessOfferMappingsApi * * Информация о товарах в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType) + return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2277,19 +1942,20 @@ class BusinessOfferMappingsApi * * Информация о товарах в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2330,16 +1996,17 @@ class BusinessOfferMappingsApi /** * Create request for operation 'getOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { // verify the required parameter 'business_id' is set @@ -2353,10 +2020,14 @@ class BusinessOfferMappingsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling BusinessOfferMappingsApi.getOfferMappings, must be bigger than or equal to 1.'); + } + - $resourcePath = '/businesses/{businessId}/offer-mappings'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2381,6 +2052,15 @@ class BusinessOfferMappingsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -2467,13 +2147,14 @@ class BusinessOfferMappingsApi * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ public function getSuggestedOfferMappings($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { @@ -2486,13 +2167,14 @@ class BusinessOfferMappingsApi * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { @@ -2523,196 +2205,51 @@ class BusinessOfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2726,34 +2263,11 @@ class BusinessOfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2763,7 +2277,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2771,7 +2285,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2779,7 +2293,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2787,7 +2301,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2795,7 +2309,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2803,7 +2317,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2811,8 +2325,10 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2822,12 +2338,13 @@ class BusinessOfferMappingsApi * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function getSuggestedOfferMappingsAsync($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { @@ -2844,12 +2361,13 @@ class BusinessOfferMappingsApi * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { @@ -2895,12 +2413,13 @@ class BusinessOfferMappingsApi /** * Create request for operation 'getSuggestedOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ public function getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { @@ -2917,7 +2436,7 @@ class BusinessOfferMappingsApi - $resourcePath = '/businesses/{businessId}/offer-mappings/suggestions'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3010,17 +2529,18 @@ class BusinessOfferMappingsApi * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferMappings($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings'][0]) + public function updateOfferMappings($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $contentType); + list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType); return $response; } @@ -3029,17 +2549,18 @@ class BusinessOfferMappingsApi * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings'][0]) + public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -3066,223 +2587,57 @@ class BusinessOfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3296,34 +2651,11 @@ class BusinessOfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3333,7 +2665,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3341,7 +2673,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3349,7 +2681,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3357,7 +2689,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3365,7 +2697,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3373,7 +2705,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3381,7 +2713,7 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3389,8 +2721,10 @@ class BusinessOfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3400,16 +2734,17 @@ class BusinessOfferMappingsApi * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings'][0]) + public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $contentType) + return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -3422,17 +2757,18 @@ class BusinessOfferMappingsApi * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings'][0]) + public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3473,14 +2809,15 @@ class BusinessOfferMappingsApi /** * Create request for operation 'updateOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings'][0]) + public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { // verify the required parameter 'business_id' is set @@ -3501,13 +2838,23 @@ class BusinessOfferMappingsApi } - $resourcePath = '/businesses/{businessId}/offer-mappings/update'; + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/update'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -3605,6 +2952,57 @@ class BusinessOfferMappingsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/BusinessesApi.php b/erp24/lib/yandex_market_api/Api/BusinessesApi.php index c1c0b6ec..aca1a23b 100644 --- a/erp24/lib/yandex_market_api/Api/BusinessesApi.php +++ b/erp24/lib/yandex_market_api/Api/BusinessesApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -127,7 +130,7 @@ class BusinessesApi * * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -145,7 +148,7 @@ class BusinessesApi * * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -181,196 +184,51 @@ class BusinessesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -384,34 +242,11 @@ class BusinessesApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -421,7 +256,7 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -429,7 +264,7 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -437,7 +272,7 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -445,7 +280,7 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -453,7 +288,7 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -461,7 +296,7 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -469,8 +304,10 @@ class BusinessesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -480,7 +317,7 @@ class BusinessesApi * * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -501,7 +338,7 @@ class BusinessesApi * * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -551,7 +388,7 @@ class BusinessesApi /** * Create request for operation 'getBusinessSettings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -571,7 +408,7 @@ class BusinessesApi } - $resourcePath = '/businesses/{businessId}/settings'; + $resourcePath = '/v2/businesses/{businessId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -668,6 +505,57 @@ class BusinessesApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/CampaignsApi.php b/erp24/lib/yandex_market_api/Api/CampaignsApi.php index 4b1467d9..507aca7d 100644 --- a/erp24/lib/yandex_market_api/Api/CampaignsApi.php +++ b/erp24/lib/yandex_market_api/Api/CampaignsApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], - 'getCampaignLogins' => [ - 'application/json', - ], - 'getCampaignRegion' => [ - 'application/json', - ], 'getCampaignSettings' => [ 'application/json', ], 'getCampaigns' => [ 'application/json', ], - 'getCampaignsByLogin' => [ - 'application/json', - ], ]; /** @@ -98,10 +92,10 @@ class CampaignsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -142,7 +136,7 @@ class CampaignsApi * * Информация о магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -160,7 +154,7 @@ class CampaignsApi * * Информация о магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -196,196 +190,51 @@ class CampaignsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -399,34 +248,11 @@ class CampaignsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -436,7 +262,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -444,7 +270,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -452,7 +278,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -460,7 +286,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -468,7 +294,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -476,7 +302,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -484,8 +310,10 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -495,7 +323,7 @@ class CampaignsApi * * Информация о магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -516,7 +344,7 @@ class CampaignsApi * * Информация о магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -566,7 +394,7 @@ class CampaignsApi /** * Create request for operation 'getCampaign' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -586,7 +414,7 @@ class CampaignsApi } - $resourcePath = '/campaigns/{campaignId}'; + $resourcePath = '/v2/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -668,38 +496,38 @@ class CampaignsApi } /** - * Operation getCampaignLogins + * Operation getCampaignSettings * - * Логины, связанные с магазином + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignLogins($campaign_id, string $contentType = self::contentTypes['getCampaignLogins'][0]) + public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - list($response) = $this->getCampaignLoginsWithHttpInfo($campaign_id, $contentType); + list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getCampaignLoginsWithHttpInfo + * Operation getCampaignSettingsWithHttpInfo * - * Логины, связанные с магазином + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignLoginsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins'][0]) + public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $request = $this->getCampaignLoginsRequest($campaign_id, $contentType); + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -726,196 +554,51 @@ class CampaignsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignLoginsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -929,44 +612,21 @@ class CampaignsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignLoginsResponse', + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -974,7 +634,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -982,7 +642,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -990,7 +650,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -998,7 +658,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1006,7 +666,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1014,26 +674,28 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignLoginsAsync + * Operation getCampaignSettingsAsync * - * Логины, связанные с магазином + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLoginsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignLogins'][0]) + public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - return $this->getCampaignLoginsAsyncWithHttpInfo($campaign_id, $contentType) + return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1042,20 +704,20 @@ class CampaignsApi } /** - * Operation getCampaignLoginsAsyncWithHttpInfo + * Operation getCampaignSettingsAsyncWithHttpInfo * - * Логины, связанные с магазином + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLoginsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins'][0]) + public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - $request = $this->getCampaignLoginsRequest($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1094,29 +756,29 @@ class CampaignsApi } /** - * Create request for operation 'getCampaignLogins' + * Create request for operation 'getCampaignSettings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignLoginsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignLogins'][0]) + public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignLogins' + 'Missing the required parameter $campaign_id when calling getCampaignSettings' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling CampaignsApi.getCampaignLogins, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling CampaignsApi.getCampaignSettings, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/logins'; + $resourcePath = '/v2/campaigns/{campaignId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1198,40 +860,40 @@ class CampaignsApi } /** - * Operation getCampaignRegion + * Operation getCampaigns * - * Регион магазина + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignRegion($campaign_id, string $contentType = self::contentTypes['getCampaignRegion'][0]) + public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - list($response) = $this->getCampaignRegionWithHttpInfo($campaign_id, $contentType); + list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); return $response; } /** - * Operation getCampaignRegionWithHttpInfo + * Operation getCampaignsWithHttpInfo * - * Регион магазина + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRegionWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion'][0]) + public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $request = $this->getCampaignRegionRequest($campaign_id, $contentType); + $request = $this->getCampaignsRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -1258,1803 +920,51 @@ class CampaignsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignRegionResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignRegionResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 420: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLimitErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiServerErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getCampaignRegionAsync - * - * Регион магазина - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated - */ - public function getCampaignRegionAsync($campaign_id, string $contentType = self::contentTypes['getCampaignRegion'][0]) - { - return $this->getCampaignRegionAsyncWithHttpInfo($campaign_id, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getCampaignRegionAsyncWithHttpInfo - * - * Регион магазина - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated - */ - public function getCampaignRegionAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion'][0]) - { - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - $request = $this->getCampaignRegionRequest($campaign_id, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getCampaignRegion' - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - * @deprecated - */ - public function getCampaignRegionRequest($campaign_id, string $contentType = self::contentTypes['getCampaignRegion'][0]) - { - - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignRegion' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling CampaignsApi.getCampaignRegion, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/campaigns/{campaignId}/region'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); - if ($apiKey !== null) { - $headers['Api-Key'] = $apiKey; - } - // this endpoint requires OAuth (access token) - if (!empty($this->config->getAccessToken())) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getCampaignSettings - * - * Настройки магазина - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - */ - public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) - { - list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); - return $response; - } - - /** - * Operation getCampaignSettingsWithHttpInfo - * - * Настройки магазина - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) - { - $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignSettingsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 420: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLimitErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiServerErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getCampaignSettingsAsync - * - * Настройки магазина - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) - { - return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getCampaignSettingsAsyncWithHttpInfo - * - * Настройки магазина - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) - { - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getCampaignSettings' - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) - { - - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignSettings' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling CampaignsApi.getCampaignSettings, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/campaigns/{campaignId}/settings'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); - if ($apiKey !== null) { - $headers['Api-Key'] = $apiKey; - } - // this endpoint requires OAuth (access token) - if (!empty($this->config->getAccessToken())) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getCampaigns - * - * Список магазинов пользователя - * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - */ - public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) - { - list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); - return $response; - } - - /** - * Operation getCampaignsWithHttpInfo - * - * Список магазинов пользователя - * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) - { - $request = $this->getCampaignsRequest($page, $page_size, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 420: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLimitErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiServerErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getCampaignsAsync - * - * Список магазинов пользователя - * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) - { - return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getCampaignsAsyncWithHttpInfo - * - * Список магазинов пользователя - * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) - { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaignsRequest($page, $page_size, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getCampaigns' - * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) - { - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling CampaignsApi.getCampaigns, must be smaller than or equal to 10000.'); - } - - - - $resourcePath = '/campaigns'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - - - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); - if ($apiKey !== null) { - $headers['Api-Key'] = $apiKey; - } - // this endpoint requires OAuth (access token) - if (!empty($this->config->getAccessToken())) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getCampaignsByLogin - * - * Магазины, доступные логину - * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - */ - public function getCampaignsByLogin($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin'][0]) - { - list($response) = $this->getCampaignsByLoginWithHttpInfo($login, $page, $page_size, $contentType); - return $response; - } - - /** - * Operation getCampaignsByLoginWithHttpInfo - * - * Магазины, доступные логину - * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getCampaignsByLoginWithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin'][0]) - { - $request = $this->getCampaignsByLoginRequest($login, $page, $page_size, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3068,34 +978,11 @@ class CampaignsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3105,7 +992,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3113,7 +1000,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3121,7 +1008,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3129,7 +1016,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3137,7 +1024,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3145,7 +1032,7 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3153,28 +1040,29 @@ class CampaignsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignsByLoginAsync + * Operation getCampaignsAsync * - * Магазины, доступные логину + * Список магазинов пользователя * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLoginAsync($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin'][0]) + public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - return $this->getCampaignsByLoginAsyncWithHttpInfo($login, $page, $page_size, $contentType) + return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -3183,22 +1071,21 @@ class CampaignsApi } /** - * Operation getCampaignsByLoginAsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * Магазины, доступные логину + * Список магазинов пользователя * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLoginAsyncWithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin'][0]) + public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaignsByLoginRequest($login, $page, $page_size, $contentType); + $request = $this->getCampaignsRequest($page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3237,33 +1124,25 @@ class CampaignsApi } /** - * Create request for operation 'getCampaignsByLogin' + * Create request for operation 'getCampaigns' * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignsByLoginRequest($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin'][0]) + public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - // verify the required parameter 'login' is set - if ($login === null || (is_array($login) && count($login) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $login when calling getCampaignsByLogin' - ); - } - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling CampaignsApi.getCampaignsByLogin, must be smaller than or equal to 10000.'); + throw new \InvalidArgumentException('invalid value for "$page" when calling CampaignsApi.getCampaigns, must be smaller than or equal to 10000.'); } - $resourcePath = '/campaigns/by_login/{login}'; + $resourcePath = '/v2/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3290,14 +1169,6 @@ class CampaignsApi ) ?? []); - // path params - if ($login !== null) { - $resourcePath = str_replace( - '{' . 'login' . '}', - ObjectSerializer::toPathValue($login), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -3378,6 +1249,57 @@ class CampaignsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/CategoriesApi.php b/erp24/lib/yandex_market_api/Api/CategoriesApi.php index 247561a6..f8f7bee1 100644 --- a/erp24/lib/yandex_market_api/Api/CategoriesApi.php +++ b/erp24/lib/yandex_market_api/Api/CategoriesApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -136,6 +139,7 @@ class CategoriesApi * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ public function getCategoriesMaxSaleQuantum($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { @@ -154,6 +158,7 @@ class CategoriesApi * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { @@ -184,196 +189,51 @@ class CategoriesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -387,34 +247,11 @@ class CategoriesApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -424,7 +261,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -432,7 +269,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -440,7 +277,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -448,7 +285,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -456,7 +293,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -464,7 +301,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -472,8 +309,10 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -488,6 +327,7 @@ class CategoriesApi * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function getCategoriesMaxSaleQuantumAsync($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { @@ -509,6 +349,7 @@ class CategoriesApi * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { @@ -559,6 +400,7 @@ class CategoriesApi * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ public function getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { @@ -571,7 +413,7 @@ class CategoriesApi } - $resourcePath = '/categories/max-sale-quantum'; + $resourcePath = '/v2/categories/max-sale-quantum'; $formParams = []; $queryParams = []; $headerParams = []; @@ -656,7 +498,7 @@ class CategoriesApi * * Дерево категорий * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request get_categories_request (optional) + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request get_categories_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -674,7 +516,7 @@ class CategoriesApi * * Дерево категорий * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -710,196 +552,51 @@ class CategoriesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -913,34 +610,11 @@ class CategoriesApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -950,7 +624,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -958,7 +632,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -966,7 +640,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -974,7 +648,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -982,7 +656,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -990,7 +664,7 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -998,8 +672,10 @@ class CategoriesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1009,7 +685,7 @@ class CategoriesApi * * Дерево категорий * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1030,7 +706,7 @@ class CategoriesApi * * Дерево категорий * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1080,7 +756,7 @@ class CategoriesApi /** * Create request for operation 'getCategoriesTree' * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1091,7 +767,7 @@ class CategoriesApi - $resourcePath = '/categories/tree'; + $resourcePath = '/v2/categories/tree'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1187,6 +863,57 @@ class CategoriesApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/ChatsApi.php b/erp24/lib/yandex_market_api/Api/ChatsApi.php index 1c386c85..4cc905db 100644 --- a/erp24/lib/yandex_market_api/Api/ChatsApi.php +++ b/erp24/lib/yandex_market_api/Api/ChatsApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], + 'getChat' => [ + 'application/json', + ], 'getChatHistory' => [ 'application/json', ], + 'getChatMessage' => [ + 'application/json', + ], 'getChats' => [ 'application/json', ], @@ -95,10 +104,10 @@ class ChatsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -139,7 +148,7 @@ class ChatsApi * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * @@ -158,7 +167,7 @@ class ChatsApi * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * @@ -195,196 +204,51 @@ class ChatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateChatResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateChatResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateChatResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -398,34 +262,11 @@ class ChatsApi ); } - $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -435,7 +276,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +284,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +292,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +300,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +308,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,7 +316,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -483,8 +324,10 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -494,7 +337,7 @@ class ChatsApi * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * @@ -516,7 +359,7 @@ class ChatsApi * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * @@ -567,7 +410,7 @@ class ChatsApi /** * Create request for operation 'createChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * @@ -595,7 +438,7 @@ class ChatsApi } - $resourcePath = '/businesses/{businessId}/chats/new'; + $resourcePath = '/v2/businesses/{businessId}/chats/new'; $formParams = []; $queryParams = []; $headerParams = []; @@ -684,46 +527,40 @@ class ChatsApi } /** - * Operation getChatHistory + * Operation getChat * - * Получение истории сообщений в чате + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChatHistory($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + public function getChat($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - list($response) = $this->getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + list($response) = $this->getChatWithHttpInfo($business_id, $chat_id, $contentType); return $response; } /** - * Operation getChatHistoryWithHttpInfo + * Operation getChatWithHttpInfo * - * Получение истории сообщений в чате + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + public function getChatWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $request = $this->getChatRequest($business_id, $chat_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -750,196 +587,51 @@ class ChatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatHistoryResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -953,44 +645,21 @@ class ChatsApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatHistoryResponse', + '\OpenAPI\Client\Model\GetChatResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -998,7 +667,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1006,7 +675,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1014,7 +683,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1022,7 +691,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1030,7 +699,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1038,30 +707,29 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChatHistoryAsync + * Operation getChatAsync * - * Получение истории сообщений в чате + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistoryAsync($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + public function getChatAsync($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - return $this->getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) + return $this->getChatAsyncWithHttpInfo($business_id, $chat_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1070,24 +738,21 @@ class ChatsApi } /** - * Operation getChatHistoryAsyncWithHttpInfo + * Operation getChatAsyncWithHttpInfo * - * Получение истории сообщений в чате + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + public function getChatAsyncWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatResponse'; + $request = $this->getChatRequest($business_id, $chat_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1126,52 +791,40 @@ class ChatsApi } /** - * Create request for operation 'getChatHistory' + * Create request for operation 'getChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + public function getChatRequest($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChatHistory' + 'Missing the required parameter $business_id when calling getChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ChatsApi.getChatHistory, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ChatsApi.getChat, must be bigger than or equal to 1.'); } // verify the required parameter 'chat_id' is set if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling getChatHistory' + 'Missing the required parameter $chat_id when calling getChat' ); } if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ChatsApi.getChatHistory, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ChatsApi.getChat, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chat_history_request' is set - if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chat_history_request when calling getChatHistory' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats/history'; + $resourcePath = '/v2/businesses/{businessId}/chat'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1187,24 +840,439 @@ class ChatsApi false, // explode true // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChatHistory + * + * Получение истории сообщений в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getChatHistory($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + { + list($response) = $this->getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getChatHistoryWithHttpInfo + * + * Получение истории сообщений в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + { + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getChatHistoryAsync + * + * Получение истории сообщений в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChatHistoryAsync($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + { + return $this->getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChatHistoryAsyncWithHttpInfo + * + * Получение истории сообщений в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChatHistory' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getChatHistory' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ChatsApi.getChatHistory, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatHistory' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ChatsApi.getChatHistory, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_chat_history_request' is set + if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chat_history_request when calling getChatHistory' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ChatsApi.getChatHistory, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/chats/history'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -1231,7 +1299,419 @@ class ChatsApi } else { $httpBody = $get_chat_history_request; } - } elseif (count($formParams) > 0) { + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChatMessage + * + * Получение сообщения в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getChatMessage($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) + { + list($response) = $this->getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, $contentType); + return $response; + } + + /** + * Operation getChatMessageWithHttpInfo + * + * Получение сообщения в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) + { + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetChatMessageResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getChatMessageAsync + * + * Получение сообщения в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChatMessageAsync($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) + { + return $this->getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChatMessageAsyncWithHttpInfo + * + * Получение сообщения в чате + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetChatMessageResponse'; + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChatMessage' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getChatMessageRequest($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getChatMessage' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ChatsApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatMessage' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ChatsApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'message_id' is set + if ($message_id === null || (is_array($message_id) && count($message_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $message_id when calling getChatMessage' + ); + } + if ($message_id < 1) { + throw new \InvalidArgumentException('invalid value for "$message_id" when calling ChatsApi.getChatMessage, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/chats/message'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $message_id, + 'messageId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1279,7 +1759,7 @@ class ChatsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1291,10 +1771,10 @@ class ChatsApi * * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1312,10 +1792,10 @@ class ChatsApi * * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1351,196 +1831,51 @@ class ChatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1554,34 +1889,11 @@ class ChatsApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1591,7 +1903,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1599,7 +1911,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1607,7 +1919,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1615,7 +1927,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1623,7 +1935,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1631,7 +1943,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1639,8 +1951,10 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1650,10 +1964,10 @@ class ChatsApi * * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1674,10 +1988,10 @@ class ChatsApi * * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1727,10 +2041,10 @@ class ChatsApi /** * Create request for operation 'getChats' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1757,9 +2071,12 @@ class ChatsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ChatsApi.getChats, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/chats'; + $resourcePath = '/v2/businesses/{businessId}/chats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1870,7 +2187,7 @@ class ChatsApi * * Отправка файла в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation @@ -1890,7 +2207,7 @@ class ChatsApi * * Отправка файла в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation @@ -1928,196 +2245,51 @@ class ChatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2131,34 +2303,11 @@ class ChatsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2168,7 +2317,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2176,7 +2325,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2184,7 +2333,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2192,7 +2341,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2200,7 +2349,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2208,7 +2357,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2216,8 +2365,10 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2227,7 +2378,7 @@ class ChatsApi * * Отправка файла в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation @@ -2250,7 +2401,7 @@ class ChatsApi * * Отправка файла в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation @@ -2302,7 +2453,7 @@ class ChatsApi /** * Create request for operation 'sendFileToChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation @@ -2341,7 +2492,7 @@ class ChatsApi } - $resourcePath = '/businesses/{businessId}/chats/file/send'; + $resourcePath = '/v2/businesses/{businessId}/chats/file/send'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2369,18 +2520,16 @@ class ChatsApi } // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = []; - $paramFiles = is_array($file) ? $file : [$file]; - foreach ($paramFiles as $paramFile) { - $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } - } + $formDataProcessor = new FormDataProcessor(); + $formData = $formDataProcessor->prepare([ + 'file' => $file, + ]); + + $formParams = $formDataProcessor->flatten($formData); + $multipart = $formDataProcessor->has_file; + + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -2448,7 +2597,7 @@ class ChatsApi * * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation @@ -2468,7 +2617,7 @@ class ChatsApi * * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation @@ -2506,196 +2655,51 @@ class ChatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2709,34 +2713,11 @@ class ChatsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2746,7 +2727,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2754,7 +2735,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2762,7 +2743,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2770,7 +2751,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2778,7 +2759,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2786,7 +2767,7 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2794,8 +2775,10 @@ class ChatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2805,7 +2788,7 @@ class ChatsApi * * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation @@ -2828,7 +2811,7 @@ class ChatsApi * * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation @@ -2880,7 +2863,7 @@ class ChatsApi /** * Create request for operation 'sendMessageToChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation @@ -2919,7 +2902,7 @@ class ChatsApi } - $resourcePath = '/businesses/{businessId}/chats/message'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3032,6 +3015,57 @@ class ChatsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/ContentApi.php b/erp24/lib/yandex_market_api/Api/ContentApi.php index 5ce7d940..2770241c 100644 --- a/erp24/lib/yandex_market_api/Api/ContentApi.php +++ b/erp24/lib/yandex_market_api/Api/ContentApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -133,16 +136,17 @@ class ContentApi * * Списки характеристик товаров по категориям * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoryContentParameters($category_id, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + public function getCategoryContentParameters($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $contentType); + list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $business_id, $contentType); return $response; } @@ -151,16 +155,17 @@ class ContentApi * * Списки характеристик товаров по категориям * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoryContentParametersWithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + public function getCategoryContentParametersWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $request = $this->getCategoryContentParametersRequest($category_id, $contentType); + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -187,196 +192,51 @@ class ContentApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -390,34 +250,11 @@ class ContentApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -427,7 +264,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -435,7 +272,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +280,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +288,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +296,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +304,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,8 +312,10 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -486,15 +325,16 @@ class ContentApi * * Списки характеристик товаров по категориям * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParametersAsync($category_id, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + public function getCategoryContentParametersAsync($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $contentType) + return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -507,16 +347,17 @@ class ContentApi * * Списки характеристик товаров по категориям * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParametersAsyncWithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + public function getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - $request = $this->getCategoryContentParametersRequest($category_id, $contentType); + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -557,13 +398,14 @@ class ContentApi /** * Create request for operation 'getCategoryContentParameters' * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoryContentParametersRequest($category_id, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + public function getCategoryContentParametersRequest($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { // verify the required parameter 'category_id' is set @@ -572,18 +414,31 @@ class ContentApi 'Missing the required parameter $category_id when calling getCategoryContentParameters' ); } - if ($category_id < 1) { - throw new \InvalidArgumentException('invalid value for "$category_id" when calling ContentApi.getCategoryContentParameters, must be bigger than or equal to 1.'); + if ($category_id <= 0) { + throw new \InvalidArgumentException('invalid value for "$category_id" when calling ContentApi.getCategoryContentParameters, must be bigger than 0.'); + } + + if ($business_id !== null && $business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ContentApi.getCategoryContentParameters, must be bigger than or equal to 1.'); } - $resourcePath = '/category/{categoryId}/parameters'; + $resourcePath = '/v2/category/{categoryId}/parameters'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $business_id, + 'businessId', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -663,10 +518,10 @@ class ContentApi * * Получение информации о заполненности карточек магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -684,10 +539,10 @@ class ContentApi * * Получение информации о заполненности карточек магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -723,196 +578,51 @@ class ContentApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -926,34 +636,11 @@ class ContentApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -963,7 +650,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -971,7 +658,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -979,7 +666,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -987,7 +674,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -995,7 +682,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1003,7 +690,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1011,8 +698,10 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1022,10 +711,10 @@ class ContentApi * * Получение информации о заполненности карточек магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1046,10 +735,10 @@ class ContentApi * * Получение информации о заполненности карточек магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1099,10 +788,10 @@ class ContentApi /** * Create request for operation 'getOfferCardsContentStatus' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1122,10 +811,13 @@ class ContentApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ContentApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offer-cards'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1236,7 +928,7 @@ class ContentApi * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * @@ -1255,7 +947,7 @@ class ContentApi * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * @@ -1292,223 +984,57 @@ class ContentApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferContentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1522,34 +1048,11 @@ class ContentApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1559,7 +1062,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1567,7 +1070,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1575,7 +1078,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1583,7 +1086,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1591,7 +1094,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1599,7 +1102,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1607,7 +1110,7 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1615,8 +1118,10 @@ class ContentApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1626,7 +1131,7 @@ class ContentApi * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * @@ -1648,7 +1153,7 @@ class ContentApi * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * @@ -1699,7 +1204,7 @@ class ContentApi /** * Create request for operation 'updateOfferContent' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * @@ -1727,7 +1232,7 @@ class ContentApi } - $resourcePath = '/businesses/{businessId}/offer-cards/update'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1831,6 +1336,57 @@ class ContentApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/DbsApi.php b/erp24/lib/yandex_market_api/Api/DbsApi.php index 8b83e707..efcc4e18 100644 --- a/erp24/lib/yandex_market_api/Api/DbsApi.php +++ b/erp24/lib/yandex_market_api/Api/DbsApi.php @@ -1,7 +1,7 @@ [ + 'acceptOrderCancellation' => [ 'application/json', ], - 'addHiddenOffers_2' => [ + 'addHiddenOffers' => [ 'application/json', ], - 'addOffersToArchive_0' => [ + 'addOffersToArchive' => [ 'application/json', ], - 'calculateTariffs_2' => [ + 'calculateTariffs' => [ 'application/json', ], - 'confirmBusinessPrices_0' => [ + 'confirmBusinessPrices' => [ 'application/json', ], - 'confirmCampaignPrices_0' => [ + 'confirmCampaignPrices' => [ 'application/json', ], - 'createChat_0' => [ + 'createChat' => [ 'application/json', ], - 'createOutlet_0' => [ + 'createOutlet' => [ 'application/json', ], - 'deleteCampaignOffers_0' => [ + 'deleteCampaignOffers' => [ 'application/json', ], - 'deleteGoodsFeedbackComment_2' => [ + 'deleteGoodsFeedbackComment' => [ 'application/json', ], - 'deleteHiddenOffers_2' => [ + 'deleteHiddenOffers' => [ 'application/json', ], - 'deleteOffersFromArchive_0' => [ + 'deleteOffers' => [ 'application/json', ], - 'deleteOffers_0' => [ + 'deleteOffersFromArchive' => [ 'application/json', ], - 'deleteOutletLicenses_0' => [ + 'deleteOutlet' => [ 'application/json', ], - 'deleteOutlet_0' => [ + 'deleteOutletLicenses' => [ 'application/json', ], - 'deletePromoOffers_2' => [ + 'deletePromoOffers' => [ 'application/json', ], - 'generateBoostConsolidatedReport_2' => [ + 'generateBannersStatisticsReport' => [ 'application/json', ], - 'generateCompetitorsPositionReport_1' => [ + 'generateBoostConsolidatedReport' => [ 'application/json', ], - 'generateGoodsFeedbackReport_2' => [ + 'generateClosureDocumentsDetalizationReport' => [ 'application/json', ], - 'generateMassOrderLabelsReport_1' => [ + 'generateClosureDocumentsReport' => [ 'application/json', ], - 'generateOrderLabel_1' => [ + 'generateCompetitorsPositionReport' => [ 'application/json', ], - 'generateOrderLabels_1' => [ + 'generateGoodsFeedbackReport' => [ 'application/json', ], - 'generatePricesReport_2' => [ + 'generateGoodsPricesReport' => [ 'application/json', ], - 'generateShelfsStatisticsReport_2' => [ + 'generateGoodsRealizationReport' => [ 'application/json', ], - 'generateShowsSalesReport_1' => [ + 'generateJewelryFiscalReport' => [ 'application/json', ], - 'generateStocksOnWarehousesReport_2' => [ + 'generateKeyIndicatorsReport' => [ 'application/json', ], - 'generateUnitedMarketplaceServicesReport_1' => [ + 'generateMassOrderLabelsReport' => [ 'application/json', ], - 'generateUnitedNettingReport_1' => [ + 'generateOfferBarcodes' => [ 'application/json', ], - 'generateUnitedOrdersReport_2' => [ + 'generateOrderLabel' => [ 'application/json', ], - 'getAllOffers_0' => [ + 'generateOrderLabels' => [ 'application/json', ], - 'getBidsInfoForBusiness_0' => [ + 'generatePricesReport' => [ 'application/json', ], - 'getBidsRecommendations_0' => [ + 'generateSalesGeographyReport' => [ 'application/json', ], - 'getBusinessQuarantineOffers_0' => [ + 'generateShelfsStatisticsReport' => [ 'application/json', ], - 'getBusinessSettings_0' => [ + 'generateShowsBoostReport' => [ 'application/json', ], - 'getCampaignLogins_0' => [ + 'generateShowsSalesReport' => [ 'application/json', ], - 'getCampaignOffers_0' => [ + 'generateStocksOnWarehousesReport' => [ 'application/json', ], - 'getCampaignQuarantineOffers_0' => [ + 'generateUnitedMarketplaceServicesReport' => [ 'application/json', ], - 'getCampaignRegion_0' => [ + 'generateUnitedNettingReport' => [ 'application/json', ], - 'getCampaignSettings_0' => [ + 'generateUnitedOrdersReport' => [ 'application/json', ], - 'getCampaign_0' => [ + 'generateUnitedReturnsReport' => [ 'application/json', ], - 'getCampaignsByLogin_0' => [ + 'getAuthTokenInfo' => [ 'application/json', ], - 'getCampaigns_0' => [ + 'getBidsInfoForBusiness' => [ 'application/json', ], - 'getCategoriesMaxSaleQuantum_2' => [ + 'getBidsRecommendations' => [ 'application/json', ], - 'getCategoriesTree_2' => [ + 'getBusinessOrders' => [ 'application/json', ], - 'getCategoryContentParameters_0' => [ + 'getBusinessQuarantineOffers' => [ 'application/json', ], - 'getChatHistory_0' => [ + 'getBusinessSettings' => [ 'application/json', ], - 'getChats_0' => [ + 'getCampaign' => [ 'application/json', ], - 'getDeliveryServices_1' => [ + 'getCampaignOffers' => [ 'application/json', ], - 'getFeedIndexLogs_0' => [ + 'getCampaignQuarantineOffers' => [ 'application/json', ], - 'getFeed_0' => [ + 'getCampaignSettings' => [ 'application/json', ], - 'getFeedbackAndCommentUpdates_0' => [ + 'getCampaigns' => [ 'application/json', ], - 'getFeeds_0' => [ + 'getCategoriesMaxSaleQuantum' => [ 'application/json', ], - 'getGoodsFeedbackComments_2' => [ + 'getCategoriesTree' => [ 'application/json', ], - 'getGoodsFeedbacks_2' => [ + 'getCategoryContentParameters' => [ 'application/json', ], - 'getGoodsStats_3' => [ + 'getChat' => [ 'application/json', ], - 'getHiddenOffers_2' => [ + 'getChatHistory' => [ 'application/json', ], - 'getModelOffers_0' => [ + 'getChatMessage' => [ 'application/json', ], - 'getModel_0' => [ + 'getChats' => [ 'application/json', ], - 'getModelsOffers_0' => [ + 'getDefaultPrices' => [ 'application/json', ], - 'getModels_0' => [ + 'getDeliveryServices' => [ 'application/json', ], - 'getOfferCardsContentStatus_0' => [ + 'getGoodsFeedbackComments' => [ 'application/json', ], - 'getOfferMappingEntries_3' => [ + 'getGoodsFeedbacks' => [ 'application/json', ], - 'getOfferMappings_0' => [ + 'getGoodsQuestionAnswers' => [ 'application/json', ], - 'getOfferRecommendations_0' => [ + 'getGoodsQuestions' => [ 'application/json', ], - 'getOffers_0' => [ + 'getGoodsStats' => [ 'application/json', ], - 'getOrderBusinessBuyerInfo_2' => [ + 'getHiddenOffers' => [ 'application/json', ], - 'getOrderBusinessDocumentsInfo_2' => [ + 'getOfferCardsContentStatus' => [ 'application/json', ], - 'getOrderBuyerInfo_0' => [ + 'getOfferMappingEntries' => [ 'application/json', ], - 'getOrderLabelsData_1' => [ + 'getOfferMappings' => [ 'application/json', ], - 'getOrder_2' => [ + 'getOfferRecommendations' => [ 'application/json', ], - 'getOrdersStats_2' => [ + 'getOrder' => [ 'application/json', ], - 'getOrders_1' => [ + 'getOrderBusinessBuyerInfo' => [ 'application/json', ], - 'getOutletLicenses_0' => [ + 'getOrderBusinessDocumentsInfo' => [ 'application/json', ], - 'getOutlet_0' => [ + 'getOrderBuyerInfo' => [ 'application/json', ], - 'getOutlets_0' => [ + 'getOrderLabelsData' => [ 'application/json', ], - 'getPricesByOfferIds_2' => [ + 'getOrders' => [ 'application/json', ], - 'getPrices_2' => [ + 'getOrdersStats' => [ 'application/json', ], - 'getPromoOffers_2' => [ + 'getOutlet' => [ 'application/json', ], - 'getPromos_2' => [ + 'getOutletLicenses' => [ 'application/json', ], - 'getQualityRatingDetails_1' => [ + 'getOutlets' => [ 'application/json', ], - 'getQualityRatings_2' => [ + 'getPagedWarehouses' => [ 'application/json', ], - 'getReportInfo_1' => [ + 'getPrices' => [ 'application/json', ], - 'getReturnApplication_1' => [ + 'getPricesByOfferIds' => [ 'application/json', ], - 'getReturnPhoto_1' => [ + 'getPromoOffers' => [ 'application/json', ], - 'getReturn_1' => [ + 'getPromos' => [ 'application/json', ], - 'getReturns_1' => [ + 'getQualityRatingDetails' => [ 'application/json', ], - 'getStocks_2' => [ + 'getQualityRatings' => [ 'application/json', ], - 'getSuggestedOfferMappingEntries_3' => [ + 'getRegionsCodes' => [ 'application/json', ], - 'getSuggestedOfferMappings_0' => [ + 'getReportInfo' => [ 'application/json', ], - 'getSuggestedPrices_3' => [ + 'getReturn' => [ 'application/json', ], - 'getWarehouses_1' => [ + 'getReturnApplication' => [ 'application/json', ], - 'provideOrderDigitalCodes_0' => [ + 'getReturnPhoto' => [ 'application/json', ], - 'provideOrderItemIdentifiers_1' => [ + 'getReturns' => [ 'application/json', ], - 'putBidsForBusiness_0' => [ + 'getStocks' => [ 'application/json', ], - 'putBidsForCampaign_0' => [ + 'getSuggestedOfferMappingEntries' => [ 'application/json', ], - 'refreshFeed_0' => [ + 'getSuggestedOfferMappings' => [ 'application/json', ], - 'searchModels_0' => [ + 'getWarehouses' => [ 'application/json', ], - 'searchRegionChildren_2' => [ + 'provideOrderDigitalCodes' => [ 'application/json', ], - 'searchRegionsById_2' => [ + 'provideOrderItemIdentifiers' => [ 'application/json', ], - 'searchRegionsByName_2' => [ + 'putBidsForBusiness' => [ 'application/json', ], - 'sendFileToChat_0' => [ + 'putBidsForCampaign' => [ + 'application/json', + ], + 'searchRegionChildren' => [ + 'application/json', + ], + 'searchRegionsById' => [ + 'application/json', + ], + 'searchRegionsByName' => [ + 'application/json', + ], + 'sendFileToChat' => [ 'multipart/form-data', ], - 'sendMessageToChat_0' => [ + 'sendMessageToChat' => [ + 'application/json', + ], + 'setOrderBoxLayout' => [ 'application/json', ], - 'setFeedParams_0' => [ + 'setOrderDeliveryDate' => [ 'application/json', ], - 'setOrderBoxLayout_2' => [ + 'setOrderDeliveryTrackCode' => [ 'application/json', ], - 'setOrderDeliveryDate_0' => [ + 'setOrderShipmentBoxes' => [ 'application/json', ], - 'setOrderDeliveryTrackCode_0' => [ + 'setReturnDecision' => [ 'application/json', ], - 'setOrderShipmentBoxes_1' => [ + 'skipGoodsFeedbacksReaction' => [ 'application/json', ], - 'setReturnDecision_0' => [ + 'submitReturnDecision' => [ 'application/json', ], - 'skipGoodsFeedbacksReaction_2' => [ + 'updateBusinessPrices' => [ 'application/json', ], - 'submitReturnDecision_0' => [ + 'updateCampaignOffers' => [ 'application/json', ], - 'updateBusinessPrices_2' => [ + 'updateExternalOrderId' => [ 'application/json', ], - 'updateCampaignOffers_0' => [ + 'updateGoodsFeedbackComment' => [ 'application/json', ], - 'updateGoodsFeedbackComment_2' => [ + 'updateGoodsQuestionTextEntity' => [ 'application/json', ], - 'updateOfferContent_0' => [ + 'updateOfferContent' => [ 'application/json', ], - 'updateOfferMappingEntries_3' => [ + 'updateOfferMappingEntries' => [ 'application/json', ], - 'updateOfferMappings_0' => [ + 'updateOfferMappings' => [ 'application/json', ], - 'updateOrderItems_1' => [ + 'updateOrderItems' => [ 'application/json', ], - 'updateOrderStatus_1' => [ + 'updateOrderStatus' => [ 'application/json', ], - 'updateOrderStatuses_1' => [ + 'updateOrderStatuses' => [ 'application/json', ], - 'updateOrderStorageLimit_0' => [ + 'updateOrderStorageLimit' => [ 'application/json', ], - 'updateOutletLicenses_0' => [ + 'updateOutlet' => [ 'application/json', ], - 'updateOutlet_0' => [ + 'updateOutletLicenses' => [ 'application/json', ], - 'updatePrices_2' => [ + 'updatePrices' => [ 'application/json', ], - 'updatePromoOffers_2' => [ + 'updatePromoOffers' => [ 'application/json', ], - 'updateStocks_1' => [ + 'updateStocks' => [ + 'application/json', + ], + 'updateWarehouseStatus' => [ 'application/json', ], ]; @@ -455,10 +476,10 @@ class DbsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -495,42 +516,42 @@ class DbsApi } /** - * Operation acceptOrderCancellation_0 + * Operation acceptOrderCancellation * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request accept_order_cancellation_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function acceptOrderCancellation_0($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation_0'][0]) + public function acceptOrderCancellation($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation'][0]) { - list($response) = $this->acceptOrderCancellation_0WithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, $contentType); + list($response) = $this->acceptOrderCancellationWithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, $contentType); return $response; } /** - * Operation acceptOrderCancellation_0WithHttpInfo + * Operation acceptOrderCancellationWithHttpInfo * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function acceptOrderCancellation_0WithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation_0'][0]) + public function acceptOrderCancellationWithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation'][0]) { - $request = $this->acceptOrderCancellation_0Request($campaign_id, $order_id, $accept_order_cancellation_request, $contentType); + $request = $this->acceptOrderCancellationRequest($campaign_id, $order_id, $accept_order_cancellation_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -557,196 +578,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -760,34 +636,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -797,7 +650,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -805,7 +658,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -813,7 +666,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -821,7 +674,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -829,7 +682,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -837,7 +690,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -845,28 +698,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation acceptOrderCancellation_0Async + * Operation acceptOrderCancellationAsync * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function acceptOrderCancellation_0Async($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation_0'][0]) + public function acceptOrderCancellationAsync($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation'][0]) { - return $this->acceptOrderCancellation_0AsyncWithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, $contentType) + return $this->acceptOrderCancellationAsyncWithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, $contentType) ->then( function ($response) { return $response[0]; @@ -875,22 +730,22 @@ class DbsApi } /** - * Operation acceptOrderCancellation_0AsyncWithHttpInfo + * Operation acceptOrderCancellationAsyncWithHttpInfo * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function acceptOrderCancellation_0AsyncWithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation_0'][0]) + public function acceptOrderCancellationAsyncWithHttpInfo($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->acceptOrderCancellation_0Request($campaign_id, $order_id, $accept_order_cancellation_request, $contentType); + $request = $this->acceptOrderCancellationRequest($campaign_id, $order_id, $accept_order_cancellation_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -929,45 +784,45 @@ class DbsApi } /** - * Create request for operation 'acceptOrderCancellation_0' + * Create request for operation 'acceptOrderCancellation' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function acceptOrderCancellation_0Request($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation_0'][0]) + public function acceptOrderCancellationRequest($campaign_id, $order_id, $accept_order_cancellation_request, string $contentType = self::contentTypes['acceptOrderCancellation'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling acceptOrderCancellation_0' + 'Missing the required parameter $campaign_id when calling acceptOrderCancellation' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.acceptOrderCancellation_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.acceptOrderCancellation, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling acceptOrderCancellation_0' + 'Missing the required parameter $order_id when calling acceptOrderCancellation' ); } // verify the required parameter 'accept_order_cancellation_request' is set if ($accept_order_cancellation_request === null || (is_array($accept_order_cancellation_request) && count($accept_order_cancellation_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $accept_order_cancellation_request when calling acceptOrderCancellation_0' + 'Missing the required parameter $accept_order_cancellation_request when calling acceptOrderCancellation' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/cancellation/accept'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1064,40 +919,40 @@ class DbsApi } /** - * Operation addHiddenOffers_2 + * Operation addHiddenOffers * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addHiddenOffers_2($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_2'][0]) + public function addHiddenOffers($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - list($response) = $this->addHiddenOffers_2WithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); + list($response) = $this->addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); return $response; } /** - * Operation addHiddenOffers_2WithHttpInfo + * Operation addHiddenOffersWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addHiddenOffers_2WithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_2'][0]) + public function addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - $request = $this->addHiddenOffers_2Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1124,196 +979,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1327,34 +1037,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1364,7 +1051,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1372,7 +1059,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1380,7 +1067,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1388,7 +1075,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1396,7 +1083,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1404,7 +1091,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1412,27 +1099,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addHiddenOffers_2Async + * Operation addHiddenOffersAsync * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_2Async($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_2'][0]) + public function addHiddenOffersAsync($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - return $this->addHiddenOffers_2AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) + return $this->addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1441,21 +1130,21 @@ class DbsApi } /** - * Operation addHiddenOffers_2AsyncWithHttpInfo + * Operation addHiddenOffersAsyncWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_2AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_2'][0]) + public function addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->addHiddenOffers_2Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1494,37 +1183,37 @@ class DbsApi } /** - * Create request for operation 'addHiddenOffers_2' + * Create request for operation 'addHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addHiddenOffers_2Request($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_2'][0]) + public function addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling addHiddenOffers_2' + 'Missing the required parameter $campaign_id when calling addHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.addHiddenOffers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.addHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'add_hidden_offers_request' is set if ($add_hidden_offers_request === null || (is_array($add_hidden_offers_request) && count($add_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers_2' + 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1613,40 +1302,40 @@ class DbsApi } /** - * Operation addOffersToArchive_0 + * Operation addOffersToArchive * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addOffersToArchive_0($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_0'][0]) + public function addOffersToArchive($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - list($response) = $this->addOffersToArchive_0WithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); + list($response) = $this->addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); return $response; } /** - * Operation addOffersToArchive_0WithHttpInfo + * Operation addOffersToArchiveWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addOffersToArchive_0WithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_0'][0]) + public function addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - $request = $this->addOffersToArchive_0Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1673,223 +1362,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AddOffersToArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1903,34 +1426,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1940,7 +1440,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1948,7 +1448,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1956,7 +1456,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1964,7 +1464,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1972,7 +1472,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1980,7 +1480,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1988,7 +1488,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1996,27 +1496,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addOffersToArchive_0Async + * Operation addOffersToArchiveAsync * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_0Async($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_0'][0]) + public function addOffersToArchiveAsync($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - return $this->addOffersToArchive_0AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) + return $this->addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2025,21 +1527,21 @@ class DbsApi } /** - * Operation addOffersToArchive_0AsyncWithHttpInfo + * Operation addOffersToArchiveAsyncWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_0AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_0'][0]) + public function addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - $request = $this->addOffersToArchive_0Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2078,37 +1580,37 @@ class DbsApi } /** - * Create request for operation 'addOffersToArchive_0' + * Create request for operation 'addOffersToArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addOffersToArchive_0Request($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_0'][0]) + public function addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling addOffersToArchive_0' + 'Missing the required parameter $business_id when calling addOffersToArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.addOffersToArchive_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.addOffersToArchive, must be bigger than or equal to 1.'); } // verify the required parameter 'add_offers_to_archive_request' is set if ($add_offers_to_archive_request === null || (is_array($add_offers_to_archive_request) && count($add_offers_to_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive_0' + 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/archive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2197,38 +1699,38 @@ class DbsApi } /** - * Operation calculateTariffs_2 + * Operation calculateTariffs * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function calculateTariffs_2($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_2'][0]) + public function calculateTariffs($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - list($response) = $this->calculateTariffs_2WithHttpInfo($calculate_tariffs_request, $contentType); + list($response) = $this->calculateTariffsWithHttpInfo($calculate_tariffs_request, $contentType); return $response; } /** - * Operation calculateTariffs_2WithHttpInfo + * Operation calculateTariffsWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function calculateTariffs_2WithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_2'][0]) + public function calculateTariffsWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - $request = $this->calculateTariffs_2Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2255,196 +1757,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CalculateTariffsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2458,34 +1815,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2495,7 +1829,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2503,7 +1837,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2511,7 +1845,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2519,7 +1853,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2527,7 +1861,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2535,7 +1869,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2543,26 +1877,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation calculateTariffs_2Async + * Operation calculateTariffsAsync * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_2Async($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_2'][0]) + public function calculateTariffsAsync($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - return $this->calculateTariffs_2AsyncWithHttpInfo($calculate_tariffs_request, $contentType) + return $this->calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2571,20 +1907,20 @@ class DbsApi } /** - * Operation calculateTariffs_2AsyncWithHttpInfo + * Operation calculateTariffsAsyncWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_2AsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_2'][0]) + public function calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - $request = $this->calculateTariffs_2Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2623,26 +1959,26 @@ class DbsApi } /** - * Create request for operation 'calculateTariffs_2' + * Create request for operation 'calculateTariffs' * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function calculateTariffs_2Request($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_2'][0]) + public function calculateTariffsRequest($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { // verify the required parameter 'calculate_tariffs_request' is set if ($calculate_tariffs_request === null || (is_array($calculate_tariffs_request) && count($calculate_tariffs_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs_2' + 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs' ); } - $resourcePath = '/tariffs/calculate'; + $resourcePath = '/v2/tariffs/calculate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2723,40 +2059,40 @@ class DbsApi } /** - * Operation confirmBusinessPrices_0 + * Operation confirmBusinessPrices * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmBusinessPrices_0($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_0'][0]) + public function confirmBusinessPrices($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - list($response) = $this->confirmBusinessPrices_0WithHttpInfo($business_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmBusinessPrices_0WithHttpInfo + * Operation confirmBusinessPricesWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmBusinessPrices_0WithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_0'][0]) + public function confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - $request = $this->confirmBusinessPrices_0Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2783,223 +2119,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3013,34 +2183,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3050,7 +2197,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3058,7 +2205,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3066,7 +2213,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3074,7 +2221,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3082,7 +2229,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3090,7 +2237,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3098,7 +2245,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3106,27 +2253,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmBusinessPrices_0Async + * Operation confirmBusinessPricesAsync * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_0Async($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_0'][0]) + public function confirmBusinessPricesAsync($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - return $this->confirmBusinessPrices_0AsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) + return $this->confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3135,21 +2284,21 @@ class DbsApi } /** - * Operation confirmBusinessPrices_0AsyncWithHttpInfo + * Operation confirmBusinessPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_0AsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_0'][0]) + public function confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmBusinessPrices_0Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3188,37 +2337,37 @@ class DbsApi } /** - * Create request for operation 'confirmBusinessPrices_0' + * Create request for operation 'confirmBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmBusinessPrices_0Request($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_0'][0]) + public function confirmBusinessPricesRequest($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling confirmBusinessPrices_0' + 'Missing the required parameter $business_id when calling confirmBusinessPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.confirmBusinessPrices_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.confirmBusinessPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices_0' + 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices' ); } - $resourcePath = '/businesses/{businessId}/price-quarantine/confirm'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3307,40 +2456,40 @@ class DbsApi } /** - * Operation confirmCampaignPrices_0 + * Operation confirmCampaignPrices * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmCampaignPrices_0($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_0'][0]) + public function confirmCampaignPrices($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - list($response) = $this->confirmCampaignPrices_0WithHttpInfo($campaign_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmCampaignPrices_0WithHttpInfo + * Operation confirmCampaignPricesWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmCampaignPrices_0WithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_0'][0]) + public function confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - $request = $this->confirmCampaignPrices_0Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3367,223 +2516,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3597,34 +2580,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3634,7 +2594,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3642,7 +2602,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3650,7 +2610,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3658,7 +2618,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3666,7 +2626,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3674,7 +2634,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3682,7 +2642,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3690,27 +2650,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmCampaignPrices_0Async + * Operation confirmCampaignPricesAsync * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_0Async($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_0'][0]) + public function confirmCampaignPricesAsync($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - return $this->confirmCampaignPrices_0AsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) + return $this->confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3719,21 +2681,21 @@ class DbsApi } /** - * Operation confirmCampaignPrices_0AsyncWithHttpInfo + * Operation confirmCampaignPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_0AsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_0'][0]) + public function confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmCampaignPrices_0Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3772,37 +2734,37 @@ class DbsApi } /** - * Create request for operation 'confirmCampaignPrices_0' + * Create request for operation 'confirmCampaignPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmCampaignPrices_0Request($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_0'][0]) + public function confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling confirmCampaignPrices_0' + 'Missing the required parameter $campaign_id when calling confirmCampaignPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.confirmCampaignPrices_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.confirmCampaignPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices_0' + 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3891,40 +2853,40 @@ class DbsApi } /** - * Operation createChat_0 + * Operation createChat * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function createChat_0($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_0'][0]) + public function createChat($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - list($response) = $this->createChat_0WithHttpInfo($business_id, $create_chat_request, $contentType); + list($response) = $this->createChatWithHttpInfo($business_id, $create_chat_request, $contentType); return $response; } /** - * Operation createChat_0WithHttpInfo + * Operation createChatWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createChat_0WithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_0'][0]) + public function createChatWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - $request = $this->createChat_0Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3951,196 +2913,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateChatResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateChatResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateChatResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4154,34 +2971,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4191,7 +2985,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4199,7 +2993,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4207,7 +3001,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4215,7 +3009,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4223,7 +3017,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4231,7 +3025,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4239,27 +3033,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation createChat_0Async + * Operation createChatAsync * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_0Async($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_0'][0]) + public function createChatAsync($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - return $this->createChat_0AsyncWithHttpInfo($business_id, $create_chat_request, $contentType) + return $this->createChatAsyncWithHttpInfo($business_id, $create_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4268,21 +3064,21 @@ class DbsApi } /** - * Operation createChat_0AsyncWithHttpInfo + * Operation createChatAsyncWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_0AsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_0'][0]) + public function createChatAsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - $request = $this->createChat_0Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4321,37 +3117,37 @@ class DbsApi } /** - * Create request for operation 'createChat_0' + * Create request for operation 'createChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createChat_0Request($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_0'][0]) + public function createChatRequest($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling createChat_0' + 'Missing the required parameter $business_id when calling createChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.createChat_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.createChat, must be bigger than or equal to 1.'); } // verify the required parameter 'create_chat_request' is set if ($create_chat_request === null || (is_array($create_chat_request) && count($create_chat_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_chat_request when calling createChat_0' + 'Missing the required parameter $create_chat_request when calling createChat' ); } - $resourcePath = '/businesses/{businessId}/chats/new'; + $resourcePath = '/v2/businesses/{businessId}/chats/new'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4440,40 +3236,40 @@ class DbsApi } /** - * Operation createOutlet_0 + * Operation createOutlet * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CreateOutletResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function createOutlet_0($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet_0'][0]) + public function createOutlet($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet'][0]) { - list($response) = $this->createOutlet_0WithHttpInfo($campaign_id, $change_outlet_request, $contentType); + list($response) = $this->createOutletWithHttpInfo($campaign_id, $change_outlet_request, $contentType); return $response; } /** - * Operation createOutlet_0WithHttpInfo + * Operation createOutletWithHttpInfo * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CreateOutletResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createOutlet_0WithHttpInfo($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet_0'][0]) + public function createOutletWithHttpInfo($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet'][0]) { - $request = $this->createOutlet_0Request($campaign_id, $change_outlet_request, $contentType); + $request = $this->createOutletRequest($campaign_id, $change_outlet_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4500,196 +3296,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateOutletResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateOutletResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateOutletResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateOutletResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4703,34 +3354,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\CreateOutletResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateOutletResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4740,7 +3368,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4748,7 +3376,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4756,7 +3384,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4764,7 +3392,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4772,7 +3400,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4780,7 +3408,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4788,27 +3416,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation createOutlet_0Async + * Operation createOutletAsync * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createOutlet_0Async($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet_0'][0]) + public function createOutletAsync($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet'][0]) { - return $this->createOutlet_0AsyncWithHttpInfo($campaign_id, $change_outlet_request, $contentType) + return $this->createOutletAsyncWithHttpInfo($campaign_id, $change_outlet_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4817,21 +3447,21 @@ class DbsApi } /** - * Operation createOutlet_0AsyncWithHttpInfo + * Operation createOutletAsyncWithHttpInfo * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createOutlet_0AsyncWithHttpInfo($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet_0'][0]) + public function createOutletAsyncWithHttpInfo($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet'][0]) { $returnType = '\OpenAPI\Client\Model\CreateOutletResponse'; - $request = $this->createOutlet_0Request($campaign_id, $change_outlet_request, $contentType); + $request = $this->createOutletRequest($campaign_id, $change_outlet_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4870,37 +3500,37 @@ class DbsApi } /** - * Create request for operation 'createOutlet_0' + * Create request for operation 'createOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createOutlet_0Request($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet_0'][0]) + public function createOutletRequest($campaign_id, $change_outlet_request, string $contentType = self::contentTypes['createOutlet'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling createOutlet_0' + 'Missing the required parameter $campaign_id when calling createOutlet' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.createOutlet_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.createOutlet, must be bigger than or equal to 1.'); } // verify the required parameter 'change_outlet_request' is set if ($change_outlet_request === null || (is_array($change_outlet_request) && count($change_outlet_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $change_outlet_request when calling createOutlet_0' + 'Missing the required parameter $change_outlet_request when calling createOutlet' ); } - $resourcePath = '/campaigns/{campaignId}/outlets'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4989,40 +3619,40 @@ class DbsApi } /** - * Operation deleteCampaignOffers_0 + * Operation deleteCampaignOffers * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteCampaignOffers_0($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_0'][0]) + public function deleteCampaignOffers($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - list($response) = $this->deleteCampaignOffers_0WithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); + list($response) = $this->deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); return $response; } /** - * Operation deleteCampaignOffers_0WithHttpInfo + * Operation deleteCampaignOffersWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCampaignOffers_0WithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_0'][0]) + public function deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - $request = $this->deleteCampaignOffers_0Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5049,223 +3679,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5279,34 +3743,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5316,7 +3757,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5324,7 +3765,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5332,7 +3773,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5340,7 +3781,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5348,7 +3789,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5356,7 +3797,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5364,7 +3805,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5372,27 +3813,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteCampaignOffers_0Async + * Operation deleteCampaignOffersAsync * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_0Async($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_0'][0]) + public function deleteCampaignOffersAsync($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - return $this->deleteCampaignOffers_0AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) + return $this->deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5401,21 +3844,21 @@ class DbsApi } /** - * Operation deleteCampaignOffers_0AsyncWithHttpInfo + * Operation deleteCampaignOffersAsyncWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_0AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_0'][0]) + public function deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - $request = $this->deleteCampaignOffers_0Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5454,37 +3897,37 @@ class DbsApi } /** - * Create request for operation 'deleteCampaignOffers_0' + * Create request for operation 'deleteCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCampaignOffers_0Request($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_0'][0]) + public function deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteCampaignOffers_0' + 'Missing the required parameter $campaign_id when calling deleteCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteCampaignOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteCampaignOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_campaign_offers_request' is set if ($delete_campaign_offers_request === null || (is_array($delete_campaign_offers_request) && count($delete_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers_0' + 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5573,40 +4016,40 @@ class DbsApi } /** - * Operation deleteGoodsFeedbackComment_2 + * Operation deleteGoodsFeedbackComment * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteGoodsFeedbackComment_2($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_2'][0]) + public function deleteGoodsFeedbackComment($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - list($response) = $this->deleteGoodsFeedbackComment_2WithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); + list($response) = $this->deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation deleteGoodsFeedbackComment_2WithHttpInfo + * Operation deleteGoodsFeedbackCommentWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteGoodsFeedbackComment_2WithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_2'][0]) + public function deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - $request = $this->deleteGoodsFeedbackComment_2Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5633,196 +4076,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5836,34 +4134,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5873,7 +4148,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5881,7 +4156,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5889,7 +4164,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5897,7 +4172,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5905,7 +4180,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5913,7 +4188,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5921,27 +4196,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteGoodsFeedbackComment_2Async + * Operation deleteGoodsFeedbackCommentAsync * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_2Async($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_2'][0]) + public function deleteGoodsFeedbackCommentAsync($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - return $this->deleteGoodsFeedbackComment_2AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) + return $this->deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5950,21 +4227,21 @@ class DbsApi } /** - * Operation deleteGoodsFeedbackComment_2AsyncWithHttpInfo + * Operation deleteGoodsFeedbackCommentAsyncWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_2AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_2'][0]) + public function deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteGoodsFeedbackComment_2Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6003,37 +4280,37 @@ class DbsApi } /** - * Create request for operation 'deleteGoodsFeedbackComment_2' + * Create request for operation 'deleteGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteGoodsFeedbackComment_2Request($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_2'][0]) + public function deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment_2' + 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deleteGoodsFeedbackComment_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deleteGoodsFeedbackComment, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_goods_feedback_comment_request' is set if ($delete_goods_feedback_comment_request === null || (is_array($delete_goods_feedback_comment_request) && count($delete_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment_2' + 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/delete'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6122,40 +4399,40 @@ class DbsApi } /** - * Operation deleteHiddenOffers_2 + * Operation deleteHiddenOffers * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteHiddenOffers_2($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_2'][0]) + public function deleteHiddenOffers($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - list($response) = $this->deleteHiddenOffers_2WithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); + list($response) = $this->deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); return $response; } /** - * Operation deleteHiddenOffers_2WithHttpInfo + * Operation deleteHiddenOffersWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteHiddenOffers_2WithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_2'][0]) + public function deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - $request = $this->deleteHiddenOffers_2Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6182,223 +4459,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6412,34 +4523,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -6449,7 +4537,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6457,7 +4545,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6465,7 +4553,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6473,7 +4561,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6481,7 +4569,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6489,7 +4577,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6497,7 +4585,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6505,27 +4593,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteHiddenOffers_2Async + * Operation deleteHiddenOffersAsync * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_2Async($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_2'][0]) + public function deleteHiddenOffersAsync($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - return $this->deleteHiddenOffers_2AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) + return $this->deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -6534,21 +4624,21 @@ class DbsApi } /** - * Operation deleteHiddenOffers_2AsyncWithHttpInfo + * Operation deleteHiddenOffersAsyncWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_2AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_2'][0]) + public function deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteHiddenOffers_2Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6587,37 +4677,37 @@ class DbsApi } /** - * Create request for operation 'deleteHiddenOffers_2' + * Create request for operation 'deleteHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteHiddenOffers_2Request($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_2'][0]) + public function deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteHiddenOffers_2' + 'Missing the required parameter $campaign_id when calling deleteHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteHiddenOffers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_hidden_offers_request' is set if ($delete_hidden_offers_request === null || (is_array($delete_hidden_offers_request) && count($delete_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers_2' + 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6706,40 +4796,40 @@ class DbsApi } /** - * Operation deleteOffersFromArchive_0 + * Operation deleteOffers * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffersFromArchive_0($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_0'][0]) + public function deleteOffers($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - list($response) = $this->deleteOffersFromArchive_0WithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); + list($response) = $this->deleteOffersWithHttpInfo($business_id, $delete_offers_request, $contentType); return $response; } /** - * Operation deleteOffersFromArchive_0WithHttpInfo + * Operation deleteOffersWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffersFromArchive_0WithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_0'][0]) + public function deleteOffersWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $request = $this->deleteOffersFromArchive_0Request($business_id, $delete_offers_from_archive_request, $contentType); + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6766,223 +4856,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6996,44 +4920,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + '\OpenAPI\Client\Model\DeleteOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7041,7 +4942,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7049,7 +4950,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7057,7 +4958,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7065,7 +4966,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7073,7 +4974,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7081,7 +4982,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7089,27 +4990,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffersFromArchive_0Async + * Operation deleteOffersAsync * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_0Async($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_0'][0]) + public function deleteOffersAsync($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - return $this->deleteOffersFromArchive_0AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) + return $this->deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -7118,21 +5021,21 @@ class DbsApi } /** - * Operation deleteOffersFromArchive_0AsyncWithHttpInfo + * Operation deleteOffersAsyncWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_0AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_0'][0]) + public function deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - $request = $this->deleteOffersFromArchive_0Request($business_id, $delete_offers_from_archive_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7171,37 +5074,37 @@ class DbsApi } /** - * Create request for operation 'deleteOffersFromArchive_0' + * Create request for operation 'deleteOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffersFromArchive_0Request($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_0'][0]) + public function deleteOffersRequest($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffersFromArchive_0' + 'Missing the required parameter $business_id when calling deleteOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deleteOffersFromArchive_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deleteOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_from_archive_request' is set - if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { + // verify the required parameter 'delete_offers_request' is set + if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive_0' + 'Missing the required parameter $delete_offers_request when calling deleteOffers' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/unarchive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7227,12 +5130,12 @@ class DbsApi ); // for model (json/xml) - if (isset($delete_offers_from_archive_request)) { + if (isset($delete_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); } else { - $httpBody = $delete_offers_from_archive_request; + $httpBody = $delete_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7290,40 +5193,40 @@ class DbsApi } /** - * Operation deleteOffers_0 + * Operation deleteOffersFromArchive * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffers_0($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_0'][0]) + public function deleteOffersFromArchive($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - list($response) = $this->deleteOffers_0WithHttpInfo($business_id, $delete_offers_request, $contentType); + list($response) = $this->deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); return $response; } /** - * Operation deleteOffers_0WithHttpInfo + * Operation deleteOffersFromArchiveWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffers_0WithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_0'][0]) + public function deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $request = $this->deleteOffers_0Request($business_id, $delete_offers_request, $contentType); + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -7350,223 +5253,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7580,44 +5317,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersResponse', + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7625,7 +5339,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7633,7 +5347,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7641,7 +5355,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7649,7 +5363,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7657,7 +5371,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7665,7 +5379,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7673,27 +5387,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffers_0Async + * Operation deleteOffersFromArchiveAsync * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_0Async($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_0'][0]) + public function deleteOffersFromArchiveAsync($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - return $this->deleteOffers_0AsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) + return $this->deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -7702,21 +5418,21 @@ class DbsApi } /** - * Operation deleteOffers_0AsyncWithHttpInfo + * Operation deleteOffersFromArchiveAsyncWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_0AsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_0'][0]) + public function deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - $request = $this->deleteOffers_0Request($business_id, $delete_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7755,37 +5471,37 @@ class DbsApi } /** - * Create request for operation 'deleteOffers_0' + * Create request for operation 'deleteOffersFromArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffers_0Request($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_0'][0]) + public function deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffers_0' + 'Missing the required parameter $business_id when calling deleteOffersFromArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deleteOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deleteOffersFromArchive, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_request' is set - if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { + // verify the required parameter 'delete_offers_from_archive_request' is set + if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_request when calling deleteOffers_0' + 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/delete'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/unarchive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7811,12 +5527,12 @@ class DbsApi ); // for model (json/xml) - if (isset($delete_offers_request)) { + if (isset($delete_offers_from_archive_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); } else { - $httpBody = $delete_offers_request; + $httpBody = $delete_offers_from_archive_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7874,40 +5590,40 @@ class DbsApi } /** - * Operation deleteOutletLicenses_0 + * Operation deleteOutlet * - * Удаление лицензий для точек продаж + * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $ids Список идентификаторов лицензий для удаления. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOutletLicenses_0($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses_0'][0]) + public function deleteOutlet($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet'][0]) { - list($response) = $this->deleteOutletLicenses_0WithHttpInfo($campaign_id, $ids, $contentType); + list($response) = $this->deleteOutletWithHttpInfo($campaign_id, $outlet_id, $contentType); return $response; } /** - * Operation deleteOutletLicenses_0WithHttpInfo + * Operation deleteOutletWithHttpInfo * - * Удаление лицензий для точек продаж + * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $ids Список идентификаторов лицензий для удаления. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOutletLicenses_0WithHttpInfo($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses_0'][0]) + public function deleteOutletWithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet'][0]) { - $request = $this->deleteOutletLicenses_0Request($campaign_id, $ids, $contentType); + $request = $this->deleteOutletRequest($campaign_id, $outlet_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7934,196 +5650,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8137,34 +5708,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8174,7 +5722,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8182,7 +5730,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8190,7 +5738,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8198,7 +5746,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8206,7 +5754,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8214,7 +5762,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8222,27 +5770,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOutletLicenses_0Async + * Operation deleteOutletAsync * - * Удаление лицензий для точек продаж + * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $ids Список идентификаторов лицензий для удаления. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOutletLicenses_0Async($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses_0'][0]) + public function deleteOutletAsync($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet'][0]) { - return $this->deleteOutletLicenses_0AsyncWithHttpInfo($campaign_id, $ids, $contentType) + return $this->deleteOutletAsyncWithHttpInfo($campaign_id, $outlet_id, $contentType) ->then( function ($response) { return $response[0]; @@ -8251,21 +5801,21 @@ class DbsApi } /** - * Operation deleteOutletLicenses_0AsyncWithHttpInfo + * Operation deleteOutletAsyncWithHttpInfo * - * Удаление лицензий для точек продаж + * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $ids Список идентификаторов лицензий для удаления. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOutletLicenses_0AsyncWithHttpInfo($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses_0'][0]) + public function deleteOutletAsyncWithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteOutletLicenses_0Request($campaign_id, $ids, $contentType); + $request = $this->deleteOutletRequest($campaign_id, $outlet_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8304,55 +5854,46 @@ class DbsApi } /** - * Create request for operation 'deleteOutletLicenses_0' + * Create request for operation 'deleteOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $ids Список идентификаторов лицензий для удаления. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOutletLicenses_0Request($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses_0'][0]) + public function deleteOutletRequest($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteOutletLicenses_0' + 'Missing the required parameter $campaign_id when calling deleteOutlet' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteOutletLicenses_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteOutlet, must be bigger than or equal to 1.'); } - // verify the required parameter 'ids' is set - if ($ids === null || (is_array($ids) && count($ids) === 0)) { + // verify the required parameter 'outlet_id' is set + if ($outlet_id === null || (is_array($outlet_id) && count($outlet_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $ids when calling deleteOutletLicenses_0' + 'Missing the required parameter $outlet_id when calling deleteOutlet' ); } - if (count($ids) < 1) { - throw new \InvalidArgumentException('invalid value for "$ids" when calling DbsApi.deleteOutletLicenses_0, number of items must be greater than or equal to 1.'); + if ($outlet_id < 1) { + throw new \InvalidArgumentException('invalid value for "$outlet_id" when calling DbsApi.deleteOutlet, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/outlets/licenses'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/{outletId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $ids, - 'ids', // param base name - 'array', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params @@ -8363,6 +5904,14 @@ class DbsApi $resourcePath ); } + // path params + if ($outlet_id !== null) { + $resourcePath = str_replace( + '{' . 'outletId' . '}', + ObjectSerializer::toPathValue($outlet_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -8428,40 +5977,40 @@ class DbsApi } /** - * Operation deleteOutlet_0 + * Operation deleteOutletLicenses * - * Удаление точки продаж + * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[] $ids Список идентификаторов лицензий для удаления. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOutlet_0($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet_0'][0]) + public function deleteOutletLicenses($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses'][0]) { - list($response) = $this->deleteOutlet_0WithHttpInfo($campaign_id, $outlet_id, $contentType); + list($response) = $this->deleteOutletLicensesWithHttpInfo($campaign_id, $ids, $contentType); return $response; } /** - * Operation deleteOutlet_0WithHttpInfo + * Operation deleteOutletLicensesWithHttpInfo * - * Удаление точки продаж + * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[] $ids Список идентификаторов лицензий для удаления. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOutlet_0WithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet_0'][0]) + public function deleteOutletLicensesWithHttpInfo($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses'][0]) { - $request = $this->deleteOutlet_0Request($campaign_id, $outlet_id, $contentType); + $request = $this->deleteOutletLicensesRequest($campaign_id, $ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -8488,196 +6037,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8691,34 +6095,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8728,7 +6109,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8736,7 +6117,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8744,7 +6125,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8752,7 +6133,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8760,7 +6141,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8768,7 +6149,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8776,27 +6157,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOutlet_0Async + * Operation deleteOutletLicensesAsync * - * Удаление точки продаж + * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[] $ids Список идентификаторов лицензий для удаления. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOutlet_0Async($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet_0'][0]) + public function deleteOutletLicensesAsync($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses'][0]) { - return $this->deleteOutlet_0AsyncWithHttpInfo($campaign_id, $outlet_id, $contentType) + return $this->deleteOutletLicensesAsyncWithHttpInfo($campaign_id, $ids, $contentType) ->then( function ($response) { return $response[0]; @@ -8805,21 +6188,21 @@ class DbsApi } /** - * Operation deleteOutlet_0AsyncWithHttpInfo + * Operation deleteOutletLicensesAsyncWithHttpInfo * - * Удаление точки продаж + * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[] $ids Список идентификаторов лицензий для удаления. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOutlet_0AsyncWithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet_0'][0]) + public function deleteOutletLicensesAsyncWithHttpInfo($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteOutlet_0Request($campaign_id, $outlet_id, $contentType); + $request = $this->deleteOutletLicensesRequest($campaign_id, $ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8858,46 +6241,58 @@ class DbsApi } /** - * Create request for operation 'deleteOutlet_0' + * Create request for operation 'deleteOutletLicenses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[] $ids Список идентификаторов лицензий для удаления. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOutlet_0Request($campaign_id, $outlet_id, string $contentType = self::contentTypes['deleteOutlet_0'][0]) + public function deleteOutletLicensesRequest($campaign_id, $ids, string $contentType = self::contentTypes['deleteOutletLicenses'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteOutlet_0' + 'Missing the required parameter $campaign_id when calling deleteOutletLicenses' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteOutlet_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.deleteOutletLicenses, must be bigger than or equal to 1.'); } - // verify the required parameter 'outlet_id' is set - if ($outlet_id === null || (is_array($outlet_id) && count($outlet_id) === 0)) { + // verify the required parameter 'ids' is set + if ($ids === null || (is_array($ids) && count($ids) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $outlet_id when calling deleteOutlet_0' + 'Missing the required parameter $ids when calling deleteOutletLicenses' ); } - if ($outlet_id < 1) { - throw new \InvalidArgumentException('invalid value for "$outlet_id" when calling DbsApi.deleteOutlet_0, must be bigger than or equal to 1.'); + if (count($ids) > 500) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling DbsApi.deleteOutletLicenses, number of items must be less than or equal to 500.'); + } + if (count($ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling DbsApi.deleteOutletLicenses, number of items must be greater than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/outlets/{outletId}'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/licenses'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ids, + 'ids', // param base name + 'array', // openApiType + '', // style + false, // explode + true // required + ) ?? []); // path params @@ -8908,14 +6303,6 @@ class DbsApi $resourcePath ); } - // path params - if ($outlet_id !== null) { - $resourcePath = str_replace( - '{' . 'outletId' . '}', - ObjectSerializer::toPathValue($outlet_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -8981,40 +6368,40 @@ class DbsApi } /** - * Operation deletePromoOffers_2 + * Operation deletePromoOffers * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deletePromoOffers_2($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_2'][0]) + public function deletePromoOffers($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - list($response) = $this->deletePromoOffers_2WithHttpInfo($business_id, $delete_promo_offers_request, $contentType); + list($response) = $this->deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, $contentType); return $response; } /** - * Operation deletePromoOffers_2WithHttpInfo + * Operation deletePromoOffersWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deletePromoOffers_2WithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_2'][0]) + public function deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - $request = $this->deletePromoOffers_2Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -9041,196 +6428,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeletePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9244,34 +6486,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9281,7 +6500,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9289,7 +6508,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9297,7 +6516,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9305,7 +6524,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9313,7 +6532,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9321,7 +6540,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9329,27 +6548,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deletePromoOffers_2Async + * Operation deletePromoOffersAsync * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_2Async($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_2'][0]) + public function deletePromoOffersAsync($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - return $this->deletePromoOffers_2AsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) + return $this->deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -9358,21 +6579,21 @@ class DbsApi } /** - * Operation deletePromoOffers_2AsyncWithHttpInfo + * Operation deletePromoOffersAsyncWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_2AsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_2'][0]) + public function deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - $request = $this->deletePromoOffers_2Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9411,37 +6632,37 @@ class DbsApi } /** - * Create request for operation 'deletePromoOffers_2' + * Create request for operation 'deletePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deletePromoOffers_2Request($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_2'][0]) + public function deletePromoOffersRequest($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deletePromoOffers_2' + 'Missing the required parameter $business_id when calling deletePromoOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deletePromoOffers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.deletePromoOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_promo_offers_request' is set if ($delete_promo_offers_request === null || (is_array($delete_promo_offers_request) && count($delete_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers_2' + 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/delete'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9530,40 +6751,40 @@ class DbsApi } /** - * Operation generateBoostConsolidatedReport_2 + * Operation generateBannersStatisticsReport * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateBoostConsolidatedReport_2($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_2'][0]) + public function generateBannersStatisticsReport($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - list($response) = $this->generateBoostConsolidatedReport_2WithHttpInfo($generate_boost_consolidated_request, $format, $contentType); + list($response) = $this->generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format, $contentType); return $response; } /** - * Operation generateBoostConsolidatedReport_2WithHttpInfo + * Operation generateBannersStatisticsReportWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateBoostConsolidatedReport_2WithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_2'][0]) + public function generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - $request = $this->generateBoostConsolidatedReport_2Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -9590,169 +6811,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9766,34 +6863,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9803,7 +6877,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9811,7 +6885,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9819,7 +6893,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9827,7 +6901,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9835,7 +6909,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9843,27 +6917,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateBoostConsolidatedReport_2Async + * Operation generateBannersStatisticsReportAsync * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_2Async($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_2'][0]) + public function generateBannersStatisticsReportAsync($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - return $this->generateBoostConsolidatedReport_2AsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) + return $this->generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -9872,21 +6948,21 @@ class DbsApi } /** - * Operation generateBoostConsolidatedReport_2AsyncWithHttpInfo + * Operation generateBannersStatisticsReportAsyncWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_2AsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_2'][0]) + public function generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateBoostConsolidatedReport_2Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9925,28 +7001,28 @@ class DbsApi } /** - * Create request for operation 'generateBoostConsolidatedReport_2' + * Create request for operation 'generateBannersStatisticsReport' * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateBoostConsolidatedReport_2Request($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_2'][0]) + public function generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - // verify the required parameter 'generate_boost_consolidated_request' is set - if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { + // verify the required parameter 'generate_banners_statistics_request' is set + if ($generate_banners_statistics_request === null || (is_array($generate_banners_statistics_request) && count($generate_banners_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport_2' + 'Missing the required parameter $generate_banners_statistics_request when calling generateBannersStatisticsReport' ); } - $resourcePath = '/reports/boost-consolidated/generate'; + $resourcePath = '/v2/reports/banners-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9973,12 +7049,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_boost_consolidated_request)) { + if (isset($generate_banners_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_banners_statistics_request)); } else { - $httpBody = $generate_boost_consolidated_request; + $httpBody = $generate_banners_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10036,40 +7112,40 @@ class DbsApi } /** - * Operation generateCompetitorsPositionReport_1 + * Operation generateBoostConsolidatedReport * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateCompetitorsPositionReport_1($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_1'][0]) + public function generateBoostConsolidatedReport($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - list($response) = $this->generateCompetitorsPositionReport_1WithHttpInfo($generate_competitors_position_report_request, $format, $contentType); + list($response) = $this->generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format, $contentType); return $response; } /** - * Operation generateCompetitorsPositionReport_1WithHttpInfo + * Operation generateBoostConsolidatedReportWithHttpInfo * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateCompetitorsPositionReport_1WithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_1'][0]) + public function generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - $request = $this->generateCompetitorsPositionReport_1Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -10096,169 +7172,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10272,34 +7224,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -10309,7 +7238,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10317,7 +7246,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10325,7 +7254,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10333,7 +7262,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10341,7 +7270,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10349,27 +7278,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateCompetitorsPositionReport_1Async + * Operation generateBoostConsolidatedReportAsync * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_1Async($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_1'][0]) + public function generateBoostConsolidatedReportAsync($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - return $this->generateCompetitorsPositionReport_1AsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) + return $this->generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -10378,21 +7309,21 @@ class DbsApi } /** - * Operation generateCompetitorsPositionReport_1AsyncWithHttpInfo + * Operation generateBoostConsolidatedReportAsyncWithHttpInfo * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_1AsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_1'][0]) + public function generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateCompetitorsPositionReport_1Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10431,28 +7362,28 @@ class DbsApi } /** - * Create request for operation 'generateCompetitorsPositionReport_1' + * Create request for operation 'generateBoostConsolidatedReport' * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateCompetitorsPositionReport_1Request($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_1'][0]) + public function generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - // verify the required parameter 'generate_competitors_position_report_request' is set - if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { + // verify the required parameter 'generate_boost_consolidated_request' is set + if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport_1' + 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport' ); } - $resourcePath = '/reports/competitors-position/generate'; + $resourcePath = '/v2/reports/boost-consolidated/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10479,12 +7410,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_competitors_position_report_request)) { + if (isset($generate_boost_consolidated_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); } else { - $httpBody = $generate_competitors_position_report_request; + $httpBody = $generate_boost_consolidated_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10542,40 +7473,40 @@ class DbsApi } /** - * Operation generateGoodsFeedbackReport_2 + * Operation generateClosureDocumentsDetalizationReport * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsFeedbackReport_2($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_2'][0]) + public function generateClosureDocumentsDetalizationReport($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - list($response) = $this->generateGoodsFeedbackReport_2WithHttpInfo($generate_goods_feedback_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType); return $response; } /** - * Operation generateGoodsFeedbackReport_2WithHttpInfo + * Operation generateClosureDocumentsDetalizationReportWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsFeedbackReport_2WithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_2'][0]) + public function generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - $request = $this->generateGoodsFeedbackReport_2Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -10602,169 +7533,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10778,34 +7591,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -10815,7 +7605,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10823,7 +7613,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10831,7 +7621,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10839,7 +7629,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10847,7 +7645,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10855,27 +7653,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsFeedbackReport_2Async + * Operation generateClosureDocumentsDetalizationReportAsync * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_2Async($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_2'][0]) + public function generateClosureDocumentsDetalizationReportAsync($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - return $this->generateGoodsFeedbackReport_2AsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) + return $this->generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -10884,21 +7684,21 @@ class DbsApi } /** - * Operation generateGoodsFeedbackReport_2AsyncWithHttpInfo + * Operation generateClosureDocumentsDetalizationReportAsyncWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_2AsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_2'][0]) + public function generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsFeedbackReport_2Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10937,28 +7737,28 @@ class DbsApi } /** - * Create request for operation 'generateGoodsFeedbackReport_2' + * Create request for operation 'generateClosureDocumentsDetalizationReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsFeedbackReport_2Request($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_2'][0]) + public function generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - // verify the required parameter 'generate_goods_feedback_request' is set - if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { + // verify the required parameter 'generate_closure_documents_detalization_request' is set + if ($generate_closure_documents_detalization_request === null || (is_array($generate_closure_documents_detalization_request) && count($generate_closure_documents_detalization_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport_2' + 'Missing the required parameter $generate_closure_documents_detalization_request when calling generateClosureDocumentsDetalizationReport' ); } - $resourcePath = '/reports/goods-feedback/generate'; + $resourcePath = '/v2/reports/closure-documents/detalization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10985,12 +7785,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_goods_feedback_request)) { + if (isset($generate_closure_documents_detalization_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_detalization_request)); } else { - $httpBody = $generate_goods_feedback_request; + $httpBody = $generate_closure_documents_detalization_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11048,40 +7848,38 @@ class DbsApi } /** - * Operation generateMassOrderLabelsReport_1 + * Operation generateClosureDocumentsReport * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateMassOrderLabelsReport_1($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_1'][0]) + public function generateClosureDocumentsReport($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - list($response) = $this->generateMassOrderLabelsReport_1WithHttpInfo($generate_mass_order_labels_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, $contentType); return $response; } /** - * Operation generateMassOrderLabelsReport_1WithHttpInfo + * Operation generateClosureDocumentsReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateMassOrderLabelsReport_1WithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_1'][0]) + public function generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - $request = $this->generateMassOrderLabelsReport_1Request($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -11108,169 +7906,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11284,34 +7958,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11321,7 +7972,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11329,7 +7980,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11337,7 +7988,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11345,7 +7996,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11353,7 +8004,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11361,27 +8012,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateMassOrderLabelsReport_1Async + * Operation generateClosureDocumentsReportAsync * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReport_1Async($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_1'][0]) + public function generateClosureDocumentsReportAsync($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - return $this->generateMassOrderLabelsReport_1AsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) + return $this->generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, $contentType) ->then( function ($response) { return $response[0]; @@ -11390,21 +8042,20 @@ class DbsApi } /** - * Operation generateMassOrderLabelsReport_1AsyncWithHttpInfo + * Operation generateClosureDocumentsReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReport_1AsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_1'][0]) + public function generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateMassOrderLabelsReport_1Request($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11443,43 +8094,32 @@ class DbsApi } /** - * Create request for operation 'generateMassOrderLabelsReport_1' + * Create request for operation 'generateClosureDocumentsReport' * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateMassOrderLabelsReport_1Request($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_1'][0]) + public function generateClosureDocumentsReportRequest($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - // verify the required parameter 'generate_mass_order_labels_request' is set - if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { + // verify the required parameter 'generate_closure_documents_request' is set + if ($generate_closure_documents_request === null || (is_array($generate_closure_documents_request) && count($generate_closure_documents_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport_1' + 'Missing the required parameter $generate_closure_documents_request when calling generateClosureDocumentsReport' ); } - - $resourcePath = '/reports/documents/labels/generate'; + $resourcePath = '/v2/reports/closure-documents/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'PageFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -11491,12 +8131,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_mass_order_labels_request)) { + if (isset($generate_closure_documents_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_request)); } else { - $httpBody = $generate_mass_order_labels_request; + $httpBody = $generate_closure_documents_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11554,46 +8194,40 @@ class DbsApi } /** - * Operation generateOrderLabel_1 + * Operation generateCompetitorsPositionReport * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет «Конкурентная позиция» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateOrderLabel_1($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_1'][0]) + public function generateCompetitorsPositionReport($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - list($response) = $this->generateOrderLabel_1WithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + list($response) = $this->generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format, $contentType); return $response; } /** - * Operation generateOrderLabel_1WithHttpInfo + * Operation generateCompetitorsPositionReportWithHttpInfo * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет «Конкурентная позиция» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateOrderLabel_1WithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_1'][0]) + public function generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - $request = $this->generateOrderLabel_1Request($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11620,196 +8254,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11823,44 +8306,21 @@ class DbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11868,7 +8328,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11876,7 +8336,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11884,15 +8344,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11900,7 +8352,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11908,30 +8360,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateOrderLabel_1Async + * Operation generateCompetitorsPositionReportAsync * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет «Конкурентная позиция» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabel_1Async($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_1'][0]) + public function generateCompetitorsPositionReportAsync($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - return $this->generateOrderLabel_1AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType) + return $this->generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -11940,24 +8391,21 @@ class DbsApi } /** - * Operation generateOrderLabel_1AsyncWithHttpInfo + * Operation generateCompetitorsPositionReportAsyncWithHttpInfo * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет «Конкурентная позиция» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabel_1AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_1'][0]) + public function generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - $returnType = '\SplFileObject'; - $request = $this->generateOrderLabel_1Request($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11996,55 +8444,28 @@ class DbsApi } /** - * Create request for operation 'generateOrderLabel_1' + * Create request for operation 'generateCompetitorsPositionReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateOrderLabel_1Request($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_1'][0]) + public function generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling generateOrderLabel_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.generateOrderLabel_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling generateOrderLabel_1' - ); - } - - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling generateOrderLabel_1' - ); - } - - // verify the required parameter 'box_id' is set - if ($box_id === null || (is_array($box_id) && count($box_id) === 0)) { + // verify the required parameter 'generate_competitors_position_report_request' is set + if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $box_id when calling generateOrderLabel_1' + 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; + $resourcePath = '/v2/reports/competitors-position/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12055,55 +8476,30 @@ class DbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($shipment_id !== null) { - $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), - $resourcePath - ); - } - // path params - if ($box_id !== null) { - $resourcePath = str_replace( - '{' . 'boxId' . '}', - ObjectSerializer::toPathValue($box_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_competitors_position_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); + } else { + $httpBody = $generate_competitors_position_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -12151,7 +8547,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -12159,42 +8555,40 @@ class DbsApi } /** - * Operation generateOrderLabels_1 + * Operation generateGoodsFeedbackReport * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateOrderLabels_1($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_1'][0]) + public function generateGoodsFeedbackReport($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - list($response) = $this->generateOrderLabels_1WithHttpInfo($campaign_id, $order_id, $format, $contentType); + list($response) = $this->generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format, $contentType); return $response; } /** - * Operation generateOrderLabels_1WithHttpInfo + * Operation generateGoodsFeedbackReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateOrderLabels_1WithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_1'][0]) + public function generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $request = $this->generateOrderLabels_1Request($campaign_id, $order_id, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12221,196 +8615,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12424,44 +8667,21 @@ class DbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12469,7 +8689,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12477,7 +8697,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12485,15 +8705,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12501,7 +8713,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12509,28 +8721,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateOrderLabels_1Async + * Operation generateGoodsFeedbackReportAsync * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabels_1Async($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_1'][0]) + public function generateGoodsFeedbackReportAsync($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - return $this->generateOrderLabels_1AsyncWithHttpInfo($campaign_id, $order_id, $format, $contentType) + return $this->generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12539,22 +8752,21 @@ class DbsApi } /** - * Operation generateOrderLabels_1AsyncWithHttpInfo + * Operation generateGoodsFeedbackReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabels_1AsyncWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_1'][0]) + public function generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $returnType = '\SplFileObject'; - $request = $this->generateOrderLabels_1Request($campaign_id, $order_id, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12593,39 +8805,28 @@ class DbsApi } /** - * Create request for operation 'generateOrderLabels_1' + * Create request for operation 'generateGoodsFeedbackReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateOrderLabels_1Request($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_1'][0]) + public function generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling generateOrderLabels_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.generateOrderLabels_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'generate_goods_feedback_request' is set + if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling generateOrderLabels_1' + 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; + $resourcePath = '/v2/reports/goods-feedback/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12636,39 +8837,30 @@ class DbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + } else { + $httpBody = $generate_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -12716,7 +8908,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -12724,40 +8916,40 @@ class DbsApi } /** - * Operation generatePricesReport_2 + * Operation generateGoodsPricesReport * - * Отчет «Цены на рынке» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generatePricesReport_2($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_2'][0]) + public function generateGoodsPricesReport($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - list($response) = $this->generatePricesReport_2WithHttpInfo($generate_prices_report_request, $format, $contentType); + list($response) = $this->generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format, $contentType); return $response; } /** - * Operation generatePricesReport_2WithHttpInfo + * Operation generateGoodsPricesReportWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generatePricesReport_2WithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_2'][0]) + public function generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $request = $this->generatePricesReport_2Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12784,169 +8976,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12960,34 +9028,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12997,7 +9042,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13005,7 +9050,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13013,7 +9058,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13021,7 +9066,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13029,7 +9074,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13037,27 +9082,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generatePricesReport_2Async + * Operation generateGoodsPricesReportAsync * - * Отчет «Цены на рынке» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_2Async($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_2'][0]) + public function generateGoodsPricesReportAsync($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - return $this->generatePricesReport_2AsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) + return $this->generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -13066,21 +9113,21 @@ class DbsApi } /** - * Operation generatePricesReport_2AsyncWithHttpInfo + * Operation generateGoodsPricesReportAsyncWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_2AsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_2'][0]) + public function generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generatePricesReport_2Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13119,28 +9166,28 @@ class DbsApi } /** - * Create request for operation 'generatePricesReport_2' + * Create request for operation 'generateGoodsPricesReport' * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generatePricesReport_2Request($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_2'][0]) + public function generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - // verify the required parameter 'generate_prices_report_request' is set - if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { + // verify the required parameter 'generate_goods_prices_report_request' is set + if ($generate_goods_prices_report_request === null || (is_array($generate_goods_prices_report_request) && count($generate_goods_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport_2' + 'Missing the required parameter $generate_goods_prices_report_request when calling generateGoodsPricesReport' ); } - $resourcePath = '/reports/prices/generate'; + $resourcePath = '/v2/reports/goods-prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13167,12 +9214,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_prices_report_request)) { + if (isset($generate_goods_prices_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_prices_report_request)); } else { - $httpBody = $generate_prices_report_request; + $httpBody = $generate_goods_prices_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13230,40 +9277,40 @@ class DbsApi } /** - * Operation generateShelfsStatisticsReport_2 + * Operation generateGoodsRealizationReport * - * Отчет по полкам + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShelfsStatisticsReport_2($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_2'][0]) + public function generateGoodsRealizationReport($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - list($response) = $this->generateShelfsStatisticsReport_2WithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); + list($response) = $this->generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format, $contentType); return $response; } /** - * Operation generateShelfsStatisticsReport_2WithHttpInfo + * Operation generateGoodsRealizationReportWithHttpInfo * - * Отчет по полкам + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShelfsStatisticsReport_2WithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_2'][0]) + public function generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - $request = $this->generateShelfsStatisticsReport_2Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -13290,169 +9337,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13466,34 +9395,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -13503,7 +9409,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13511,7 +9417,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13519,7 +9425,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13527,7 +9433,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13535,7 +9449,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13543,27 +9457,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShelfsStatisticsReport_2Async + * Operation generateGoodsRealizationReportAsync * - * Отчет по полкам + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_2Async($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_2'][0]) + public function generateGoodsRealizationReportAsync($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - return $this->generateShelfsStatisticsReport_2AsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) + return $this->generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -13572,21 +9488,21 @@ class DbsApi } /** - * Operation generateShelfsStatisticsReport_2AsyncWithHttpInfo + * Operation generateGoodsRealizationReportAsyncWithHttpInfo * - * Отчет по полкам + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_2AsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_2'][0]) + public function generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShelfsStatisticsReport_2Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13625,28 +9541,28 @@ class DbsApi } /** - * Create request for operation 'generateShelfsStatisticsReport_2' + * Create request for operation 'generateGoodsRealizationReport' * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShelfsStatisticsReport_2Request($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_2'][0]) + public function generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - // verify the required parameter 'generate_shelfs_statistics_request' is set - if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { + // verify the required parameter 'generate_goods_realization_report_request' is set + if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport_2' + 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport' ); } - $resourcePath = '/reports/shelf-statistics/generate'; + $resourcePath = '/v2/reports/goods-realization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13673,12 +9589,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_shelfs_statistics_request)) { + if (isset($generate_goods_realization_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); } else { - $httpBody = $generate_shelfs_statistics_request; + $httpBody = $generate_goods_realization_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13736,40 +9652,40 @@ class DbsApi } /** - * Operation generateShowsSalesReport_1 + * Operation generateJewelryFiscalReport * - * Отчет «Аналитика продаж» + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShowsSalesReport_1($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_1'][0]) + public function generateJewelryFiscalReport($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - list($response) = $this->generateShowsSalesReport_1WithHttpInfo($generate_shows_sales_report_request, $format, $contentType); + list($response) = $this->generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType); return $response; } /** - * Operation generateShowsSalesReport_1WithHttpInfo + * Operation generateJewelryFiscalReportWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShowsSalesReport_1WithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_1'][0]) + public function generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - $request = $this->generateShowsSalesReport_1Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -13796,169 +9712,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13972,34 +9764,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -14009,7 +9778,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14017,7 +9786,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14025,7 +9794,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14033,7 +9802,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14041,7 +9810,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14049,27 +9818,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShowsSalesReport_1Async + * Operation generateJewelryFiscalReportAsync * - * Отчет «Аналитика продаж» + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_1Async($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_1'][0]) + public function generateJewelryFiscalReportAsync($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - return $this->generateShowsSalesReport_1AsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) + return $this->generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14078,21 +9849,21 @@ class DbsApi } /** - * Operation generateShowsSalesReport_1AsyncWithHttpInfo + * Operation generateJewelryFiscalReportAsyncWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_1AsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_1'][0]) + public function generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShowsSalesReport_1Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14131,28 +9902,28 @@ class DbsApi } /** - * Create request for operation 'generateShowsSalesReport_1' + * Create request for operation 'generateJewelryFiscalReport' * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShowsSalesReport_1Request($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_1'][0]) + public function generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - // verify the required parameter 'generate_shows_sales_report_request' is set - if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { + // verify the required parameter 'generate_jewelry_fiscal_report_request' is set + if ($generate_jewelry_fiscal_report_request === null || (is_array($generate_jewelry_fiscal_report_request) && count($generate_jewelry_fiscal_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport_1' + 'Missing the required parameter $generate_jewelry_fiscal_report_request when calling generateJewelryFiscalReport' ); } - $resourcePath = '/reports/shows-sales/generate'; + $resourcePath = '/v2/reports/jewelry-fiscal/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14179,12 +9950,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_shows_sales_report_request)) { + if (isset($generate_jewelry_fiscal_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_jewelry_fiscal_report_request)); } else { - $httpBody = $generate_shows_sales_report_request; + $httpBody = $generate_jewelry_fiscal_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -14242,40 +10013,40 @@ class DbsApi } /** - * Operation generateStocksOnWarehousesReport_2 + * Operation generateKeyIndicatorsReport * - * Отчет по остаткам на складах + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateStocksOnWarehousesReport_2($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_2'][0]) + public function generateKeyIndicatorsReport($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - list($response) = $this->generateStocksOnWarehousesReport_2WithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + list($response) = $this->generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format, $contentType); return $response; } /** - * Operation generateStocksOnWarehousesReport_2WithHttpInfo + * Operation generateKeyIndicatorsReportWithHttpInfo * - * Отчет по остаткам на складах + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateStocksOnWarehousesReport_2WithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_2'][0]) + public function generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - $request = $this->generateStocksOnWarehousesReport_2Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14302,169 +10073,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14478,34 +10125,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -14515,7 +10139,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14523,7 +10147,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14531,7 +10155,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14539,7 +10163,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14547,7 +10171,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14555,27 +10179,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateStocksOnWarehousesReport_2Async + * Operation generateKeyIndicatorsReportAsync * - * Отчет по остаткам на складах + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_2Async($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_2'][0]) + public function generateKeyIndicatorsReportAsync($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - return $this->generateStocksOnWarehousesReport_2AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) + return $this->generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14584,21 +10210,21 @@ class DbsApi } /** - * Operation generateStocksOnWarehousesReport_2AsyncWithHttpInfo + * Operation generateKeyIndicatorsReportAsyncWithHttpInfo * - * Отчет по остаткам на складах + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_2AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_2'][0]) + public function generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateStocksOnWarehousesReport_2Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14637,28 +10263,28 @@ class DbsApi } /** - * Create request for operation 'generateStocksOnWarehousesReport_2' + * Create request for operation 'generateKeyIndicatorsReport' * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateStocksOnWarehousesReport_2Request($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_2'][0]) + public function generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set - if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { + // verify the required parameter 'generate_key_indicators_request' is set + if ($generate_key_indicators_request === null || (is_array($generate_key_indicators_request) && count($generate_key_indicators_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport_2' + 'Missing the required parameter $generate_key_indicators_request when calling generateKeyIndicatorsReport' ); } - $resourcePath = '/reports/stocks-on-warehouses/generate'; + $resourcePath = '/v2/reports/key-indicators/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14685,12 +10311,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_stocks_on_warehouses_report_request)) { + if (isset($generate_key_indicators_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_key_indicators_request)); } else { - $httpBody = $generate_stocks_on_warehouses_report_request; + $httpBody = $generate_key_indicators_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -14748,40 +10374,40 @@ class DbsApi } /** - * Operation generateUnitedMarketplaceServicesReport_1 + * Operation generateMassOrderLabelsReport * - * Отчет по стоимости услуг + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedMarketplaceServicesReport_1($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_1'][0]) + public function generateMassOrderLabelsReport($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - list($response) = $this->generateUnitedMarketplaceServicesReport_1WithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType); + list($response) = $this->generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format, $contentType); return $response; } /** - * Operation generateUnitedMarketplaceServicesReport_1WithHttpInfo + * Operation generateMassOrderLabelsReportWithHttpInfo * - * Отчет по стоимости услуг + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedMarketplaceServicesReport_1WithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_1'][0]) + public function generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - $request = $this->generateUnitedMarketplaceServicesReport_1Request($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14808,169 +10434,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14984,34 +10486,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -15021,7 +10500,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15029,7 +10508,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15037,7 +10516,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15045,7 +10524,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15053,7 +10532,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15061,27 +10540,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedMarketplaceServicesReport_1Async + * Operation generateMassOrderLabelsReportAsync * - * Отчет по стоимости услуг + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_1Async($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_1'][0]) + public function generateMassOrderLabelsReportAsync($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - return $this->generateUnitedMarketplaceServicesReport_1AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType) + return $this->generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -15090,21 +10571,21 @@ class DbsApi } /** - * Operation generateUnitedMarketplaceServicesReport_1AsyncWithHttpInfo + * Operation generateMassOrderLabelsReportAsyncWithHttpInfo * - * Отчет по стоимости услуг + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_1AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_1'][0]) + public function generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedMarketplaceServicesReport_1Request($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15143,28 +10624,28 @@ class DbsApi } /** - * Create request for operation 'generateUnitedMarketplaceServicesReport_1' + * Create request for operation 'generateMassOrderLabelsReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedMarketplaceServicesReport_1Request($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_1'][0]) + public function generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - // verify the required parameter 'generate_united_marketplace_services_report_request' is set - if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { + // verify the required parameter 'generate_mass_order_labels_request' is set + if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport_1' + 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport' ); } - $resourcePath = '/reports/united-marketplace-services/generate'; + $resourcePath = '/v2/reports/documents/labels/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15175,7 +10656,7 @@ class DbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required @@ -15191,12 +10672,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_united_marketplace_services_report_request)) { + if (isset($generate_mass_order_labels_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); } else { - $httpBody = $generate_united_marketplace_services_report_request; + $httpBody = $generate_mass_order_labels_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -15254,40 +10735,40 @@ class DbsApi } /** - * Operation generateUnitedNettingReport_1 + * Operation generateOfferBarcodes * - * Отчет по платежам + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedNettingReport_1($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_1'][0]) + public function generateOfferBarcodes($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - list($response) = $this->generateUnitedNettingReport_1WithHttpInfo($generate_united_netting_report_request, $format, $contentType); + list($response) = $this->generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType); return $response; } /** - * Operation generateUnitedNettingReport_1WithHttpInfo + * Operation generateOfferBarcodesWithHttpInfo * - * Отчет по платежам + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedNettingReport_1WithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_1'][0]) + public function generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $request = $this->generateUnitedNettingReport_1Request($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -15314,169 +10795,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15490,44 +10853,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15535,7 +10875,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15543,7 +10883,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15551,7 +10891,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15559,7 +10899,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15567,27 +10915,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedNettingReport_1Async + * Operation generateOfferBarcodesAsync * - * Отчет по платежам + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_1Async($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_1'][0]) + public function generateOfferBarcodesAsync($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - return $this->generateUnitedNettingReport_1AsyncWithHttpInfo($generate_united_netting_report_request, $format, $contentType) + return $this->generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -15596,21 +10946,21 @@ class DbsApi } /** - * Operation generateUnitedNettingReport_1AsyncWithHttpInfo + * Operation generateOfferBarcodesAsyncWithHttpInfo * - * Отчет по платежам + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_1AsyncWithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_1'][0]) + public function generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedNettingReport_1Request($generate_united_netting_report_request, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse'; + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15649,45 +10999,53 @@ class DbsApi } /** - * Create request for operation 'generateUnitedNettingReport_1' + * Create request for operation 'generateOfferBarcodes' * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedNettingReport_1Request($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_1'][0]) + public function generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - // verify the required parameter 'generate_united_netting_report_request' is set - if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport_1' + 'Missing the required parameter $business_id when calling generateOfferBarcodes' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.generateOfferBarcodes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'generate_offer_barcodes_request' is set + if ($generate_offer_barcodes_request === null || (is_array($generate_offer_barcodes_request) && count($generate_offer_barcodes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_offer_barcodes_request when calling generateOfferBarcodes' ); } - - $resourcePath = '/reports/united-netting/generate'; + $resourcePath = '/v1/businesses/{businessId}/offer-mappings/barcodes/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -15697,12 +11055,12 @@ class DbsApi ); // for model (json/xml) - if (isset($generate_united_netting_report_request)) { + if (isset($generate_offer_barcodes_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_offer_barcodes_request)); } else { - $httpBody = $generate_united_netting_report_request; + $httpBody = $generate_offer_barcodes_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -15760,40 +11118,46 @@ class DbsApi } /** - * Operation generateUnitedOrdersReport_2 + * Operation generateOrderLabel * - * Отчет по заказам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedOrdersReport_2($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_2'][0]) + public function generateOrderLabel($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - list($response) = $this->generateUnitedOrdersReport_2WithHttpInfo($generate_united_orders_request, $format, $contentType); + list($response) = $this->generateOrderLabelWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); return $response; } /** - * Operation generateUnitedOrdersReport_2WithHttpInfo + * Operation generateOrderLabelWithHttpInfo * - * Отчет по заказам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedOrdersReport_2WithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_2'][0]) + public function generateOrderLabelWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - $request = $this->generateUnitedOrdersReport_2Request($generate_united_orders_request, $format, $contentType); + $request = $this->generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -15820,169 +11184,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15996,44 +11242,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16041,7 +11264,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16049,7 +11272,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16057,7 +11280,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16065,7 +11296,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16073,27 +11304,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedOrdersReport_2Async + * Operation generateOrderLabelAsync * - * Отчет по заказам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReport_2Async($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_2'][0]) + public function generateOrderLabelAsync($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - return $this->generateUnitedOrdersReport_2AsyncWithHttpInfo($generate_united_orders_request, $format, $contentType) + return $this->generateOrderLabelAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16102,21 +11338,24 @@ class DbsApi } /** - * Operation generateUnitedOrdersReport_2AsyncWithHttpInfo + * Operation generateOrderLabelAsyncWithHttpInfo * - * Отчет по заказам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReport_2AsyncWithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_2'][0]) + public function generateOrderLabelAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedOrdersReport_2Request($generate_united_orders_request, $format, $contentType); + $returnType = '\SplFileObject'; + $request = $this->generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16155,28 +11394,55 @@ class DbsApi } /** - * Create request for operation 'generateUnitedOrdersReport_2' + * Create request for operation 'generateOrderLabel' * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedOrdersReport_2Request($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_2'][0]) + public function generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - // verify the required parameter 'generate_united_orders_request' is set - if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport_2' + 'Missing the required parameter $campaign_id when calling generateOrderLabel' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.generateOrderLabel, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling generateOrderLabel' ); } + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $shipment_id when calling generateOrderLabel' + ); + } + + // verify the required parameter 'box_id' is set + if ($box_id === null || (is_array($box_id) && count($box_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $box_id when calling generateOrderLabel' + ); + } - $resourcePath = '/reports/united-orders/generate'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16187,30 +11453,55 @@ class DbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), + $resourcePath + ); + } + // path params + if ($box_id !== null) { + $resourcePath = str_replace( + '{' . 'boxId' . '}', + ObjectSerializer::toPathValue($box_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); // for model (json/xml) - if (isset($generate_united_orders_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); - } else { - $httpBody = $generate_united_orders_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -16258,7 +11549,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -16266,44 +11557,42 @@ class DbsApi } /** - * Operation getAllOffers_0 + * Operation generateOrderLabels * - * Все предложения магазина + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getAllOffers_0($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_0'][0]) + public function generateOrderLabels($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - list($response) = $this->getAllOffers_0WithHttpInfo($campaign_id, $feed_id, $chunk, $contentType); + list($response) = $this->generateOrderLabelsWithHttpInfo($campaign_id, $order_id, $format, $contentType); return $response; } /** - * Operation getAllOffers_0WithHttpInfo + * Operation generateOrderLabelsWithHttpInfo * - * Все предложения магазина + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getAllOffers_0WithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_0'][0]) + public function generateOrderLabelsWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - $request = $this->getAllOffers_0Request($campaign_id, $feed_id, $chunk, $contentType); + $request = $this->generateOrderLabelsRequest($campaign_id, $order_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16330,196 +11619,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetAllOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetAllOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetAllOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -16533,44 +11677,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetAllOffersResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16578,7 +11699,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16586,7 +11707,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16594,7 +11715,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16602,7 +11723,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16610,7 +11731,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16618,29 +11739,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllOffers_0Async + * Operation generateOrderLabelsAsync * - * Все предложения магазина + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffers_0Async($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_0'][0]) + public function generateOrderLabelsAsync($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - return $this->getAllOffers_0AsyncWithHttpInfo($campaign_id, $feed_id, $chunk, $contentType) + return $this->generateOrderLabelsAsyncWithHttpInfo($campaign_id, $order_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16649,23 +11771,22 @@ class DbsApi } /** - * Operation getAllOffers_0AsyncWithHttpInfo + * Operation generateOrderLabelsAsyncWithHttpInfo * - * Все предложения магазина + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffers_0AsyncWithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_0'][0]) + public function generateOrderLabelsAsyncWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - $request = $this->getAllOffers_0Request($campaign_id, $feed_id, $chunk, $contentType); + $returnType = '\SplFileObject'; + $request = $this->generateOrderLabelsRequest($campaign_id, $order_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16704,34 +11825,39 @@ class DbsApi } /** - * Create request for operation 'getAllOffers_0' + * Create request for operation 'generateOrderLabels' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getAllOffers_0Request($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_0'][0]) + public function generateOrderLabelsRequest($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getAllOffers_0' + 'Missing the required parameter $campaign_id when calling generateOrderLabels' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getAllOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.generateOrderLabels, must be bigger than or equal to 1.'); } + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling generateOrderLabels' + ); + } - $resourcePath = '/campaigns/{campaignId}/offers/all'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16740,18 +11866,9 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chunk, - 'chunk', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'PageFormatType', // openApiType '', // style false, // explode false // required @@ -16766,10 +11883,18 @@ class DbsApi $resourcePath ); } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); @@ -16831,44 +11956,42 @@ class DbsApi } /** - * Operation getBidsInfoForBusiness_0 + * Operation generatePricesReport * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getBidsInfoForBusiness_0($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_0'][0]) + public function generatePricesReport($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - list($response) = $this->getBidsInfoForBusiness_0WithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + list($response) = $this->generatePricesReportWithHttpInfo($generate_prices_report_request, $format, $contentType); return $response; } /** - * Operation getBidsInfoForBusiness_0WithHttpInfo + * Operation generatePricesReportWithHttpInfo * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getBidsInfoForBusiness_0WithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_0'][0]) + public function generatePricesReportWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $request = $this->getBidsInfoForBusiness_0Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16895,196 +12018,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17098,44 +12070,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsInfoResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17143,7 +12092,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17151,7 +12100,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17159,15 +12108,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17175,7 +12116,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17183,29 +12124,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsInfoForBusiness_0Async + * Operation generatePricesReportAsync * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getBidsInfoForBusiness_0Async($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_0'][0]) + public function generatePricesReportAsync($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - return $this->getBidsInfoForBusiness_0AsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) + return $this->generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -17214,23 +12156,22 @@ class DbsApi } /** - * Operation getBidsInfoForBusiness_0AsyncWithHttpInfo + * Operation generatePricesReportAsyncWithHttpInfo * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getBidsInfoForBusiness_0AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_0'][0]) + public function generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - $request = $this->getBidsInfoForBusiness_0Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17269,35 +12210,29 @@ class DbsApi } /** - * Create request for operation 'getBidsInfoForBusiness_0' + * Create request for operation 'generatePricesReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getBidsInfoForBusiness_0Request($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_0'][0]) + public function generatePricesReportRequest($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_prices_report_request' is set + if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsInfoForBusiness_0' + 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBidsInfoForBusiness_0, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/businesses/{businessId}/bids/info'; + $resourcePath = '/v2/reports/prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17306,32 +12241,15 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -17341,12 +12259,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_bids_info_request)) { + if (isset($generate_prices_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); } else { - $httpBody = $get_bids_info_request; + $httpBody = $generate_prices_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -17404,40 +12322,40 @@ class DbsApi } /** - * Operation getBidsRecommendations_0 + * Operation generateSalesGeographyReport * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBidsRecommendations_0($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_0'][0]) + public function generateSalesGeographyReport($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - list($response) = $this->getBidsRecommendations_0WithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); + list($response) = $this->generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format, $contentType); return $response; } /** - * Operation getBidsRecommendations_0WithHttpInfo + * Operation generateSalesGeographyReportWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBidsRecommendations_0WithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_0'][0]) + public function generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $request = $this->getBidsRecommendations_0Request($business_id, $get_bids_recommendations_request, $contentType); + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -17464,196 +12382,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17667,44 +12434,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17712,7 +12456,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17720,7 +12464,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17728,15 +12472,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17744,7 +12480,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17752,27 +12488,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsRecommendations_0Async + * Operation generateSalesGeographyReportAsync * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_0Async($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_0'][0]) + public function generateSalesGeographyReportAsync($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - return $this->getBidsRecommendations_0AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) + return $this->generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -17781,21 +12519,21 @@ class DbsApi } /** - * Operation getBidsRecommendations_0AsyncWithHttpInfo + * Operation generateSalesGeographyReportAsyncWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_0AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_0'][0]) + public function generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - $request = $this->getBidsRecommendations_0Request($business_id, $get_bids_recommendations_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17834,53 +12572,45 @@ class DbsApi } /** - * Create request for operation 'getBidsRecommendations_0' + * Create request for operation 'generateSalesGeographyReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBidsRecommendations_0Request($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_0'][0]) + public function generateSalesGeographyReportRequest($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_sales_geography_request' is set + if ($generate_sales_geography_request === null || (is_array($generate_sales_geography_request) && count($generate_sales_geography_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsRecommendations_0' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBidsRecommendations_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_bids_recommendations_request' is set - if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations_0' + 'Missing the required parameter $generate_sales_geography_request when calling generateSalesGeographyReport' ); } - $resourcePath = '/businesses/{businessId}/bids/recommendations'; + + $resourcePath = '/v2/reports/sales-geography/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -17890,12 +12620,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_bids_recommendations_request)) { + if (isset($generate_sales_geography_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_sales_geography_request)); } else { - $httpBody = $get_bids_recommendations_request; + $httpBody = $generate_sales_geography_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -17953,44 +12683,40 @@ class DbsApi } /** - * Operation getBusinessQuarantineOffers_0 + * Operation generateShelfsStatisticsReport * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessQuarantineOffers_0($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_0'][0]) + public function generateShelfsStatisticsReport($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - list($response) = $this->getBusinessQuarantineOffers_0WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); return $response; } /** - * Operation getBusinessQuarantineOffers_0WithHttpInfo + * Operation generateShelfsStatisticsReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessQuarantineOffers_0WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_0'][0]) + public function generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $request = $this->getBusinessQuarantineOffers_0Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -18017,196 +12743,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18220,44 +12795,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18265,7 +12817,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18273,7 +12825,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18281,15 +12833,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18297,7 +12841,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18305,29 +12849,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessQuarantineOffers_0Async + * Operation generateShelfsStatisticsReportAsync * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_0Async($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_0'][0]) + public function generateShelfsStatisticsReportAsync($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - return $this->getBusinessQuarantineOffers_0AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -18336,23 +12880,21 @@ class DbsApi } /** - * Operation getBusinessQuarantineOffers_0AsyncWithHttpInfo + * Operation generateShelfsStatisticsReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_0AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_0'][0]) + public function generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getBusinessQuarantineOffers_0Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18391,41 +12933,28 @@ class DbsApi } /** - * Create request for operation 'getBusinessQuarantineOffers_0' + * Create request for operation 'generateShelfsStatisticsReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessQuarantineOffers_0Request($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_0'][0]) + public function generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers_0' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBusinessQuarantineOffers_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_shelfs_statistics_request' is set + if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers_0' + 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport' ); } - - $resourcePath = '/businesses/{businessId}/price-quarantine'; + $resourcePath = '/v2/reports/shelf-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18434,32 +12963,15 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -18469,12 +12981,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_shelfs_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_shelfs_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -18532,38 +13044,40 @@ class DbsApi } /** - * Operation getBusinessSettings_0 + * Operation generateShowsBoostReport * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessSettings_0($business_id, string $contentType = self::contentTypes['getBusinessSettings_0'][0]) + public function generateShowsBoostReport($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - list($response) = $this->getBusinessSettings_0WithHttpInfo($business_id, $contentType); + list($response) = $this->generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format, $contentType); return $response; } /** - * Operation getBusinessSettings_0WithHttpInfo + * Operation generateShowsBoostReportWithHttpInfo * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessSettings_0WithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_0'][0]) + public function generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $request = $this->getBusinessSettings_0Request($business_id, $contentType); + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -18590,196 +13104,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18793,44 +13156,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18838,7 +13178,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18846,7 +13186,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18854,15 +13194,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18870,7 +13202,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18878,26 +13210,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessSettings_0Async + * Operation generateShowsBoostReportAsync * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_0Async($business_id, string $contentType = self::contentTypes['getBusinessSettings_0'][0]) + public function generateShowsBoostReportAsync($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - return $this->getBusinessSettings_0AsyncWithHttpInfo($business_id, $contentType) + return $this->generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -18906,20 +13241,21 @@ class DbsApi } /** - * Operation getBusinessSettings_0AsyncWithHttpInfo + * Operation generateShowsBoostReportAsyncWithHttpInfo * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_0AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_0'][0]) + public function generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - $request = $this->getBusinessSettings_0Request($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18958,45 +13294,45 @@ class DbsApi } /** - * Create request for operation 'getBusinessSettings_0' + * Create request for operation 'generateShowsBoostReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessSettings_0Request($business_id, string $contentType = self::contentTypes['getBusinessSettings_0'][0]) + public function generateShowsBoostReportRequest($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_shows_boost_request' is set + if ($generate_shows_boost_request === null || (is_array($generate_shows_boost_request) && count($generate_shows_boost_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessSettings_0' + 'Missing the required parameter $generate_shows_boost_request when calling generateShowsBoostReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBusinessSettings_0, must be bigger than or equal to 1.'); - } - - $resourcePath = '/businesses/{businessId}/settings'; + + + $resourcePath = '/v2/reports/shows-boost/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19006,7 +13342,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_shows_boost_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_boost_request)); + } else { + $httpBody = $generate_shows_boost_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -19062,38 +13405,40 @@ class DbsApi } /** - * Operation getCampaignLogins_0 + * Operation generateShowsSalesReport * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignLogins_0($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_0'][0]) + public function generateShowsSalesReport($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - list($response) = $this->getCampaignLogins_0WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format, $contentType); return $response; } /** - * Operation getCampaignLogins_0WithHttpInfo + * Operation generateShowsSalesReportWithHttpInfo * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignLogins_0WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_0'][0]) + public function generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $request = $this->getCampaignLogins_0Request($campaign_id, $contentType); + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -19120,196 +13465,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignLoginsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19323,44 +13523,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignLoginsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19368,7 +13545,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19376,7 +13553,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19384,7 +13561,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19392,7 +13569,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19400,7 +13577,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19408,26 +13585,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignLogins_0Async + * Operation generateShowsSalesReportAsync * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_0Async($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_0'][0]) + public function generateShowsSalesReportAsync($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - return $this->getCampaignLogins_0AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -19436,20 +13616,21 @@ class DbsApi } /** - * Operation getCampaignLogins_0AsyncWithHttpInfo + * Operation generateShowsSalesReportAsyncWithHttpInfo * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_0AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_0'][0]) + public function generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - $request = $this->getCampaignLogins_0Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19488,45 +13669,45 @@ class DbsApi } /** - * Create request for operation 'getCampaignLogins_0' + * Create request for operation 'generateShowsSalesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignLogins_0Request($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_0'][0]) + public function generateShowsSalesReportRequest($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_shows_sales_report_request' is set + if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignLogins_0' + 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignLogins_0, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/logins'; + + + $resourcePath = '/v2/reports/shows-sales/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19536,7 +13717,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_shows_sales_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + } else { + $httpBody = $generate_shows_sales_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -19584,7 +13772,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19592,44 +13780,40 @@ class DbsApi } /** - * Operation getCampaignOffers_0 + * Operation generateStocksOnWarehousesReport * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignOffers_0($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_0'][0]) + public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - list($response) = $this->getCampaignOffers_0WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); return $response; } /** - * Operation getCampaignOffers_0WithHttpInfo + * Operation generateStocksOnWarehousesReportWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignOffers_0WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_0'][0]) + public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $request = $this->getCampaignOffers_0Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -19656,196 +13840,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19859,44 +13898,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19904,7 +13920,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19912,7 +13928,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19920,7 +13936,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19928,7 +13944,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19936,7 +13952,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19944,29 +13960,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignOffers_0Async + * Operation generateStocksOnWarehousesReportAsync * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_0Async($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_0'][0]) + public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - return $this->getCampaignOffers_0AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) + return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -19975,23 +13991,21 @@ class DbsApi } /** - * Operation getCampaignOffers_0AsyncWithHttpInfo + * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_0AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_0'][0]) + public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - $request = $this->getCampaignOffers_0Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20030,41 +14044,28 @@ class DbsApi } /** - * Create request for operation 'getCampaignOffers_0' + * Create request for operation 'generateStocksOnWarehousesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignOffers_0Request($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_0'][0]) + public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignOffers_0' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignOffers_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_campaign_offers_request' is set - if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set + if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers_0' + 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' ); } - - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/reports/stocks-on-warehouses/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20073,32 +14074,15 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -20108,12 +14092,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_campaign_offers_request)) { + if (isset($generate_stocks_on_warehouses_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); } else { - $httpBody = $get_campaign_offers_request; + $httpBody = $generate_stocks_on_warehouses_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -20171,44 +14155,42 @@ class DbsApi } /** - * Operation getCampaignQuarantineOffers_0 + * Operation generateUnitedMarketplaceServicesReport * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignQuarantineOffers_0($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_0'][0]) + public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - list($response) = $this->getCampaignQuarantineOffers_0WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignQuarantineOffers_0WithHttpInfo + * Operation generateUnitedMarketplaceServicesReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignQuarantineOffers_0WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_0'][0]) + public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $request = $this->getCampaignQuarantineOffers_0Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -20235,196 +14217,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20438,44 +14275,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20483,7 +14297,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20491,7 +14305,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20499,7 +14313,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20507,7 +14321,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20515,7 +14329,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20523,29 +14337,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignQuarantineOffers_0Async + * Operation generateUnitedMarketplaceServicesReportAsync * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_0Async($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_0'][0]) + public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - return $this->getCampaignQuarantineOffers_0AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -20554,23 +14369,22 @@ class DbsApi } /** - * Operation getCampaignQuarantineOffers_0AsyncWithHttpInfo + * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_0AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_0'][0]) + public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getCampaignQuarantineOffers_0Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20609,41 +14423,30 @@ class DbsApi } /** - * Create request for operation 'getCampaignQuarantineOffers_0' + * Create request for operation 'generateUnitedMarketplaceServicesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignQuarantineOffers_0Request($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_0'][0]) + public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers_0' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignQuarantineOffers_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_united_marketplace_services_report_request' is set + if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers_0' + 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine'; + $resourcePath = '/v2/reports/united-marketplace-services/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20652,32 +14455,24 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -20687,12 +14482,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_united_marketplace_services_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_united_marketplace_services_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -20750,40 +14545,42 @@ class DbsApi } /** - * Operation getCampaignRegion_0 + * Operation generateUnitedNettingReport * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignRegion_0($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_0'][0]) + public function generateUnitedNettingReport($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - list($response) = $this->getCampaignRegion_0WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignRegion_0WithHttpInfo + * Operation generateUnitedNettingReportWithHttpInfo * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRegion_0WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_0'][0]) + public function generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $request = $this->getCampaignRegion_0Request($campaign_id, $contentType); + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -20810,196 +14607,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignRegionResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21013,44 +14665,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignRegionResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21058,7 +14687,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21066,7 +14695,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21074,7 +14703,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21082,7 +14711,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21090,7 +14719,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21098,27 +14727,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignRegion_0Async + * Operation generateUnitedNettingReportAsync * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_0Async($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_0'][0]) + public function generateUnitedNettingReportAsync($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - return $this->getCampaignRegion_0AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -21127,21 +14759,22 @@ class DbsApi } /** - * Operation getCampaignRegion_0AsyncWithHttpInfo + * Operation generateUnitedNettingReportAsyncWithHttpInfo * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_0AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_0'][0]) + public function generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - $request = $this->getCampaignRegion_0Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21180,46 +14813,56 @@ class DbsApi } /** - * Create request for operation 'getCampaignRegion_0' + * Create request for operation 'generateUnitedNettingReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getCampaignRegion_0Request($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_0'][0]) + public function generateUnitedNettingReportRequest($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_netting_report_request' is set + if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignRegion_0' + 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignRegion_0, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/region'; + + + + $resourcePath = '/v2/reports/united-netting/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -21229,7 +14872,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_netting_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); + } else { + $httpBody = $generate_united_netting_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -21277,7 +14927,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -21285,38 +14935,42 @@ class DbsApi } /** - * Operation getCampaignSettings_0 + * Operation generateUnitedOrdersReport * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignSettings_0($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_0'][0]) + public function generateUnitedOrdersReport($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - list($response) = $this->getCampaignSettings_0WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignSettings_0WithHttpInfo + * Operation generateUnitedOrdersReportWithHttpInfo * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignSettings_0WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_0'][0]) + public function generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $request = $this->getCampaignSettings_0Request($campaign_id, $contentType); + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -21343,196 +14997,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21546,44 +15055,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21591,7 +15077,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21599,7 +15085,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21607,7 +15093,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21615,7 +15101,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21623,7 +15109,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21631,26 +15117,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignSettings_0Async + * Operation generateUnitedOrdersReportAsync * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_0Async($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_0'][0]) + public function generateUnitedOrdersReportAsync($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - return $this->getCampaignSettings_0AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -21659,20 +15149,22 @@ class DbsApi } /** - * Operation getCampaignSettings_0AsyncWithHttpInfo + * Operation generateUnitedOrdersReportAsyncWithHttpInfo * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_0AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_0'][0]) + public function generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - $request = $this->getCampaignSettings_0Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21711,45 +15203,56 @@ class DbsApi } /** - * Create request for operation 'getCampaignSettings_0' + * Create request for operation 'generateUnitedOrdersReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignSettings_0Request($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_0'][0]) + public function generateUnitedOrdersReportRequest($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_orders_request' is set + if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignSettings_0' + 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignSettings_0, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/settings'; + + + + $resourcePath = '/v2/reports/united-orders/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -21759,7 +15262,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_orders_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + } else { + $httpBody = $generate_united_orders_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -21807,7 +15317,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -21815,38 +15325,40 @@ class DbsApi } /** - * Operation getCampaign_0 + * Operation generateUnitedReturnsReport * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaign_0($campaign_id, string $contentType = self::contentTypes['getCampaign_0'][0]) + public function generateUnitedReturnsReport($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - list($response) = $this->getCampaign_0WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format, $contentType); return $response; } /** - * Operation getCampaign_0WithHttpInfo + * Operation generateUnitedReturnsReportWithHttpInfo * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaign_0WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_0'][0]) + public function generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $request = $this->getCampaign_0Request($campaign_id, $contentType); + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -21873,196 +15385,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22076,44 +15437,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22121,7 +15459,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22129,7 +15467,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22137,15 +15475,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22153,7 +15483,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22161,26 +15491,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaign_0Async + * Operation generateUnitedReturnsReportAsync * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_0Async($campaign_id, string $contentType = self::contentTypes['getCampaign_0'][0]) + public function generateUnitedReturnsReportAsync($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - return $this->getCampaign_0AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -22189,20 +15522,21 @@ class DbsApi } /** - * Operation getCampaign_0AsyncWithHttpInfo + * Operation generateUnitedReturnsReportAsyncWithHttpInfo * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_0AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_0'][0]) + public function generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - $request = $this->getCampaign_0Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22241,45 +15575,45 @@ class DbsApi } /** - * Create request for operation 'getCampaign_0' + * Create request for operation 'generateUnitedReturnsReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaign_0Request($campaign_id, string $contentType = self::contentTypes['getCampaign_0'][0]) + public function generateUnitedReturnsReportRequest($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_returns_request' is set + if ($generate_united_returns_request === null || (is_array($generate_united_returns_request) && count($generate_united_returns_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaign_0' + 'Missing the required parameter $generate_united_returns_request when calling generateUnitedReturnsReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaign_0, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}'; + + + $resourcePath = '/v2/reports/united-returns/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -22289,7 +15623,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_returns_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_returns_request)); + } else { + $httpBody = $generate_united_returns_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -22337,7 +15678,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -22345,42 +15686,36 @@ class DbsApi } /** - * Operation getCampaignsByLogin_0 + * Operation getAuthTokenInfo * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignsByLogin_0($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_0'][0]) + public function getAuthTokenInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - list($response) = $this->getCampaignsByLogin_0WithHttpInfo($login, $page, $page_size, $contentType); + list($response) = $this->getAuthTokenInfoWithHttpInfo($contentType); return $response; } /** - * Operation getCampaignsByLogin_0WithHttpInfo + * Operation getAuthTokenInfoWithHttpInfo * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignsByLogin_0WithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_0'][0]) + public function getAuthTokenInfoWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $request = $this->getCampaignsByLogin_0Request($login, $page, $page_size, $contentType); + $request = $this->getAuthTokenInfoRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -22407,196 +15742,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22610,44 +15794,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetTokenInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22655,7 +15816,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22663,7 +15824,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22671,15 +15832,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22687,7 +15840,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22695,28 +15848,27 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignsByLogin_0Async + * Operation getAuthTokenInfoAsync * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_0Async($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_0'][0]) + public function getAuthTokenInfoAsync(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - return $this->getCampaignsByLogin_0AsyncWithHttpInfo($login, $page, $page_size, $contentType) + return $this->getAuthTokenInfoAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -22725,22 +15877,19 @@ class DbsApi } /** - * Operation getCampaignsByLogin_0AsyncWithHttpInfo + * Operation getAuthTokenInfoAsyncWithHttpInfo * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_0AsyncWithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_0'][0]) + public function getAuthTokenInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaignsByLogin_0Request($login, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetTokenInfoResponse'; + $request = $this->getAuthTokenInfoRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22779,67 +15928,26 @@ class DbsApi } /** - * Create request for operation 'getCampaignsByLogin_0' + * Create request for operation 'getAuthTokenInfo' * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignsByLogin_0Request($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_0'][0]) + public function getAuthTokenInfoRequest(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - // verify the required parameter 'login' is set - if ($login === null || (is_array($login) && count($login) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $login when calling getCampaignsByLogin_0' - ); - } - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getCampaignsByLogin_0, must be smaller than or equal to 10000.'); - } - - - - $resourcePath = '/campaigns/by_login/{login}'; + $resourcePath = '/v2/auth/token'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($login !== null) { - $resourcePath = str_replace( - '{' . 'login' . '}', - ObjectSerializer::toPathValue($login), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -22897,7 +16005,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -22905,40 +16013,44 @@ class DbsApi } /** - * Operation getCampaigns_0 + * Operation getBidsInfoForBusiness * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaigns_0($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_0'][0]) + public function getBidsInfoForBusiness($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - list($response) = $this->getCampaigns_0WithHttpInfo($page, $page_size, $contentType); + list($response) = $this->getBidsInfoForBusinessWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $response; } /** - * Operation getCampaigns_0WithHttpInfo + * Operation getBidsInfoForBusinessWithHttpInfo * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaigns_0WithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_0'][0]) + public function getBidsInfoForBusinessWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $request = $this->getCampaigns_0Request($page, $page_size, $contentType); + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -22965,196 +16077,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23168,44 +16135,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetBidsInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23213,7 +16157,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23221,7 +16165,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23229,7 +16173,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23237,7 +16181,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23245,7 +16189,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23253,27 +16197,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaigns_0Async + * Operation getBidsInfoForBusinessAsync * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_0Async($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_0'][0]) + public function getBidsInfoForBusinessAsync($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - return $this->getCampaigns_0AsyncWithHttpInfo($page, $page_size, $contentType) + return $this->getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) ->then( function ($response) { return $response[0]; @@ -23282,21 +16230,23 @@ class DbsApi } /** - * Operation getCampaigns_0AsyncWithHttpInfo + * Operation getBidsInfoForBusinessAsyncWithHttpInfo * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_0AsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_0'][0]) + public function getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaigns_0Request($page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23335,25 +16285,38 @@ class DbsApi } /** - * Create request for operation 'getCampaigns_0' + * Create request for operation 'getBidsInfoForBusiness' * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaigns_0Request($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_0'][0]) + public function getBidsInfoForBusinessRequest($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getCampaigns_0, must be smaller than or equal to 10000.'); + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBidsInfoForBusiness' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns'; + $resourcePath = '/v2/businesses/{businessId}/bids/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23362,17 +16325,17 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -23380,6 +16343,14 @@ class DbsApi ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -23389,7 +16360,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_bids_info_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + } else { + $httpBody = $get_bids_info_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -23437,7 +16415,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -23445,38 +16423,40 @@ class DbsApi } /** - * Operation getCategoriesMaxSaleQuantum_2 + * Operation getBidsRecommendations * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesMaxSaleQuantum_2($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_2'][0]) + public function getBidsRecommendations($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - list($response) = $this->getCategoriesMaxSaleQuantum_2WithHttpInfo($get_categories_max_sale_quantum_request, $contentType); + list($response) = $this->getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); return $response; } /** - * Operation getCategoriesMaxSaleQuantum_2WithHttpInfo + * Operation getBidsRecommendationsWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesMaxSaleQuantum_2WithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_2'][0]) + public function getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $request = $this->getCategoriesMaxSaleQuantum_2Request($get_categories_max_sale_quantum_request, $contentType); + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -23503,196 +16483,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23706,44 +16541,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23751,7 +16563,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23759,7 +16571,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23767,7 +16579,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23775,7 +16587,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23783,7 +16595,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23791,26 +16603,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesMaxSaleQuantum_2Async + * Operation getBidsRecommendationsAsync * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_2Async($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_2'][0]) + public function getBidsRecommendationsAsync($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - return $this->getCategoriesMaxSaleQuantum_2AsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) + return $this->getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) ->then( function ($response) { return $response[0]; @@ -23819,20 +16634,21 @@ class DbsApi } /** - * Operation getCategoriesMaxSaleQuantum_2AsyncWithHttpInfo + * Operation getBidsRecommendationsAsyncWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_2AsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_2'][0]) + public function getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - $request = $this->getCategoriesMaxSaleQuantum_2Request($get_categories_max_sale_quantum_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23871,26 +16687,37 @@ class DbsApi } /** - * Create request for operation 'getCategoriesMaxSaleQuantum_2' + * Create request for operation 'getBidsRecommendations' * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesMaxSaleQuantum_2Request($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_2'][0]) + public function getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - // verify the required parameter 'get_categories_max_sale_quantum_request' is set - if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBidsRecommendations' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBidsRecommendations, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_bids_recommendations_request' is set + if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum_2' + 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations' ); } - $resourcePath = '/categories/max-sale-quantum'; + $resourcePath = '/v2/businesses/{businessId}/bids/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23899,6 +16726,14 @@ class DbsApi + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -23908,12 +16743,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_categories_max_sale_quantum_request)) { + if (isset($get_bids_recommendations_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); } else { - $httpBody = $get_categories_max_sale_quantum_request; + $httpBody = $get_bids_recommendations_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -23971,38 +16806,44 @@ class DbsApi } /** - * Operation getCategoriesTree_2 + * Operation getBusinessOrders * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesTree_2($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_2'][0]) + public function getBusinessOrders($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - list($response) = $this->getCategoriesTree_2WithHttpInfo($get_categories_request, $contentType); + list($response) = $this->getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoriesTree_2WithHttpInfo + * Operation getBusinessOrdersWithHttpInfo * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesTree_2WithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_2'][0]) + public function getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $request = $this->getCategoriesTree_2Request($get_categories_request, $contentType); + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -24029,196 +16870,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24232,44 +16928,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesResponse', + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24277,7 +16950,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24285,7 +16958,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24293,7 +16966,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24301,7 +16974,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24309,7 +16982,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24317,26 +16990,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesTree_2Async + * Operation getBusinessOrdersAsync * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_2Async($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_2'][0]) + public function getBusinessOrdersAsync($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - return $this->getCategoriesTree_2AsyncWithHttpInfo($get_categories_request, $contentType) + return $this->getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -24345,20 +17023,23 @@ class DbsApi } /** - * Operation getCategoriesTree_2AsyncWithHttpInfo + * Operation getBusinessOrdersAsyncWithHttpInfo * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_2AsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_2'][0]) + public function getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - $request = $this->getCategoriesTree_2Request($get_categories_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessOrdersResponse'; + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24397,28 +17078,78 @@ class DbsApi } /** - * Create request for operation 'getCategoriesTree_2' + * Create request for operation 'getBusinessOrders' * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesTree_2Request($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_2'][0]) + public function getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessOrders' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_business_orders_request' is set + if ($get_business_orders_request === null || (is_array($get_business_orders_request) && count($get_business_orders_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_business_orders_request when calling getBusinessOrders' + ); + } + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + - $resourcePath = '/categories/tree'; + $resourcePath = '/v1/businesses/{businessId}/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -24428,12 +17159,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_categories_request)) { + if (isset($get_business_orders_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_business_orders_request)); } else { - $httpBody = $get_categories_request; + $httpBody = $get_business_orders_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -24491,38 +17222,44 @@ class DbsApi } /** - * Operation getCategoryContentParameters_0 + * Operation getBusinessQuarantineOffers * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoryContentParameters_0($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_0'][0]) + public function getBusinessQuarantineOffers($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - list($response) = $this->getCategoryContentParameters_0WithHttpInfo($category_id, $contentType); + list($response) = $this->getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoryContentParameters_0WithHttpInfo + * Operation getBusinessQuarantineOffersWithHttpInfo * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoryContentParameters_0WithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_0'][0]) + public function getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $request = $this->getCategoryContentParameters_0Request($category_id, $contentType); + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -24549,196 +17286,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24752,44 +17344,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24797,7 +17366,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24805,7 +17374,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24813,7 +17382,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24821,7 +17390,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24829,7 +17398,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24837,26 +17406,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoryContentParameters_0Async + * Operation getBusinessQuarantineOffersAsync * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_0Async($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_0'][0]) + public function getBusinessQuarantineOffersAsync($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - return $this->getCategoryContentParameters_0AsyncWithHttpInfo($category_id, $contentType) + return $this->getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -24865,20 +17439,23 @@ class DbsApi } /** - * Operation getCategoryContentParameters_0AsyncWithHttpInfo + * Operation getBusinessQuarantineOffersAsyncWithHttpInfo * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_0AsyncWithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_0'][0]) + public function getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - $request = $this->getCategoryContentParameters_0Request($category_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24917,42 +17494,75 @@ class DbsApi } /** - * Create request for operation 'getCategoryContentParameters_0' + * Create request for operation 'getBusinessQuarantineOffers' * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoryContentParameters_0Request($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_0'][0]) + public function getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - // verify the required parameter 'category_id' is set - if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $category_id when calling getCategoryContentParameters_0' + 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers' ); } - if ($category_id < 1) { - throw new \InvalidArgumentException('invalid value for "$category_id" when calling DbsApi.getCategoryContentParameters_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); } - $resourcePath = '/category/{categoryId}/parameters'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($category_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'categoryId' . '}', - ObjectSerializer::toPathValue($category_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -24965,7 +17575,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_quarantine_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + } else { + $httpBody = $get_quarantine_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -25021,46 +17638,38 @@ class DbsApi } /** - * Operation getChatHistory_0 + * Operation getBusinessSettings * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChatHistory_0($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_0'][0]) + public function getBusinessSettings($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - list($response) = $this->getChatHistory_0WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + list($response) = $this->getBusinessSettingsWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getChatHistory_0WithHttpInfo + * Operation getBusinessSettingsWithHttpInfo * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChatHistory_0WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_0'][0]) + public function getBusinessSettingsWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $request = $this->getChatHistory_0Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $request = $this->getBusinessSettingsRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -25087,196 +17696,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatHistoryResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25290,44 +17754,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatHistoryResponse', + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25335,7 +17776,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25343,7 +17784,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25351,7 +17792,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25359,7 +17800,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25367,7 +17808,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25375,30 +17816,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChatHistory_0Async + * Operation getBusinessSettingsAsync * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_0Async($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_0'][0]) + public function getBusinessSettingsAsync($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - return $this->getChatHistory_0AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) + return $this->getBusinessSettingsAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -25407,24 +17846,20 @@ class DbsApi } /** - * Operation getChatHistory_0AsyncWithHttpInfo + * Operation getBusinessSettingsAsyncWithHttpInfo * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_0AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_0'][0]) + public function getBusinessSettingsAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - $request = $this->getChatHistory_0Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; + $request = $this->getBusinessSettingsRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25463,85 +17898,35 @@ class DbsApi } /** - * Create request for operation 'getChatHistory_0' + * Create request for operation 'getBusinessSettings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChatHistory_0Request($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_0'][0]) + public function getBusinessSettingsRequest($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChatHistory_0' + 'Missing the required parameter $business_id when calling getBusinessSettings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getChatHistory_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getBusinessSettings, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling getChatHistory_0' - ); - } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.getChatHistory_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_chat_history_request' is set - if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chat_history_request when calling getChatHistory_0' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats/history'; + $resourcePath = '/v2/businesses/{businessId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -25561,14 +17946,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_chat_history_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); - } else { - $httpBody = $get_chat_history_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -25624,44 +18002,38 @@ class DbsApi } /** - * Operation getChats_0 + * Operation getCampaign * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChats_0($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_0'][0]) + public function getCampaign($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - list($response) = $this->getChats_0WithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); + list($response) = $this->getCampaignWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getChats_0WithHttpInfo + * Operation getCampaignWithHttpInfo * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChats_0WithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_0'][0]) + public function getCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $request = $this->getChats_0Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $request = $this->getCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -25688,196 +18060,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25891,44 +18118,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatsResponse', + '\OpenAPI\Client\Model\GetCampaignResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25936,7 +18140,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25944,7 +18148,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25952,7 +18156,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25960,7 +18164,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25968,7 +18172,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25976,29 +18180,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChats_0Async + * Operation getCampaignAsync * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_0Async($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_0'][0]) + public function getCampaignAsync($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - return $this->getChats_0AsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) + return $this->getCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -26007,23 +18210,20 @@ class DbsApi } /** - * Operation getChats_0AsyncWithHttpInfo + * Operation getCampaignAsyncWithHttpInfo * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_0AsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_0'][0]) + public function getCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - $request = $this->getChats_0Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; + $request = $this->getCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26062,72 +18262,42 @@ class DbsApi } /** - * Create request for operation 'getChats_0' + * Create request for operation 'getCampaign' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChats_0Request($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_0'][0]) + public function getCampaignRequest($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChats_0' + 'Missing the required parameter $campaign_id when calling getCampaign' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getChats_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaign, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chats_request' is set - if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chats_request when calling getChats_0' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats'; + $resourcePath = '/v2/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -26140,14 +18310,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_chats_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); - } else { - $httpBody = $get_chats_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -26195,7 +18358,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -26203,36 +18366,44 @@ class DbsApi } /** - * Operation getDeliveryServices_1 + * Operation getCampaignOffers * - * Справочник служб доставки + * Информация о товарах, которые размещены в заданном магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getDeliveryServices_1(string $contentType = self::contentTypes['getDeliveryServices_1'][0]) + public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - list($response) = $this->getDeliveryServices_1WithHttpInfo($contentType); + list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getDeliveryServices_1WithHttpInfo + * Operation getCampaignOffersWithHttpInfo * - * Справочник служб доставки + * Информация о товарах, которые размещены в заданном магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getDeliveryServices_1WithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices_1'][0]) + public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $request = $this->getDeliveryServices_1Request($contentType); + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -26259,196 +18430,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetDeliveryServicesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26462,44 +18488,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + '\OpenAPI\Client\Model\GetCampaignOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26507,7 +18510,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26515,7 +18518,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26523,7 +18526,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26531,7 +18534,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26539,7 +18542,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26547,25 +18550,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getDeliveryServices_1Async + * Operation getCampaignOffersAsync * - * Справочник служб доставки + * Информация о товарах, которые размещены в заданном магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryServices_1Async(string $contentType = self::contentTypes['getDeliveryServices_1'][0]) + public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - return $this->getDeliveryServices_1AsyncWithHttpInfo($contentType) + return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -26574,19 +18583,23 @@ class DbsApi } /** - * Operation getDeliveryServices_1AsyncWithHttpInfo + * Operation getCampaignOffersAsyncWithHttpInfo * - * Справочник служб доставки + * Информация о товарах, которые размещены в заданном магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryServices_1AsyncWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices_1'][0]) + public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - $request = $this->getDeliveryServices_1Request($contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26625,26 +18638,78 @@ class DbsApi } /** - * Create request for operation 'getDeliveryServices_1' + * Create request for operation 'getCampaignOffers' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeliveryServices_1Request(string $contentType = self::contentTypes['getDeliveryServices_1'][0]) + public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getCampaignOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_campaign_offers_request' is set + if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + - $resourcePath = '/delivery/services'; + $resourcePath = '/v2/campaigns/{campaignId}/offers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -26654,7 +18719,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_campaign_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + } else { + $httpBody = $get_campaign_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -26702,7 +18774,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -26710,50 +18782,44 @@ class DbsApi } /** - * Operation getFeedIndexLogs_0 + * Operation getCampaignQuarantineOffers * - * Отчет по индексации прайс-листа + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeedIndexLogs_0($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_0'][0]) + public function getCampaignQuarantineOffers($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - list($response) = $this->getFeedIndexLogs_0WithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + list($response) = $this->getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getFeedIndexLogs_0WithHttpInfo + * Operation getCampaignQuarantineOffersWithHttpInfo * - * Отчет по индексации прайс-листа + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedIndexLogs_0WithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_0'][0]) + public function getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $request = $this->getFeedIndexLogs_0Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -26780,196 +18846,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26983,44 +18904,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27028,7 +18926,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27036,7 +18934,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27044,7 +18942,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27052,7 +18950,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27060,7 +18958,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27068,32 +18966,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedIndexLogs_0Async + * Operation getCampaignQuarantineOffersAsync * - * Отчет по индексации прайс-листа + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_0Async($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_0'][0]) + public function getCampaignQuarantineOffersAsync($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - return $this->getFeedIndexLogs_0AsyncWithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType) + return $this->getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -27102,26 +18999,23 @@ class DbsApi } /** - * Operation getFeedIndexLogs_0AsyncWithHttpInfo + * Operation getCampaignQuarantineOffersAsyncWithHttpInfo * - * Отчет по индексации прайс-листа + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_0AsyncWithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_0'][0]) + public function getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - $request = $this->getFeedIndexLogs_0Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27160,46 +19054,44 @@ class DbsApi } /** - * Create request for operation 'getFeedIndexLogs_0' + * Create request for operation 'getCampaignQuarantineOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeedIndexLogs_0Request($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_0'][0]) + public function getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedIndexLogs_0' + 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getFeedIndexLogs_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeedIndexLogs_0' + 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + - - - - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/index-logs'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27208,26 +19100,8 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_from, - 'published_time_from', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_to, - 'published_time_to', // param base name + $page_token, + 'page_token', // param base name 'string', // openApiType '', // style false, // explode @@ -27235,9 +19109,9 @@ class DbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'FeedIndexLogsStatusType', // openApiType + $limit, + 'limit', // param base name + 'integer', // openApiType '', // style false, // explode false // required @@ -27252,14 +19126,6 @@ class DbsApi $resourcePath ); } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -27269,7 +19135,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_quarantine_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + } else { + $httpBody = $get_quarantine_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -27317,7 +19190,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -27325,42 +19198,38 @@ class DbsApi } /** - * Operation getFeed_0 + * Operation getCampaignSettings * - * Информация о прайс-листе + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeed_0($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_0'][0]) + public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - list($response) = $this->getFeed_0WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getFeed_0WithHttpInfo + * Operation getCampaignSettingsWithHttpInfo * - * Информация о прайс-листе + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeed_0WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_0'][0]) + public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $request = $this->getFeed_0Request($campaign_id, $feed_id, $contentType); + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27387,196 +19256,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -27590,44 +19314,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedResponse', + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27635,7 +19336,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27643,7 +19344,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27651,7 +19352,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27659,7 +19360,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27667,7 +19368,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27675,28 +19376,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeed_0Async + * Operation getCampaignSettingsAsync * - * Информация о прайс-листе + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_0Async($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_0'][0]) + public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - return $this->getFeed_0AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -27705,22 +19406,20 @@ class DbsApi } /** - * Operation getFeed_0AsyncWithHttpInfo + * Operation getCampaignSettingsAsyncWithHttpInfo * - * Информация о прайс-листе + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_0AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_0'][0]) + public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - $request = $this->getFeed_0Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27759,38 +19458,29 @@ class DbsApi } /** - * Create request for operation 'getFeed_0' + * Create request for operation 'getCampaignSettings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeed_0Request($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_0'][0]) + public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeed_0' + 'Missing the required parameter $campaign_id when calling getCampaignSettings' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getFeed_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getCampaignSettings, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeed_0' - ); - } - - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}'; + $resourcePath = '/v2/campaigns/{campaignId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27807,14 +19497,6 @@ class DbsApi $resourcePath ); } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -27880,46 +19562,40 @@ class DbsApi } /** - * Operation getFeedbackAndCommentUpdates_0 + * Operation getCampaigns * - * Новые и обновленные отзывы о магазине + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_0'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeedbackAndCommentUpdates_0($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_0'][0]) + public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - list($response) = $this->getFeedbackAndCommentUpdates_0WithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType); + list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); return $response; } /** - * Operation getFeedbackAndCommentUpdates_0WithHttpInfo + * Operation getCampaignsWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_0'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedbackAndCommentUpdates_0WithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_0'][0]) + public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $request = $this->getFeedbackAndCommentUpdates_0Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $request = $this->getCampaignsRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -27946,196 +19622,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedbackListResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -28149,44 +19680,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedbackListResponse', + '\OpenAPI\Client\Model\GetCampaignsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28194,7 +19702,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28202,7 +19710,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28210,7 +19718,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28218,7 +19726,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28226,7 +19734,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28234,30 +19742,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedbackAndCommentUpdates_0Async + * Operation getCampaignsAsync * - * Новые и обновленные отзывы о магазине + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_0'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedbackAndCommentUpdates_0Async($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_0'][0]) + public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - return $this->getFeedbackAndCommentUpdates_0AsyncWithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType) + return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -28266,24 +19773,21 @@ class DbsApi } /** - * Operation getFeedbackAndCommentUpdates_0AsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_0'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedbackAndCommentUpdates_0AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_0'][0]) + public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - $request = $this->getFeedbackAndCommentUpdates_0Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; + $request = $this->getCampaignsRequest($page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28322,36 +19826,25 @@ class DbsApi } /** - * Create request for operation 'getFeedbackAndCommentUpdates_0' + * Create request for operation 'getCampaigns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_0'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeedbackAndCommentUpdates_0Request($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_0'][0]) + public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedbackAndCommentUpdates_0' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getFeedbackAndCommentUpdates_0, must be bigger than or equal to 1.'); + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getCampaigns, must be smaller than or equal to 10000.'); } - - - $resourcePath = '/campaigns/{campaignId}/feedback/updates'; + $resourcePath = '/v2/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28360,17 +19853,8 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $page, + 'page', // param base name 'integer', // openApiType '', // style false, // explode @@ -28378,23 +19862,15 @@ class DbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'from_date', // param base name - 'string', // openApiType + $page_size, + 'pageSize', // param base name + 'integer', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -28460,40 +19936,40 @@ class DbsApi } /** - * Operation getFeeds_0 + * Operation getCategoriesMaxSaleQuantum * - * Список прайс-листов магазина + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getFeeds_0($campaign_id, string $contentType = self::contentTypes['getFeeds_0'][0]) + public function getCategoriesMaxSaleQuantum($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - list($response) = $this->getFeeds_0WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, $contentType); return $response; } /** - * Operation getFeeds_0WithHttpInfo + * Operation getCategoriesMaxSaleQuantumWithHttpInfo * - * Список прайс-листов магазина + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getFeeds_0WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_0'][0]) + public function getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $request = $this->getFeeds_0Request($campaign_id, $contentType); + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -28520,196 +19996,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -28723,44 +20054,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedsResponse', + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28768,7 +20076,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28776,7 +20084,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28784,7 +20092,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28792,7 +20100,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28800,7 +20108,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28808,27 +20116,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeeds_0Async + * Operation getCategoriesMaxSaleQuantumAsync * - * Список прайс-листов магазина + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getFeeds_0Async($campaign_id, string $contentType = self::contentTypes['getFeeds_0'][0]) + public function getCategoriesMaxSaleQuantumAsync($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - return $this->getFeeds_0AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) ->then( function ($response) { return $response[0]; @@ -28837,21 +20147,21 @@ class DbsApi } /** - * Operation getFeeds_0AsyncWithHttpInfo + * Operation getCategoriesMaxSaleQuantumAsyncWithHttpInfo * - * Список прайс-листов магазина + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getFeeds_0AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_0'][0]) + public function getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - $request = $this->getFeeds_0Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28890,30 +20200,27 @@ class DbsApi } /** - * Create request for operation 'getFeeds_0' + * Create request for operation 'getCategoriesMaxSaleQuantum' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getFeeds_0Request($campaign_id, string $contentType = self::contentTypes['getFeeds_0'][0]) + public function getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'get_categories_max_sale_quantum_request' is set + if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeeds_0' + 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getFeeds_0, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/feeds'; + + $resourcePath = '/v2/categories/max-sale-quantum'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28922,14 +20229,6 @@ class DbsApi - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -28939,7 +20238,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_categories_max_sale_quantum_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + } else { + $httpBody = $get_categories_max_sale_quantum_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -28987,7 +20293,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -28995,44 +20301,38 @@ class DbsApi } /** - * Operation getGoodsFeedbackComments_2 + * Operation getCategoriesTree * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbackComments_2($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_2'][0]) + public function getCategoriesTree($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - list($response) = $this->getGoodsFeedbackComments_2WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + list($response) = $this->getCategoriesTreeWithHttpInfo($get_categories_request, $contentType); return $response; } /** - * Operation getGoodsFeedbackComments_2WithHttpInfo + * Operation getCategoriesTreeWithHttpInfo * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbackComments_2WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_2'][0]) + public function getCategoriesTreeWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $request = $this->getGoodsFeedbackComments_2Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -29059,196 +20359,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29262,44 +20417,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + '\OpenAPI\Client\Model\GetCategoriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29307,7 +20439,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29315,7 +20447,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29323,7 +20455,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29331,7 +20463,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29339,7 +20471,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29347,29 +20479,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbackComments_2Async + * Operation getCategoriesTreeAsync * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_2Async($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_2'][0]) + public function getCategoriesTreeAsync($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - return $this->getGoodsFeedbackComments_2AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) + return $this->getCategoriesTreeAsyncWithHttpInfo($get_categories_request, $contentType) ->then( function ($response) { return $response[0]; @@ -29378,23 +20509,20 @@ class DbsApi } /** - * Operation getGoodsFeedbackComments_2AsyncWithHttpInfo + * Operation getCategoriesTreeAsyncWithHttpInfo * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_2AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_2'][0]) + public function getCategoriesTreeAsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - $request = $this->getGoodsFeedbackComments_2Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29433,75 +20561,28 @@ class DbsApi } /** - * Create request for operation 'getGoodsFeedbackComments_2' + * Create request for operation 'getCategoriesTree' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbackComments_2Request($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_2'][0]) + public function getCategoriesTreeRequest($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbackComments_2' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getGoodsFeedbackComments_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_goods_feedback_comments_request' is set - if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments_2' - ); - } - - - $resourcePath = '/businesses/{businessId}/goods-feedback/comments'; + $resourcePath = '/v2/categories/tree'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -29511,12 +20592,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_goods_feedback_comments_request)) { + if (isset($get_categories_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); } else { - $httpBody = $get_goods_feedback_comments_request; + $httpBody = $get_categories_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -29574,44 +20655,40 @@ class DbsApi } /** - * Operation getGoodsFeedbacks_2 + * Operation getCategoryContentParameters * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_2'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbacks_2($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_2'][0]) + public function getCategoryContentParameters($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - list($response) = $this->getGoodsFeedbacks_2WithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $business_id, $contentType); return $response; } /** - * Operation getGoodsFeedbacks_2WithHttpInfo + * Operation getCategoryContentParametersWithHttpInfo * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_2'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbacks_2WithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_2'][0]) + public function getCategoryContentParametersWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $request = $this->getGoodsFeedbacks_2Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -29638,196 +20715,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29841,44 +20773,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29886,7 +20795,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29894,7 +20803,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29902,7 +20811,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29910,7 +20819,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29918,7 +20827,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29926,29 +20835,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbacks_2Async + * Operation getCategoryContentParametersAsync * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_2'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_2Async($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_2'][0]) + public function getCategoryContentParametersAsync($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - return $this->getGoodsFeedbacks_2AsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) + return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -29957,23 +20866,21 @@ class DbsApi } /** - * Operation getGoodsFeedbacks_2AsyncWithHttpInfo + * Operation getCategoryContentParametersAsyncWithHttpInfo * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_2'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_2AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_2'][0]) + public function getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - $request = $this->getGoodsFeedbacks_2Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30012,35 +20919,34 @@ class DbsApi } /** - * Create request for operation 'getGoodsFeedbacks_2' + * Create request for operation 'getCategoryContentParameters' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_2'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbacks_2Request($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_2'][0]) + public function getCategoryContentParametersRequest($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'category_id' is set + if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbacks_2' + 'Missing the required parameter $category_id when calling getCategoryContentParameters' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getGoodsFeedbacks_2, must be bigger than or equal to 1.'); + if ($category_id <= 0) { + throw new \InvalidArgumentException('invalid value for "$category_id" when calling DbsApi.getCategoryContentParameters, must be bigger than 0.'); + } + + if ($business_id !== null && $business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getCategoryContentParameters, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/businesses/{businessId}/goods-feedback'; + $resourcePath = '/v2/category/{categoryId}/parameters'; $formParams = []; $queryParams = []; $headerParams = []; @@ -30049,17 +20955,8 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $business_id, + 'businessId', // param base name 'integer', // openApiType '', // style false, // explode @@ -30068,10 +20965,10 @@ class DbsApi // path params - if ($business_id !== null) { + if ($category_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'categoryId' . '}', + ObjectSerializer::toPathValue($category_id), $resourcePath ); } @@ -30084,14 +20981,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_goods_feedback_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); - } else { - $httpBody = $get_goods_feedback_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -30147,40 +21037,40 @@ class DbsApi } /** - * Operation getGoodsStats_3 + * Operation getChat * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsStats_3($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_3'][0]) + public function getChat($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - list($response) = $this->getGoodsStats_3WithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); + list($response) = $this->getChatWithHttpInfo($business_id, $chat_id, $contentType); return $response; } /** - * Operation getGoodsStats_3WithHttpInfo + * Operation getChatWithHttpInfo * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsStats_3WithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_3'][0]) + public function getChatWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $request = $this->getGoodsStats_3Request($campaign_id, $get_goods_stats_request, $contentType); + $request = $this->getChatRequest($business_id, $chat_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -30207,196 +21097,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30410,44 +21155,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsStatsResponse', + '\OpenAPI\Client\Model\GetChatResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30455,7 +21177,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30463,7 +21185,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30471,7 +21193,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30479,7 +21201,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30487,7 +21209,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30495,27 +21217,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsStats_3Async + * Operation getChatAsync * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_3Async($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_3'][0]) + public function getChatAsync($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - return $this->getGoodsStats_3AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) + return $this->getChatAsyncWithHttpInfo($business_id, $chat_id, $contentType) ->then( function ($response) { return $response[0]; @@ -30524,21 +21248,21 @@ class DbsApi } /** - * Operation getGoodsStats_3AsyncWithHttpInfo + * Operation getChatAsyncWithHttpInfo * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_3AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_3'][0]) + public function getChatAsyncWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - $request = $this->getGoodsStats_3Request($campaign_id, $get_goods_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatResponse'; + $request = $this->getChatRequest($business_id, $chat_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30577,50 +21301,62 @@ class DbsApi } /** - * Create request for operation 'getGoodsStats_3' + * Create request for operation 'getChat' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsStats_3Request($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_3'][0]) + public function getChatRequest($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getGoodsStats_3' + 'Missing the required parameter $business_id when calling getChat' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getGoodsStats_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getChat, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_goods_stats_request' is set - if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats_3' + 'Missing the required parameter $chat_id when calling getChat' ); } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.getChat, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/stats/skus'; + $resourcePath = '/v2/businesses/{businessId}/chat'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -30633,14 +21369,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_goods_stats_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); - } else { - $httpBody = $get_goods_stats_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -30688,7 +21417,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30696,50 +21425,46 @@ class DbsApi } /** - * Operation getHiddenOffers_2 + * Operation getChatHistory * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getHiddenOffers_2($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_2'][0]) + public function getChatHistory($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - list($response) = $this->getHiddenOffers_2WithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + list($response) = $this->getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getHiddenOffers_2WithHttpInfo + * Operation getChatHistoryWithHttpInfo * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getHiddenOffers_2WithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_2'][0]) + public function getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $request = $this->getHiddenOffers_2Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -30766,169 +21491,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetHiddenOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30942,44 +21549,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetHiddenOffersResponse', + '\OpenAPI\Client\Model\GetChatHistoryResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30987,7 +21571,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30995,7 +21579,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31003,7 +21587,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31011,7 +21603,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31019,32 +21611,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getHiddenOffers_2Async + * Operation getChatHistoryAsync * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_2Async($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_2'][0]) + public function getChatHistoryAsync($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - return $this->getHiddenOffers_2AsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType) + return $this->getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -31053,26 +21645,24 @@ class DbsApi } /** - * Operation getHiddenOffers_2AsyncWithHttpInfo + * Operation getChatHistoryAsyncWithHttpInfo * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_2AsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_2'][0]) + public function getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - $request = $this->getHiddenOffers_2Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31111,44 +21701,55 @@ class DbsApi } /** - * Create request for operation 'getHiddenOffers_2' + * Create request for operation 'getChatHistory' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getHiddenOffers_2Request($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_2'][0]) + public function getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getHiddenOffers_2' + 'Missing the required parameter $business_id when calling getChatHistory' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getHiddenOffers_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getChatHistory, must be bigger than or equal to 1.'); } + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatHistory' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.getChatHistory, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_chat_history_request' is set + if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chat_history_request when calling getChatHistory' + ); + } - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getHiddenOffers_2, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getChatHistory, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/businesses/{businessId}/chats/history'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31157,12 +21758,12 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType + $chat_id, + 'chatId', // param base name + 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( @@ -31182,40 +21783,13 @@ class DbsApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -31228,7 +21802,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_chat_history_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); + } else { + $httpBody = $get_chat_history_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -31276,7 +21857,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31284,48 +21865,42 @@ class DbsApi } /** - * Operation getModelOffers_0 + * Operation getChatMessage * - * Список предложений для одной модели + * Получение сообщения в чате * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param int $count Количество предложений на странице ответа. (optional, default to 10) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetModelsOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getModelOffers_0($model_id, $region_id, $currency = null, $order_by_price = null, $count = 10, $page = 1, string $contentType = self::contentTypes['getModelOffers_0'][0]) + public function getChatMessage($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - list($response) = $this->getModelOffers_0WithHttpInfo($model_id, $region_id, $currency, $order_by_price, $count, $page, $contentType); + list($response) = $this->getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, $contentType); return $response; } /** - * Operation getModelOffers_0WithHttpInfo + * Operation getChatMessageWithHttpInfo * - * Список предложений для одной модели + * Получение сообщения в чате * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param int $count Количество предложений на странице ответа. (optional, default to 10) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetModelsOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getModelOffers_0WithHttpInfo($model_id, $region_id, $currency = null, $order_by_price = null, $count = 10, $page = 1, string $contentType = self::contentTypes['getModelOffers_0'][0]) + public function getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $request = $this->getModelOffers_0Request($model_id, $region_id, $currency, $order_by_price, $count, $page, $contentType); + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -31352,196 +21927,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetModelsOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetModelsOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetModelsOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -31555,44 +21985,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetModelsOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetModelsOffersResponse', + '\OpenAPI\Client\Model\GetChatMessageResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31600,7 +22007,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31608,7 +22015,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31616,7 +22023,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31624,7 +22031,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31632,7 +22039,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31640,31 +22047,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getModelOffers_0Async + * Operation getChatMessageAsync * - * Список предложений для одной модели + * Получение сообщения в чате * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param int $count Количество предложений на странице ответа. (optional, default to 10) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModelOffers_0Async($model_id, $region_id, $currency = null, $order_by_price = null, $count = 10, $page = 1, string $contentType = self::contentTypes['getModelOffers_0'][0]) + public function getChatMessageAsync($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - return $this->getModelOffers_0AsyncWithHttpInfo($model_id, $region_id, $currency, $order_by_price, $count, $page, $contentType) + return $this->getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, $contentType) ->then( function ($response) { return $response[0]; @@ -31673,25 +22079,22 @@ class DbsApi } /** - * Operation getModelOffers_0AsyncWithHttpInfo + * Operation getChatMessageAsyncWithHttpInfo * - * Список предложений для одной модели + * Получение сообщения в чате * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param int $count Количество предложений на странице ответа. (optional, default to 10) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModelOffers_0AsyncWithHttpInfo($model_id, $region_id, $currency = null, $order_by_price = null, $count = 10, $page = 1, string $contentType = self::contentTypes['getModelOffers_0'][0]) + public function getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $returnType = '\OpenAPI\Client\Model\GetModelsOffersResponse'; - $request = $this->getModelOffers_0Request($model_id, $region_id, $currency, $order_by_price, $count, $page, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatMessageResponse'; + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31730,48 +22133,51 @@ class DbsApi } /** - * Create request for operation 'getModelOffers_0' + * Create request for operation 'getChatMessage' * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param int $count Количество предложений на странице ответа. (optional, default to 10) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getModelOffers_0Request($model_id, $region_id, $currency = null, $order_by_price = null, $count = 10, $page = 1, string $contentType = self::contentTypes['getModelOffers_0'][0]) + public function getChatMessageRequest($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - // verify the required parameter 'model_id' is set - if ($model_id === null || (is_array($model_id) && count($model_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $model_id when calling getModelOffers_0' + 'Missing the required parameter $business_id when calling getChatMessage' ); } - if ($model_id <= 0) { - throw new \InvalidArgumentException('invalid value for "$model_id" when calling DbsApi.getModelOffers_0, must be bigger than 0.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getChatMessage, must be bigger than or equal to 1.'); } - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling getModelOffers_0' + 'Missing the required parameter $chat_id when calling getChatMessage' ); } - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getModelOffers_0, must be smaller than or equal to 10000.'); + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'message_id' is set + if ($message_id === null || (is_array($message_id) && count($message_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $message_id when calling getChatMessage' + ); + } + if ($message_id < 1) { + throw new \InvalidArgumentException('invalid value for "$message_id" when calling DbsApi.getChatMessage, must be bigger than or equal to 1.'); } - $resourcePath = '/models/{modelId}/offers'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31780,8 +22186,8 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id, - 'regionId', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode @@ -31789,47 +22195,20 @@ class DbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_by_price, - 'orderByPrice', // param base name - 'SortOrderType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $count, - 'count', // param base name + $message_id, + 'messageId', // param base name 'integer', // openApiType '', // style false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required + true // required ) ?? []); // path params - if ($model_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'modelId' . '}', - ObjectSerializer::toPathValue($model_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -31898,42 +22277,44 @@ class DbsApi } /** - * Operation getModel_0 + * Operation getChats * - * Информация об одной модели + * Получение доступных чатов * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModel_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetModelsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getModel_0($model_id, $region_id, $currency = null, string $contentType = self::contentTypes['getModel_0'][0]) + public function getChats($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - list($response) = $this->getModel_0WithHttpInfo($model_id, $region_id, $currency, $contentType); + list($response) = $this->getChatsWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getModel_0WithHttpInfo + * Operation getChatsWithHttpInfo * - * Информация об одной модели + * Получение доступных чатов * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModel_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetModelsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getModel_0WithHttpInfo($model_id, $region_id, $currency = null, string $contentType = self::contentTypes['getModel_0'][0]) + public function getChatsWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $request = $this->getModel_0Request($model_id, $region_id, $currency, $contentType); + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -31960,196 +22341,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetModelsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetModelsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetModelsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32163,44 +22399,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetModelsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetModelsResponse', + '\OpenAPI\Client\Model\GetChatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32208,7 +22421,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32216,7 +22429,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32224,7 +22437,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32232,7 +22445,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32240,7 +22453,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32248,28 +22461,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getModel_0Async + * Operation getChatsAsync * - * Информация об одной модели + * Получение доступных чатов * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModel_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModel_0Async($model_id, $region_id, $currency = null, string $contentType = self::contentTypes['getModel_0'][0]) + public function getChatsAsync($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - return $this->getModel_0AsyncWithHttpInfo($model_id, $region_id, $currency, $contentType) + return $this->getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -32278,22 +22494,23 @@ class DbsApi } /** - * Operation getModel_0AsyncWithHttpInfo + * Operation getChatsAsyncWithHttpInfo * - * Информация об одной модели + * Получение доступных чатов * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModel_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModel_0AsyncWithHttpInfo($model_id, $region_id, $currency = null, string $contentType = self::contentTypes['getModel_0'][0]) + public function getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetModelsResponse'; - $request = $this->getModel_0Request($model_id, $region_id, $currency, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32332,39 +22549,44 @@ class DbsApi } /** - * Create request for operation 'getModel_0' + * Create request for operation 'getChats' * - * @param int $model_id Идентификатор модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModel_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getModel_0Request($model_id, $region_id, $currency = null, string $contentType = self::contentTypes['getModel_0'][0]) + public function getChatsRequest($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - // verify the required parameter 'model_id' is set - if ($model_id === null || (is_array($model_id) && count($model_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $model_id when calling getModel_0' + 'Missing the required parameter $business_id when calling getChats' ); } - if ($model_id <= 0) { - throw new \InvalidArgumentException('invalid value for "$model_id" when calling DbsApi.getModel_0, must be bigger than 0.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getChats, must be bigger than or equal to 1.'); } - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'get_chats_request' is set + if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling getModel_0' + 'Missing the required parameter $get_chats_request when calling getChats' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getChats, must be bigger than or equal to 1.'); + } + - $resourcePath = '/models/{modelId}'; + $resourcePath = '/v2/businesses/{businessId}/chats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32373,18 +22595,18 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id, - 'regionId', // param base name - 'integer', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode - true // required + false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType + $limit, + 'limit', // param base name + 'integer', // openApiType '', // style false, // explode false // required @@ -32392,10 +22614,10 @@ class DbsApi // path params - if ($model_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'modelId' . '}', - ObjectSerializer::toPathValue($model_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -32408,7 +22630,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_chats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); + } else { + $httpBody = $get_chats_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -32456,7 +22685,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -32464,44 +22693,44 @@ class DbsApi } /** - * Operation getModelsOffers_0 + * Operation getDefaultPrices * - * Список предложений для нескольких моделей + * Просмотр цен на указанные товары во всех магазинах * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelsOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetModelsOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getModelsOffers_0($region_id, $get_models_request, $currency = null, $order_by_price = null, string $contentType = self::contentTypes['getModelsOffers_0'][0]) + public function getDefaultPrices($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - list($response) = $this->getModelsOffers_0WithHttpInfo($region_id, $get_models_request, $currency, $order_by_price, $contentType); + list($response) = $this->getDefaultPricesWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $response; } /** - * Operation getModelsOffers_0WithHttpInfo + * Operation getDefaultPricesWithHttpInfo * - * Список предложений для нескольких моделей + * Просмотр цен на указанные товары во всех магазинах * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelsOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetModelsOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getModelsOffers_0WithHttpInfo($region_id, $get_models_request, $currency = null, $order_by_price = null, string $contentType = self::contentTypes['getModelsOffers_0'][0]) + public function getDefaultPricesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $request = $this->getModelsOffers_0Request($region_id, $get_models_request, $currency, $order_by_price, $contentType); + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -32528,196 +22757,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetModelsOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetModelsOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetModelsOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32731,44 +22815,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetModelsOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetModelsOffersResponse', + '\OpenAPI\Client\Model\GetDefaultPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32776,7 +22837,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32784,7 +22845,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32792,7 +22853,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32800,7 +22861,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32808,7 +22869,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32816,29 +22877,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getModelsOffers_0Async + * Operation getDefaultPricesAsync * - * Список предложений для нескольких моделей + * Просмотр цен на указанные товары во всех магазинах * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelsOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModelsOffers_0Async($region_id, $get_models_request, $currency = null, $order_by_price = null, string $contentType = self::contentTypes['getModelsOffers_0'][0]) + public function getDefaultPricesAsync($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - return $this->getModelsOffers_0AsyncWithHttpInfo($region_id, $get_models_request, $currency, $order_by_price, $contentType) + return $this->getDefaultPricesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -32847,23 +22910,23 @@ class DbsApi } /** - * Operation getModelsOffers_0AsyncWithHttpInfo + * Operation getDefaultPricesAsyncWithHttpInfo * - * Список предложений для нескольких моделей + * Просмотр цен на указанные товары во всех магазинах * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelsOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModelsOffers_0AsyncWithHttpInfo($region_id, $get_models_request, $currency = null, $order_by_price = null, string $contentType = self::contentTypes['getModelsOffers_0'][0]) + public function getDefaultPricesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetModelsOffersResponse'; - $request = $this->getModelsOffers_0Request($region_id, $get_models_request, $currency, $order_by_price, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDefaultPricesResponse'; + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32902,38 +22965,38 @@ class DbsApi } /** - * Create request for operation 'getModelsOffers_0' + * Create request for operation 'getDefaultPrices' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param \OpenAPI\Client\Model\SortOrderType $order_by_price Направление сортировки по цене. Возможные значения: * `ASC` — сортировка по возрастанию. * `DESC` — сортировка по убыванию. Значение по умолчанию: предложения выводятся в произвольном порядке. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModelsOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getModelsOffers_0Request($region_id, $get_models_request, $currency = null, $order_by_price = null, string $contentType = self::contentTypes['getModelsOffers_0'][0]) + public function getDefaultPricesRequest($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling getModelsOffers_0' + 'Missing the required parameter $business_id when calling getDefaultPrices' ); } - - // verify the required parameter 'get_models_request' is set - if ($get_models_request === null || (is_array($get_models_request) && count($get_models_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_models_request when calling getModelsOffers_0' - ); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getDefaultPrices, must be bigger than or equal to 1.'); } + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/models/offers'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32942,33 +23005,32 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id, - 'regionId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_by_price, - 'orderByPrice', // param base name - 'SortOrderType', // openApiType + $limit, + 'limit', // param base name + 'integer', // openApiType '', // style false, // explode false // required ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -32978,12 +23040,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_models_request)) { + if (isset($get_default_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_models_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_default_prices_request)); } else { - $httpBody = $get_models_request; + $httpBody = $get_default_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -33041,42 +23103,36 @@ class DbsApi } /** - * Operation getModels_0 + * Operation getDeliveryServices * - * Информация о нескольких моделях + * Справочник служб доставки * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModels_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetModelsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getModels_0($region_id, $get_models_request, $currency = null, string $contentType = self::contentTypes['getModels_0'][0]) + public function getDeliveryServices(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - list($response) = $this->getModels_0WithHttpInfo($region_id, $get_models_request, $currency, $contentType); + list($response) = $this->getDeliveryServicesWithHttpInfo($contentType); return $response; } /** - * Operation getModels_0WithHttpInfo + * Operation getDeliveryServicesWithHttpInfo * - * Информация о нескольких моделях + * Справочник служб доставки * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModels_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetModelsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getModels_0WithHttpInfo($region_id, $get_models_request, $currency = null, string $contentType = self::contentTypes['getModels_0'][0]) + public function getDeliveryServicesWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - $request = $this->getModels_0Request($region_id, $get_models_request, $currency, $contentType); + $request = $this->getDeliveryServicesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -33103,196 +23159,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetModelsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetModelsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetModelsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33306,44 +23217,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetModelsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetModelsResponse', + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33351,7 +23239,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33359,7 +23247,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33367,7 +23255,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33375,7 +23263,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33383,7 +23271,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33391,28 +23279,27 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getModels_0Async + * Operation getDeliveryServicesAsync * - * Информация о нескольких моделях + * Справочник служб доставки * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModels_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModels_0Async($region_id, $get_models_request, $currency = null, string $contentType = self::contentTypes['getModels_0'][0]) + public function getDeliveryServicesAsync(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - return $this->getModels_0AsyncWithHttpInfo($region_id, $get_models_request, $currency, $contentType) + return $this->getDeliveryServicesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -33421,22 +23308,19 @@ class DbsApi } /** - * Operation getModels_0AsyncWithHttpInfo + * Operation getDeliveryServicesAsyncWithHttpInfo * - * Информация о нескольких моделях + * Справочник служб доставки * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModels_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getModels_0AsyncWithHttpInfo($region_id, $get_models_request, $currency = null, string $contentType = self::contentTypes['getModels_0'][0]) + public function getDeliveryServicesAsyncWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetModelsResponse'; - $request = $this->getModels_0Request($region_id, $get_models_request, $currency, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; + $request = $this->getDeliveryServicesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33475,60 +23359,24 @@ class DbsApi } /** - * Create request for operation 'getModels_0' + * Create request for operation 'getDeliveryServices' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\GetModelsRequest $get_models_request (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getModels_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getModels_0Request($region_id, $get_models_request, $currency = null, string $contentType = self::contentTypes['getModels_0'][0]) + public function getDeliveryServicesRequest(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling getModels_0' - ); - } - - // verify the required parameter 'get_models_request' is set - if ($get_models_request === null || (is_array($get_models_request) && count($get_models_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_models_request when calling getModels_0' - ); - } - - - $resourcePath = '/models'; + $resourcePath = '/v2/delivery/services'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id, - 'regionId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -33540,14 +23388,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_models_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_models_request)); - } else { - $httpBody = $get_models_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -33595,7 +23436,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -33603,44 +23444,44 @@ class DbsApi } /** - * Operation getOfferCardsContentStatus_0 + * Operation getGoodsFeedbackComments * - * Получение информации о заполненности карточек магазина + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferCardsContentStatus_0($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_0'][0]) + public function getGoodsFeedbackComments($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - list($response) = $this->getOfferCardsContentStatus_0WithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + list($response) = $this->getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferCardsContentStatus_0WithHttpInfo + * Operation getGoodsFeedbackCommentsWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferCardsContentStatus_0WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_0'][0]) + public function getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $request = $this->getOfferCardsContentStatus_0Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -33667,196 +23508,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33870,44 +23566,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33915,7 +23588,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33923,7 +23596,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33931,7 +23604,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33939,7 +23612,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33947,7 +23620,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33955,29 +23628,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferCardsContentStatus_0Async + * Operation getGoodsFeedbackCommentsAsync * - * Получение информации о заполненности карточек магазина + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_0Async($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_0'][0]) + public function getGoodsFeedbackCommentsAsync($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - return $this->getOfferCardsContentStatus_0AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) + return $this->getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -33986,23 +23661,23 @@ class DbsApi } /** - * Operation getOfferCardsContentStatus_0AsyncWithHttpInfo + * Operation getGoodsFeedbackCommentsAsyncWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_0AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_0'][0]) + public function getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - $request = $this->getOfferCardsContentStatus_0Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34041,35 +23716,44 @@ class DbsApi } /** - * Create request for operation 'getOfferCardsContentStatus_0' + * Create request for operation 'getGoodsFeedbackComments' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferCardsContentStatus_0Request($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_0'][0]) + public function getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferCardsContentStatus_0' + 'Missing the required parameter $business_id when calling getGoodsFeedbackComments' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getOfferCardsContentStatus_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_goods_feedback_comments_request' is set + if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offer-cards'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34113,12 +23797,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_offer_cards_content_status_request)) { + if (isset($get_goods_feedback_comments_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); } else { - $httpBody = $get_offer_cards_content_status_request; + $httpBody = $get_goods_feedback_comments_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -34176,58 +23860,44 @@ class DbsApi } /** - * Operation getOfferMappingEntries_3 + * Operation getGoodsFeedbacks * - * Список товаров в каталоге + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappingEntries_3($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_3'][0]) + public function getGoodsFeedbacks($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - list($response) = $this->getOfferMappingEntries_3WithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + list($response) = $this->getGoodsFeedbacksWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $response; } /** - * Operation getOfferMappingEntries_3WithHttpInfo + * Operation getGoodsFeedbacksWithHttpInfo * - * Список товаров в каталоге + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappingEntries_3WithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_3'][0]) + public function getGoodsFeedbacksWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $request = $this->getOfferMappingEntries_3Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -34254,196 +23924,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -34457,44 +23982,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34502,7 +24004,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34510,7 +24012,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34518,7 +24020,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34526,7 +24028,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34534,7 +24036,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34542,36 +24044,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappingEntries_3Async + * Operation getGoodsFeedbacksAsync * - * Список товаров в каталоге + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_3Async($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_3'][0]) + public function getGoodsFeedbacksAsync($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - return $this->getOfferMappingEntries_3AsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) + return $this->getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) ->then( function ($response) { return $response[0]; @@ -34580,30 +24077,23 @@ class DbsApi } /** - * Operation getOfferMappingEntries_3AsyncWithHttpInfo + * Operation getGoodsFeedbacksAsyncWithHttpInfo * - * Список товаров в каталоге + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_3AsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_3'][0]) + public function getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - $request = $this->getOfferMappingEntries_3Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34642,117 +24132,44 @@ class DbsApi } /** - * Create request for operation 'getOfferMappingEntries_3' + * Create request for operation 'getGoodsFeedbacks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOfferMappingEntries_3Request($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_3'][0]) + public function getGoodsFeedbacksRequest($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOfferMappingEntries_3' + 'Missing the required parameter $business_id when calling getGoodsFeedbacks' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOfferMappingEntries_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); + } + - - - - - - - - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_sku, - 'shop_sku', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $mapping_kind, - 'mapping_kind', // param base name - 'OfferMappingKindType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $availability, - 'availability', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $category_id, - 'category_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $vendor, - 'vendor', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, @@ -34774,10 +24191,10 @@ class DbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -34790,7 +24207,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); + } else { + $httpBody = $get_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -34838,7 +24262,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -34846,44 +24270,44 @@ class DbsApi } /** - * Operation getOfferMappings_0 + * Operation getGoodsQuestionAnswers * - * Информация о товарах в каталоге + * Получение ответов на вопрос * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappings_0($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_0'][0]) + public function getGoodsQuestionAnswers($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - list($response) = $this->getOfferMappings_0WithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + list($response) = $this->getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferMappings_0WithHttpInfo + * Operation getGoodsQuestionAnswersWithHttpInfo * - * Информация о товарах в каталоге + * Получение ответов на вопрос * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappings_0WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_0'][0]) + public function getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $request = $this->getOfferMappings_0Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -34910,196 +24334,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35113,44 +24392,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingsResponse', + '\OpenAPI\Client\Model\GetAnswersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35158,7 +24414,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35166,7 +24422,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35174,7 +24430,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35182,7 +24438,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35190,7 +24446,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35198,29 +24454,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappings_0Async + * Operation getGoodsQuestionAnswersAsync * - * Информация о товарах в каталоге + * Получение ответов на вопрос * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_0Async($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_0'][0]) + public function getGoodsQuestionAnswersAsync($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - return $this->getOfferMappings_0AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType) + return $this->getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -35229,23 +24487,23 @@ class DbsApi } /** - * Operation getOfferMappings_0AsyncWithHttpInfo + * Operation getGoodsQuestionAnswersAsyncWithHttpInfo * - * Информация о товарах в каталоге + * Получение ответов на вопрос * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_0AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_0'][0]) + public function getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - $request = $this->getOfferMappings_0Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetAnswersResponse'; + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35284,35 +24542,44 @@ class DbsApi } /** - * Create request for operation 'getOfferMappings_0' + * Create request for operation 'getGoodsQuestionAnswers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferMappings_0Request($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_0'][0]) + public function getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferMappings_0' + 'Missing the required parameter $business_id when calling getGoodsQuestionAnswers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getOfferMappings_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_answers_request' is set + if ($get_answers_request === null || (is_array($get_answers_request) && count($get_answers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_answers_request when calling getGoodsQuestionAnswers' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offer-mappings'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions/answers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35356,12 +24623,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_offer_mappings_request)) { + if (isset($get_answers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_answers_request)); } else { - $httpBody = $get_offer_mappings_request; + $httpBody = $get_answers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -35419,44 +24686,44 @@ class DbsApi } /** - * Operation getOfferRecommendations_0 + * Operation getGoodsQuestions * - * Рекомендации Маркета, касающиеся цен + * Получение вопросов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferRecommendations_0($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_0'][0]) + public function getGoodsQuestions($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - list($response) = $this->getOfferRecommendations_0WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + list($response) = $this->getGoodsQuestionsWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType); return $response; } /** - * Operation getOfferRecommendations_0WithHttpInfo + * Operation getGoodsQuestionsWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Получение вопросов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferRecommendations_0WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_0'][0]) + public function getGoodsQuestionsWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $request = $this->getOfferRecommendations_0Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -35483,196 +24750,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35686,44 +24808,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + '\OpenAPI\Client\Model\GetQuestionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35731,7 +24830,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35739,7 +24838,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35747,7 +24846,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35755,7 +24854,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35763,7 +24862,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35771,29 +24870,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferRecommendations_0Async + * Operation getGoodsQuestionsAsync * - * Рекомендации Маркета, касающиеся цен + * Получение вопросов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_0Async($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_0'][0]) + public function getGoodsQuestionsAsync($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - return $this->getOfferRecommendations_0AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) + return $this->getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType) ->then( function ($response) { return $response[0]; @@ -35802,23 +24903,23 @@ class DbsApi } /** - * Operation getOfferRecommendations_0AsyncWithHttpInfo + * Operation getGoodsQuestionsAsyncWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Получение вопросов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_0AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_0'][0]) + public function getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - $request = $this->getOfferRecommendations_0Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuestionsResponse'; + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35857,41 +24958,38 @@ class DbsApi } /** - * Create request for operation 'getOfferRecommendations_0' + * Create request for operation 'getGoodsQuestions' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferRecommendations_0Request($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_0'][0]) + public function getGoodsQuestionsRequest($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferRecommendations_0' + 'Missing the required parameter $business_id when calling getGoodsQuestions' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getOfferRecommendations_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getGoodsQuestions, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_offer_recommendations_request' is set - if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations_0' - ); - } - + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getGoodsQuestions, must be bigger than or equal to 1.'); + } + - $resourcePath = '/businesses/{businessId}/offers/recommendations'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35935,12 +25033,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_offer_recommendations_request)) { + if (isset($get_questions_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_questions_request)); } else { - $httpBody = $get_offer_recommendations_request; + $httpBody = $get_questions_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -35998,54 +25096,40 @@ class DbsApi } /** - * Operation getOffers_0 + * Operation getGoodsStats * - * Предложения магазина + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOffers_0($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_0'][0]) + public function getGoodsStats($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - list($response) = $this->getOffers_0WithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + list($response) = $this->getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); return $response; } /** - * Operation getOffers_0WithHttpInfo + * Operation getGoodsStatsWithHttpInfo * - * Предложения магазина + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOffers_0WithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_0'][0]) + public function getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $request = $this->getOffers_0Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -36072,196 +25156,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36275,44 +25214,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOffersResponse', + '\OpenAPI\Client\Model\GetGoodsStatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36320,7 +25236,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36328,7 +25244,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36336,7 +25252,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36344,7 +25260,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36352,7 +25268,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36360,34 +25276,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOffers_0Async + * Operation getGoodsStatsAsync * - * Предложения магазина + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_0Async($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_0'][0]) + public function getGoodsStatsAsync($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - return $this->getOffers_0AsyncWithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType) + return $this->getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) ->then( function ($response) { return $response[0]; @@ -36396,28 +25307,21 @@ class DbsApi } /** - * Operation getOffers_0AsyncWithHttpInfo + * Operation getGoodsStatsAsyncWithHttpInfo * - * Предложения магазина + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_0AsyncWithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_0'][0]) + public function getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - $request = $this->getOffers_0Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36456,116 +25360,43 @@ class DbsApi } /** - * Create request for operation 'getOffers_0' + * Create request for operation 'getGoodsStats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOffers_0Request($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_0'][0]) + public function getGoodsStatsRequest($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOffers_0' + 'Missing the required parameter $campaign_id when calling getGoodsStats' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getGoodsStats, must be bigger than or equal to 1.'); } - - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getOffers_0, must be smaller than or equal to 10000.'); + // verify the required parameter 'get_goods_stats_request' is set + if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats' + ); } - - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/skus'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_category_id, - 'shopCategoryId', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $matched, - 'matched', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -36585,7 +25416,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); + } else { + $httpBody = $get_goods_stats_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -36633,7 +25471,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36641,40 +25479,44 @@ class DbsApi } /** - * Operation getOrderBusinessBuyerInfo_2 + * Operation getHiddenOffers * - * Информация о покупателе — юридическом лице + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessBuyerInfo_2($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_2'][0]) + public function getHiddenOffers($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - list($response) = $this->getOrderBusinessBuyerInfo_2WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getHiddenOffersWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrderBusinessBuyerInfo_2WithHttpInfo + * Operation getHiddenOffersWithHttpInfo * - * Информация о покупателе — юридическом лице + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessBuyerInfo_2WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_2'][0]) + public function getHiddenOffersWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $request = $this->getOrderBusinessBuyerInfo_2Request($campaign_id, $order_id, $contentType); + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -36701,196 +25543,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36904,44 +25595,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + '\OpenAPI\Client\Model\GetHiddenOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36949,7 +25617,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36957,7 +25625,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36965,15 +25633,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36981,7 +25641,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36989,27 +25649,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessBuyerInfo_2Async + * Operation getHiddenOffersAsync * - * Информация о покупателе — юридическом лице + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_2Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_2'][0]) + public function getHiddenOffersAsync($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - return $this->getOrderBusinessBuyerInfo_2AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -37018,21 +25682,23 @@ class DbsApi } /** - * Operation getOrderBusinessBuyerInfo_2AsyncWithHttpInfo + * Operation getHiddenOffersAsyncWithHttpInfo * - * Информация о покупателе — юридическом лице + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_2AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_2'][0]) + public function getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - $request = $this->getOrderBusinessBuyerInfo_2Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37071,43 +25737,71 @@ class DbsApi } /** - * Create request for operation 'getOrderBusinessBuyerInfo_2' + * Create request for operation 'getHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessBuyerInfo_2Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_2'][0]) + public function getHiddenOffersRequest($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo_2' + 'Missing the required parameter $campaign_id when calling getHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderBusinessBuyerInfo_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getHiddenOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo_2' - ); - } + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getHiddenOffers, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offer_id, + 'offer_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -37118,14 +25812,6 @@ class DbsApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -37183,7 +25869,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37191,40 +25877,44 @@ class DbsApi } /** - * Operation getOrderBusinessDocumentsInfo_2 + * Operation getOfferCardsContentStatus * - * Информация о документах + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessDocumentsInfo_2($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_2'][0]) + public function getOfferCardsContentStatus($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - list($response) = $this->getOrderBusinessDocumentsInfo_2WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getOfferCardsContentStatusWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); return $response; } /** - * Operation getOrderBusinessDocumentsInfo_2WithHttpInfo + * Operation getOfferCardsContentStatusWithHttpInfo * - * Информация о документах + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessDocumentsInfo_2WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_2'][0]) + public function getOfferCardsContentStatusWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - $request = $this->getOrderBusinessDocumentsInfo_2Request($campaign_id, $order_id, $contentType); + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -37251,196 +25941,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -37454,44 +25999,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37499,7 +26021,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37507,7 +26029,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37515,7 +26037,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37523,7 +26045,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37531,7 +26053,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37539,27 +26061,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessDocumentsInfo_2Async + * Operation getOfferCardsContentStatusAsync * - * Информация о документах + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_2Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_2'][0]) + public function getOfferCardsContentStatusAsync($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - return $this->getOrderBusinessDocumentsInfo_2AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -37568,21 +26094,23 @@ class DbsApi } /** - * Operation getOrderBusinessDocumentsInfo_2AsyncWithHttpInfo + * Operation getOfferCardsContentStatusAsyncWithHttpInfo * - * Информация о документах + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_2AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_2'][0]) + public function getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - $request = $this->getOrderBusinessDocumentsInfo_2Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37621,58 +26149,69 @@ class DbsApi } /** - * Create request for operation 'getOrderBusinessDocumentsInfo_2' + * Create request for operation 'getOfferCardsContentStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessDocumentsInfo_2Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_2'][0]) + public function getOfferCardsContentStatusRequest($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo_2' + 'Missing the required parameter $business_id when calling getOfferCardsContentStatus' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderBusinessDocumentsInfo_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo_2' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/documents'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -37685,7 +26224,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_offer_cards_content_status_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); + } else { + $httpBody = $get_offer_cards_content_status_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -37741,40 +26287,58 @@ class DbsApi } /** - * Operation getOrderBuyerInfo_0 + * Operation getOfferMappingEntries * - * Информация о покупателе — физическом лице + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getOrderBuyerInfo_0($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo_0'][0]) + public function getOfferMappingEntries($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - list($response) = $this->getOrderBuyerInfo_0WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrderBuyerInfo_0WithHttpInfo + * Operation getOfferMappingEntriesWithHttpInfo * - * Информация о покупателе — физическом лице + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getOrderBuyerInfo_0WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo_0'][0]) + public function getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - $request = $this->getOrderBuyerInfo_0Request($campaign_id, $order_id, $contentType); + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -37801,196 +26365,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38004,44 +26423,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38049,7 +26445,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38057,7 +26453,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38065,7 +26461,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38073,7 +26469,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38081,7 +26477,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38089,27 +26485,38 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBuyerInfo_0Async + * Operation getOfferMappingEntriesAsync * - * Информация о покупателе — физическом лице + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrderBuyerInfo_0Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo_0'][0]) + public function getOfferMappingEntriesAsync($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - return $this->getOrderBuyerInfo_0AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -38118,21 +26525,30 @@ class DbsApi } /** - * Operation getOrderBuyerInfo_0AsyncWithHttpInfo + * Operation getOfferMappingEntriesAsyncWithHttpInfo * - * Информация о покупателе — физическом лице + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrderBuyerInfo_0AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo_0'][0]) + public function getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse'; - $request = $this->getOrderBuyerInfo_0Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38171,43 +26587,138 @@ class DbsApi } /** - * Create request for operation 'getOrderBuyerInfo_0' + * Create request for operation 'getOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getOrderBuyerInfo_0Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo_0'][0]) + public function getOfferMappingEntriesRequest($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBuyerInfo_0' + 'Missing the required parameter $campaign_id when calling getOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderBuyerInfo_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOfferMappingEntries, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBuyerInfo_0' - ); - } + + + + + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOfferMappingEntries, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/buyer'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offer_id, + 'offer_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shop_sku, + 'shop_sku', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $mapping_kind, + 'mapping_kind', // param base name + 'OfferMappingKindType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $availability, + 'availability', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $category_id, + 'category_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $vendor, + 'vendor', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -38218,14 +26729,6 @@ class DbsApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -38291,40 +26794,46 @@ class DbsApi } /** - * Operation getOrderLabelsData_1 + * Operation getOfferMappings * - * Данные для самостоятельного изготовления ярлыков + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderLabelsData_1($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_1'][0]) + public function getOfferMappings($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - list($response) = $this->getOrderLabelsData_1WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $response; } /** - * Operation getOrderLabelsData_1WithHttpInfo + * Operation getOfferMappingsWithHttpInfo * - * Данные для самостоятельного изготовления ярлыков + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderLabelsData_1WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_1'][0]) + public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - $request = $this->getOrderLabelsData_1Request($campaign_id, $order_id, $contentType); + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -38351,196 +26860,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38554,44 +26918,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + '\OpenAPI\Client\Model\GetOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38599,7 +26940,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38607,7 +26948,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38615,7 +26956,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38623,7 +26964,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38631,7 +26972,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38639,27 +26980,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderLabelsData_1Async + * Operation getOfferMappingsAsync * - * Данные для самостоятельного изготовления ярлыков + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderLabelsData_1Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_1'][0]) + public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - return $this->getOrderLabelsData_1AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -38668,21 +27014,24 @@ class DbsApi } /** - * Operation getOrderLabelsData_1AsyncWithHttpInfo + * Operation getOfferMappingsAsyncWithHttpInfo * - * Данные для самостоятельного изготовления ярлыков + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderLabelsData_1AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_1'][0]) + public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - $request = $this->getOrderLabelsData_1Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38721,58 +27070,80 @@ class DbsApi } /** - * Create request for operation 'getOrderLabelsData_1' + * Create request for operation 'getOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderLabelsData_1Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_1'][0]) + public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderLabelsData_1' + 'Missing the required parameter $business_id when calling getOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderLabelsData_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getOfferMappings, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderLabelsData_1' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOfferMappings, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -38785,7 +27156,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_offer_mappings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); + } else { + $httpBody = $get_offer_mappings_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -38833,7 +27211,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38841,40 +27219,44 @@ class DbsApi } /** - * Operation getOrder_2 + * Operation getOfferRecommendations * - * Информация об одном заказе + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrder_2($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_2'][0]) + public function getOfferRecommendations($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - list($response) = $this->getOrder_2WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrder_2WithHttpInfo + * Operation getOfferRecommendationsWithHttpInfo * - * Информация об одном заказе + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrder_2WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_2'][0]) + public function getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $request = $this->getOrder_2Request($campaign_id, $order_id, $contentType); + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -38901,196 +27283,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39104,44 +27341,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderResponse', + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39149,7 +27363,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39157,7 +27371,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39165,7 +27379,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39173,7 +27387,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39181,7 +27395,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39189,27 +27403,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrder_2Async + * Operation getOfferRecommendationsAsync * - * Информация об одном заказе + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_2Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_2'][0]) + public function getOfferRecommendationsAsync($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - return $this->getOrder_2AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -39218,21 +27436,23 @@ class DbsApi } /** - * Operation getOrder_2AsyncWithHttpInfo + * Operation getOfferRecommendationsAsyncWithHttpInfo * - * Информация об одном заказе + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_2AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_2'][0]) + public function getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - $request = $this->getOrder_2Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39271,58 +27491,75 @@ class DbsApi } /** - * Create request for operation 'getOrder_2' + * Create request for operation 'getOfferRecommendations' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrder_2Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_2'][0]) + public function getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrder_2' + 'Missing the required parameter $business_id when calling getOfferRecommendations' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrder_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getOfferRecommendations, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_offer_recommendations_request' is set + if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrder_2' + 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOfferRecommendations, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/offers/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -39335,7 +27572,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_offer_recommendations_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + } else { + $httpBody = $get_offer_recommendations_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -39383,7 +27627,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -39391,44 +27635,42 @@ class DbsApi } /** - * Operation getOrdersStats_2 + * Operation getOrder * - * Детальная информация по заказам + * Информация об одном заказе в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getOrdersStats_2($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_2'][0]) + public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - list($response) = $this->getOrdersStats_2WithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getOrdersStats_2WithHttpInfo + * Operation getOrderWithHttpInfo * - * Детальная информация по заказам + * Информация об одном заказе в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getOrdersStats_2WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_2'][0]) + public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $request = $this->getOrdersStats_2Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -39455,196 +27697,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39658,44 +27755,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersStatsResponse', + '\OpenAPI\Client\Model\GetOrderResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39703,7 +27777,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39711,7 +27785,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39719,7 +27793,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39727,7 +27801,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39735,7 +27809,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39743,29 +27817,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrdersStats_2Async + * Operation getOrderAsync * - * Детальная информация по заказам + * Информация об одном заказе в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrdersStats_2Async($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_2'][0]) + public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - return $this->getOrdersStats_2AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -39774,23 +27849,22 @@ class DbsApi } /** - * Operation getOrdersStats_2AsyncWithHttpInfo + * Operation getOrderAsyncWithHttpInfo * - * Детальная информация по заказам + * Информация об одном заказе в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrdersStats_2AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_2'][0]) + public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - $request = $this->getOrdersStats_2Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39829,59 +27903,44 @@ class DbsApi } /** - * Create request for operation 'getOrdersStats_2' + * Create request for operation 'getOrder' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getOrdersStats_2Request($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_2'][0]) + public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrdersStats_2' + 'Missing the required parameter $campaign_id when calling getOrder' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrdersStats_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrder, must be bigger than or equal to 1.'); } + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrder' + ); + } - - - $resourcePath = '/campaigns/{campaignId}/stats/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -39892,6 +27951,14 @@ class DbsApi $resourcePath ); } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -39901,14 +27968,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_orders_stats_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); - } else { - $httpBody = $get_orders_stats_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -39956,7 +28016,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -39964,76 +28024,40 @@ class DbsApi } /** - * Operation getOrders_1 - * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_1'] to see the possible values for this operation + * Operation getOrderBusinessBuyerInfo + * + * Информация о покупателе — юридическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrders_1($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_1'][0]) + public function getOrderBusinessBuyerInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - list($response) = $this->getOrders_1WithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + list($response) = $this->getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getOrders_1WithHttpInfo - * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_1'] to see the possible values for this operation + * Operation getOrderBusinessBuyerInfoWithHttpInfo + * + * Информация о покупателе — юридическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrders_1WithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_1'][0]) + public function getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - $request = $this->getOrders_1Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -40060,196 +28084,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40263,44 +28142,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersResponse', + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40308,7 +28164,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40316,7 +28172,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40324,7 +28180,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40332,7 +28188,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40340,7 +28196,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40348,45 +28204,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrders_1Async + * Operation getOrderBusinessBuyerInfoAsync * - * Информация о нескольких заказах + * Информация о покупателе — юридическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrders_1Async($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_1'][0]) + public function getOrderBusinessBuyerInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - return $this->getOrders_1AsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + return $this->getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -40395,39 +28235,21 @@ class DbsApi } /** - * Operation getOrders_1AsyncWithHttpInfo + * Operation getOrderBusinessBuyerInfoAsyncWithHttpInfo * - * Информация о нескольких заказах + * Информация о покупателе — юридическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrders_1AsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_1'][0]) + public function getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - $request = $this->getOrders_1Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40466,229 +28288,2254 @@ class DbsApi } /** - * Create request for operation 'getOrders_1' + * Create request for operation 'getOrderBusinessBuyerInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderBusinessBuyerInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderBusinessDocumentsInfo + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderBusinessDocumentsInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + list($response) = $this->getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderBusinessDocumentsInfoWithHttpInfo + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderBusinessDocumentsInfoAsync + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBusinessDocumentsInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + return $this->getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderBusinessDocumentsInfoAsyncWithHttpInfo + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderBusinessDocumentsInfo' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderBusinessDocumentsInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderBuyerInfo + * + * Информация о покупателе — физическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderBuyerInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo'][0]) + { + list($response) = $this->getOrderBuyerInfoWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderBuyerInfoWithHttpInfo + * + * Информация о покупателе — физическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderBuyerInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo'][0]) + { + $request = $this->getOrderBuyerInfoRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderBuyerInfoAsync + * + * Информация о покупателе — физическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBuyerInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo'][0]) + { + return $this->getOrderBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderBuyerInfoAsyncWithHttpInfo + * + * Информация о покупателе — физическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse'; + $request = $this->getOrderBuyerInfoRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderBuyerInfo' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderBuyerInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBuyerInfo'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBuyerInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderBuyerInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBuyerInfo' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/buyer'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderLabelsData + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderLabelsData($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + list($response) = $this->getOrderLabelsDataWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderLabelsDataWithHttpInfo + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderLabelsDataWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + $request = $this->getOrderLabelsDataRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderLabelsDataAsync + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderLabelsDataAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + return $this->getOrderLabelsDataAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderLabelsDataAsyncWithHttpInfo + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderLabelsDataAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; + $request = $this->getOrderLabelsDataRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderLabelsData' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderLabelsDataRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderLabelsData' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrderLabelsData, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderLabelsData' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrders + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOrdersWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersAsync + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersAsyncWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrders' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrders' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrders, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling DbsApi.getOrders, number of items must be less than or equal to 50.'); + } + if ($order_ids !== null && count($order_ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling DbsApi.getOrders, number of items must be greater than or equal to 1.'); + } + + + + + + + + + + + + + + + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getOrders, must be smaller than or equal to 10000.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $substatus, + 'substatus', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_from, + 'supplierShipmentDateFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_to, + 'supplierShipmentDateTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_from, + 'updatedAtFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_to, + 'updatedAtTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dispatch_type, + 'dispatchType', // param base name + 'OrderDeliveryDispatchType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fake, + 'fake', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_cis, + 'hasCis', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_waiting_for_cancellation_approve, + 'onlyWaitingForCancellationApprove', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_estimated_delivery, + 'onlyEstimatedDelivery', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_type, + 'buyerType', // param base name + 'OrderBuyerType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrdersStats + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrdersStats($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + list($response) = $this->getOrdersStatsWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + return $response; + } + + /** + * Operation getOrdersStatsWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrdersStatsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersStatsAsync + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsync($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + return $this->getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersStatsAsyncWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrdersStats' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrders_1Request($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_1'][0]) + public function getOrdersStatsRequest($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrders_1' + 'Missing the required parameter $campaign_id when calling getOrdersStats' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrders_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOrdersStats, must be bigger than or equal to 1.'); } - - - - - - - - - - - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.getOrders_1, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOrdersStats, must be bigger than or equal to 1.'); } - - - $resourcePath = '/campaigns/{campaignId}/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $substatus, - 'substatus', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_from, - 'supplierShipmentDateFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_to, - 'supplierShipmentDateTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_from, - 'updatedAtFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_to, - 'updatedAtTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $dispatch_type, - 'dispatchType', // param base name - 'OrderDeliveryDispatchType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fake, - 'fake', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $has_cis, - 'hasCis', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_waiting_for_cancellation_approve, - 'onlyWaitingForCancellationApprove', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_estimated_delivery, - 'onlyEstimatedDelivery', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $buyer_type, - 'buyerType', // param base name - 'OrderBuyerType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, @@ -40719,6 +30566,400 @@ class DbsApi } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_orders_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); + } else { + $httpBody = $get_orders_stats_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOutlet + * + * Информация об одной точке продаж + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOutletResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOutlet($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet'][0]) + { + list($response) = $this->getOutletWithHttpInfo($campaign_id, $outlet_id, $contentType); + return $response; + } + + /** + * Operation getOutletWithHttpInfo + * + * Информация об одной точке продаж + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOutletResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOutletWithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet'][0]) + { + $request = $this->getOutletRequest($campaign_id, $outlet_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOutletResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOutletAsync + * + * Информация об одной точке продаж + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOutletAsync($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet'][0]) + { + return $this->getOutletAsyncWithHttpInfo($campaign_id, $outlet_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOutletAsyncWithHttpInfo + * + * Информация об одной точке продаж + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOutletAsyncWithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOutletResponse'; + $request = $this->getOutletRequest($campaign_id, $outlet_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOutlet' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOutletRequest($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOutlet' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOutlet, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'outlet_id' is set + if ($outlet_id === null || (is_array($outlet_id) && count($outlet_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $outlet_id when calling getOutlet' + ); + } + if ($outlet_id < 1) { + throw new \InvalidArgumentException('invalid value for "$outlet_id" when calling DbsApi.getOutlet, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/outlets/{outletId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($outlet_id !== null) { + $resourcePath = str_replace( + '{' . 'outletId' . '}', + ObjectSerializer::toPathValue($outlet_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -40782,42 +31023,42 @@ class DbsApi } /** - * Operation getOutletLicenses_0 + * Operation getOutletLicenses * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetOutletLicensesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOutletLicenses_0($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses_0'][0]) + public function getOutletLicenses($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses'][0]) { - list($response) = $this->getOutletLicenses_0WithHttpInfo($campaign_id, $outlet_ids, $ids, $contentType); + list($response) = $this->getOutletLicensesWithHttpInfo($campaign_id, $outlet_ids, $ids, $contentType); return $response; } /** - * Operation getOutletLicenses_0WithHttpInfo + * Operation getOutletLicensesWithHttpInfo * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetOutletLicensesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOutletLicenses_0WithHttpInfo($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses_0'][0]) + public function getOutletLicensesWithHttpInfo($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses'][0]) { - $request = $this->getOutletLicenses_0Request($campaign_id, $outlet_ids, $ids, $contentType); + $request = $this->getOutletLicensesRequest($campaign_id, $outlet_ids, $ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -40844,196 +31085,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOutletLicensesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOutletLicensesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOutletLicensesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletLicensesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41047,34 +31143,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOutletLicensesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletLicensesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -41084,7 +31157,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41092,7 +31165,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41100,7 +31173,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41108,7 +31181,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41116,7 +31189,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41124,7 +31197,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41132,28 +31205,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOutletLicenses_0Async + * Operation getOutletLicensesAsync * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutletLicenses_0Async($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses_0'][0]) + public function getOutletLicensesAsync($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses'][0]) { - return $this->getOutletLicenses_0AsyncWithHttpInfo($campaign_id, $outlet_ids, $ids, $contentType) + return $this->getOutletLicensesAsyncWithHttpInfo($campaign_id, $outlet_ids, $ids, $contentType) ->then( function ($response) { return $response[0]; @@ -41162,22 +31237,22 @@ class DbsApi } /** - * Operation getOutletLicenses_0AsyncWithHttpInfo + * Operation getOutletLicensesAsyncWithHttpInfo * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutletLicenses_0AsyncWithHttpInfo($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses_0'][0]) + public function getOutletLicensesAsyncWithHttpInfo($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses'][0]) { $returnType = '\OpenAPI\Client\Model\GetOutletLicensesResponse'; - $request = $this->getOutletLicenses_0Request($campaign_id, $outlet_ids, $ids, $contentType); + $request = $this->getOutletLicensesRequest($campaign_id, $outlet_ids, $ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41216,39 +31291,45 @@ class DbsApi } /** - * Create request for operation 'getOutletLicenses_0' + * Create request for operation 'getOutletLicenses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOutletLicenses_0Request($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses_0'][0]) + public function getOutletLicensesRequest($campaign_id, $outlet_ids = null, $ids = null, string $contentType = self::contentTypes['getOutletLicenses'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOutletLicenses_0' + 'Missing the required parameter $campaign_id when calling getOutletLicenses' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOutletLicenses_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOutletLicenses, must be bigger than or equal to 1.'); } if ($outlet_ids !== null && count($outlet_ids) > 500) { - throw new \InvalidArgumentException('invalid value for "$outlet_ids" when calling DbsApi.getOutletLicenses_0, number of items must be less than or equal to 500.'); + throw new \InvalidArgumentException('invalid value for "$outlet_ids" when calling DbsApi.getOutletLicenses, number of items must be less than or equal to 500.'); } if ($outlet_ids !== null && count($outlet_ids) < 1) { - throw new \InvalidArgumentException('invalid value for "$outlet_ids" when calling DbsApi.getOutletLicenses_0, number of items must be greater than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$outlet_ids" when calling DbsApi.getOutletLicenses, number of items must be greater than or equal to 1.'); } + if ($ids !== null && count($ids) > 500) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling DbsApi.getOutletLicenses, number of items must be less than or equal to 500.'); + } + if ($ids !== null && count($ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling DbsApi.getOutletLicenses, number of items must be greater than or equal to 1.'); + } - $resourcePath = '/campaigns/{campaignId}/outlets/licenses'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/licenses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41348,40 +31429,48 @@ class DbsApi } /** - * Operation getOutlet_0 + * Operation getOutlets * - * Информация об одной точке продаж + * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOutletResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOutletsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOutlet_0($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet_0'][0]) + public function getOutlets($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - list($response) = $this->getOutlet_0WithHttpInfo($campaign_id, $outlet_id, $contentType); + list($response) = $this->getOutletsWithHttpInfo($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType); return $response; } /** - * Operation getOutlet_0WithHttpInfo + * Operation getOutletsWithHttpInfo * - * Информация об одной точке продаж + * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOutletResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOutletsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOutlet_0WithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet_0'][0]) + public function getOutletsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - $request = $this->getOutlet_0Request($campaign_id, $outlet_id, $contentType); + $request = $this->getOutletsRequest($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType); try { $options = $this->createHttpClientOption(); @@ -41408,196 +31497,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOutletResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOutletResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOutletResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41611,44 +31555,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOutletResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOutletResponse', + '\OpenAPI\Client\Model\GetOutletsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41656,7 +31577,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41664,7 +31585,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41672,7 +31593,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41680,7 +31601,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41688,7 +31609,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41696,27 +31617,33 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOutlet_0Async + * Operation getOutletsAsync * - * Информация об одной точке продаж + * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutlet_0Async($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet_0'][0]) + public function getOutletsAsync($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - return $this->getOutlet_0AsyncWithHttpInfo($campaign_id, $outlet_id, $contentType) + return $this->getOutletsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType) ->then( function ($response) { return $response[0]; @@ -41725,21 +31652,25 @@ class DbsApi } /** - * Operation getOutlet_0AsyncWithHttpInfo + * Operation getOutletsAsyncWithHttpInfo * - * Информация об одной точке продаж + * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutlet_0AsyncWithHttpInfo($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet_0'][0]) + public function getOutletsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOutletResponse'; - $request = $this->getOutlet_0Request($campaign_id, $outlet_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOutletsResponse'; + $request = $this->getOutletsRequest($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41778,46 +31709,93 @@ class DbsApi } /** - * Create request for operation 'getOutlet_0' + * Create request for operation 'getOutlets' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOutlet_0Request($campaign_id, $outlet_id, string $contentType = self::contentTypes['getOutlet_0'][0]) + public function getOutletsRequest($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOutlet_0' + 'Missing the required parameter $campaign_id when calling getOutlets' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOutlet_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOutlets, must be bigger than or equal to 1.'); } - // verify the required parameter 'outlet_id' is set - if ($outlet_id === null || (is_array($outlet_id) && count($outlet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $outlet_id when calling getOutlet_0' - ); - } - if ($outlet_id < 1) { - throw new \InvalidArgumentException('invalid value for "$outlet_id" when calling DbsApi.getOutlet_0, must be bigger than or equal to 1.'); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getOutlets, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/outlets/{outletId}'; + + + + $resourcePath = '/v2/campaigns/{campaignId}/outlets'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $region_id, + 'region_id', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shop_outlet_code, + 'shop_outlet_code', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $region_id2, + 'regionId', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -41828,14 +31806,6 @@ class DbsApi $resourcePath ); } - // path params - if ($outlet_id !== null) { - $resourcePath = str_replace( - '{' . 'outletId' . '}', - ObjectSerializer::toPathValue($outlet_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -41901,46 +31871,44 @@ class DbsApi } /** - * Operation getOutlets_0 + * Operation getPagedWarehouses * - * Информация о нескольких точках продаж + * Список складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOutletsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOutlets_0($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets_0'][0]) + public function getPagedWarehouses($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - list($response) = $this->getOutlets_0WithHttpInfo($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType); + list($response) = $this->getPagedWarehousesWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); return $response; } /** - * Operation getOutlets_0WithHttpInfo + * Operation getPagedWarehousesWithHttpInfo * - * Информация о нескольких точках продаж + * Список складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOutletsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOutlets_0WithHttpInfo($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets_0'][0]) + public function getPagedWarehousesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - $request = $this->getOutlets_0Request($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType); + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -41967,196 +31935,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOutletsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOutletsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOutletsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -42170,44 +31987,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOutletsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOutletsResponse', + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42215,7 +32009,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42223,7 +32017,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42231,15 +32025,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42247,7 +32033,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42255,30 +32041,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOutlets_0Async + * Operation getPagedWarehousesAsync * - * Информация о нескольких точках продаж + * Список складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutlets_0Async($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets_0'][0]) + public function getPagedWarehousesAsync($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - return $this->getOutlets_0AsyncWithHttpInfo($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType) + return $this->getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType) ->then( function ($response) { return $response[0]; @@ -42287,24 +32074,23 @@ class DbsApi } /** - * Operation getOutlets_0AsyncWithHttpInfo + * Operation getPagedWarehousesAsyncWithHttpInfo * - * Информация о нескольких точках продаж + * Список складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutlets_0AsyncWithHttpInfo($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets_0'][0]) + public function getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOutletsResponse'; - $request = $this->getOutlets_0Request($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPagedWarehousesResponse'; + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42343,37 +32129,38 @@ class DbsApi } /** - * Create request for operation 'getOutlets_0' + * Create request for operation 'getPagedWarehouses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOutlets_0Request($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets_0'][0]) + public function getPagedWarehousesRequest($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOutlets_0' + 'Missing the required parameter $business_id when calling getPagedWarehouses' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getOutlets_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getPagedWarehouses, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getPagedWarehouses, must be bigger than or equal to 1.'); + } + - - - $resourcePath = '/campaigns/{campaignId}/outlets'; + $resourcePath = '/v2/businesses/{businessId}/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42391,26 +32178,8 @@ class DbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id, - 'region_id', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_outlet_code, - 'shop_outlet_code', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id2, - 'regionId', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -42419,10 +32188,10 @@ class DbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -42435,7 +32204,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_paged_warehouses_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_paged_warehouses_request)); + } else { + $httpBody = $get_paged_warehouses_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -42483,7 +32259,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -42491,44 +32267,46 @@ class DbsApi } /** - * Operation getPricesByOfferIds_2 + * Operation getPrices * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getPricesByOfferIds_2($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_2'][0]) + public function getPrices($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - list($response) = $this->getPricesByOfferIds_2WithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + list($response) = $this->getPricesWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); return $response; } /** - * Operation getPricesByOfferIds_2WithHttpInfo + * Operation getPricesWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getPricesByOfferIds_2WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_2'][0]) + public function getPricesWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - $request = $this->getPricesByOfferIds_2Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); try { $options = $this->createHttpClientOption(); @@ -42555,196 +32333,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -42758,44 +32391,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + '\OpenAPI\Client\Model\GetPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42803,7 +32413,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42811,7 +32421,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42819,7 +32429,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42827,7 +32437,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42835,7 +32445,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42843,29 +32453,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPricesByOfferIds_2Async + * Operation getPricesAsync * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getPricesByOfferIds_2Async($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_2'][0]) + public function getPricesAsync($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - return $this->getPricesByOfferIds_2AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + return $this->getPricesAsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) ->then( function ($response) { return $response[0]; @@ -42874,23 +32487,24 @@ class DbsApi } /** - * Operation getPricesByOfferIds_2AsyncWithHttpInfo + * Operation getPricesAsyncWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getPricesByOfferIds_2AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_2'][0]) + public function getPricesAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - $request = $this->getPricesByOfferIds_2Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42929,35 +32543,39 @@ class DbsApi } /** - * Create request for operation 'getPricesByOfferIds_2' + * Create request for operation 'getPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getPricesByOfferIds_2Request($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_2'][0]) + public function getPricesRequest($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPricesByOfferIds_2' + 'Missing the required parameter $campaign_id when calling getPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getPricesByOfferIds_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getPrices, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42982,6 +32600,15 @@ class DbsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $archived, + 'archived', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -43001,14 +32628,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_prices_by_offer_ids_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); - } else { - $httpBody = $get_prices_by_offer_ids_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -43056,7 +32676,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -43064,46 +32684,44 @@ class DbsApi } /** - * Operation getPrices_2 + * Operation getPricesByOfferIds * - * Список цен + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPrices_2($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_2'][0]) + public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - list($response) = $this->getPrices_2WithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); return $response; } /** - * Operation getPrices_2WithHttpInfo + * Operation getPricesByOfferIdsWithHttpInfo * - * Список цен + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPrices_2WithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_2'][0]) + public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - $request = $this->getPrices_2Request($campaign_id, $page_token, $limit, $archived, $contentType); + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -43130,196 +32748,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43333,44 +32806,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesResponse', + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43378,7 +32828,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43386,7 +32836,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43394,7 +32844,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43402,7 +32852,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43410,7 +32860,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43418,30 +32868,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPrices_2Async + * Operation getPricesByOfferIdsAsync * - * Список цен + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPrices_2Async($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_2'][0]) + public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - return $this->getPrices_2AsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -43450,24 +32901,23 @@ class DbsApi } /** - * Operation getPrices_2AsyncWithHttpInfo + * Operation getPricesByOfferIdsAsyncWithHttpInfo * - * Список цен + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPrices_2AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_2'][0]) + public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - $request = $this->getPrices_2Request($campaign_id, $page_token, $limit, $archived, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43506,36 +32956,38 @@ class DbsApi } /** - * Create request for operation 'getPrices_2' + * Create request for operation 'getPricesByOfferIds' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getPrices_2Request($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_2'][0]) + public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPrices_2' + 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getPrices_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getPricesByOfferIds, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43560,15 +33012,6 @@ class DbsApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $archived, - 'archived', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -43588,7 +33031,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_prices_by_offer_ids_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + } else { + $httpBody = $get_prices_by_offer_ids_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -43636,7 +33086,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -43644,44 +33094,44 @@ class DbsApi } /** - * Operation getPromoOffers_2 + * Operation getPromoOffers * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_2'] to see the possible values for this operation + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromoOffers_2($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_2'][0]) + public function getPromoOffers($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - list($response) = $this->getPromoOffers_2WithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + list($response) = $this->getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getPromoOffers_2WithHttpInfo + * Operation getPromoOffersWithHttpInfo * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_2'] to see the possible values for this operation + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromoOffers_2WithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_2'][0]) + public function getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - $request = $this->getPromoOffers_2Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -43708,196 +33158,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43911,34 +33216,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -43948,7 +33230,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43956,7 +33238,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43964,7 +33246,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43972,7 +33254,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43980,7 +33262,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43988,7 +33270,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43996,29 +33278,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromoOffers_2Async + * Operation getPromoOffersAsync * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_2'] to see the possible values for this operation + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromoOffers_2Async($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_2'][0]) + public function getPromoOffersAsync($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - return $this->getPromoOffers_2AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) + return $this->getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -44027,23 +33311,23 @@ class DbsApi } /** - * Operation getPromoOffers_2AsyncWithHttpInfo + * Operation getPromoOffersAsyncWithHttpInfo * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_2'] to see the possible values for this operation + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromoOffers_2AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_2'][0]) + public function getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - $request = $this->getPromoOffers_2Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44082,41 +33366,44 @@ class DbsApi } /** - * Create request for operation 'getPromoOffers_2' + * Create request for operation 'getPromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_2'] to see the possible values for this operation + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromoOffers_2Request($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_2'][0]) + public function getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromoOffers_2' + 'Missing the required parameter $business_id when calling getPromoOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getPromoOffers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getPromoOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'get_promo_offers_request' is set if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers_2' + 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getPromoOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/promos/offers'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -44223,40 +33510,40 @@ class DbsApi } /** - * Operation getPromos_2 + * Operation getPromos * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromos_2($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_2'][0]) + public function getPromos($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - list($response) = $this->getPromos_2WithHttpInfo($business_id, $get_promos_request, $contentType); + list($response) = $this->getPromosWithHttpInfo($business_id, $get_promos_request, $contentType); return $response; } /** - * Operation getPromos_2WithHttpInfo + * Operation getPromosWithHttpInfo * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromos_2WithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_2'][0]) + public function getPromosWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - $request = $this->getPromos_2Request($business_id, $get_promos_request, $contentType); + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -44283,196 +33570,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromosResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromosResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromosResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44486,34 +33628,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -44523,7 +33642,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44531,7 +33650,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44539,7 +33658,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44547,7 +33666,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44555,7 +33674,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44563,7 +33682,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44571,27 +33690,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromos_2Async + * Operation getPromosAsync * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_2Async($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_2'][0]) + public function getPromosAsync($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - return $this->getPromos_2AsyncWithHttpInfo($business_id, $get_promos_request, $contentType) + return $this->getPromosAsyncWithHttpInfo($business_id, $get_promos_request, $contentType) ->then( function ($response) { return $response[0]; @@ -44600,21 +33721,21 @@ class DbsApi } /** - * Operation getPromos_2AsyncWithHttpInfo + * Operation getPromosAsyncWithHttpInfo * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_2AsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_2'][0]) + public function getPromosAsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - $request = $this->getPromos_2Request($business_id, $get_promos_request, $contentType); + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44653,31 +33774,31 @@ class DbsApi } /** - * Create request for operation 'getPromos_2' + * Create request for operation 'getPromos' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromos_2Request($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_2'][0]) + public function getPromosRequest($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromos_2' + 'Missing the required parameter $business_id when calling getPromos' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getPromos_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getPromos, must be bigger than or equal to 1.'); } - $resourcePath = '/businesses/{businessId}/promos'; + $resourcePath = '/v2/businesses/{businessId}/promos'; $formParams = []; $queryParams = []; $headerParams = []; @@ -44766,38 +33887,38 @@ class DbsApi } /** - * Operation getQualityRatingDetails_1 + * Operation getQualityRatingDetails * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getQualityRatingDetails_1($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_1'][0]) + public function getQualityRatingDetails($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - list($response) = $this->getQualityRatingDetails_1WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getQualityRatingDetailsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getQualityRatingDetails_1WithHttpInfo + * Operation getQualityRatingDetailsWithHttpInfo * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getQualityRatingDetails_1WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_1'][0]) + public function getQualityRatingDetailsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - $request = $this->getQualityRatingDetails_1Request($campaign_id, $contentType); + $request = $this->getQualityRatingDetailsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -44824,196 +33945,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45027,34 +34003,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -45064,7 +34017,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45072,7 +34025,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45080,7 +34033,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45088,7 +34041,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45096,7 +34049,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45104,7 +34057,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45112,26 +34065,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatingDetails_1Async + * Operation getQualityRatingDetailsAsync * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatingDetails_1Async($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_1'][0]) + public function getQualityRatingDetailsAsync($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - return $this->getQualityRatingDetails_1AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getQualityRatingDetailsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -45140,20 +34095,20 @@ class DbsApi } /** - * Operation getQualityRatingDetails_1AsyncWithHttpInfo + * Operation getQualityRatingDetailsAsyncWithHttpInfo * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatingDetails_1AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_1'][0]) + public function getQualityRatingDetailsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - $request = $this->getQualityRatingDetails_1Request($campaign_id, $contentType); + $request = $this->getQualityRatingDetailsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45192,29 +34147,29 @@ class DbsApi } /** - * Create request for operation 'getQualityRatingDetails_1' + * Create request for operation 'getQualityRatingDetails' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getQualityRatingDetails_1Request($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_1'][0]) + public function getQualityRatingDetailsRequest($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getQualityRatingDetails_1' + 'Missing the required parameter $campaign_id when calling getQualityRatingDetails' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getQualityRatingDetails_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getQualityRatingDetails, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/ratings/quality/details'; + $resourcePath = '/v2/campaigns/{campaignId}/ratings/quality/details'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45296,40 +34251,40 @@ class DbsApi } /** - * Operation getQualityRatings_2 + * Operation getQualityRatings * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getQualityRatings_2($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_2'][0]) + public function getQualityRatings($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - list($response) = $this->getQualityRatings_2WithHttpInfo($business_id, $get_quality_rating_request, $contentType); + list($response) = $this->getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, $contentType); return $response; } /** - * Operation getQualityRatings_2WithHttpInfo + * Operation getQualityRatingsWithHttpInfo * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getQualityRatings_2WithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_2'][0]) + public function getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - $request = $this->getQualityRatings_2Request($business_id, $get_quality_rating_request, $contentType); + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -45356,196 +34311,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45559,34 +34369,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -45596,7 +34383,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45604,7 +34391,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45612,7 +34399,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45620,7 +34407,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45628,7 +34415,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45636,7 +34423,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45644,27 +34431,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatings_2Async + * Operation getQualityRatingsAsync * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatings_2Async($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_2'][0]) + public function getQualityRatingsAsync($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - return $this->getQualityRatings_2AsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) + return $this->getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) ->then( function ($response) { return $response[0]; @@ -45673,21 +34462,21 @@ class DbsApi } /** - * Operation getQualityRatings_2AsyncWithHttpInfo + * Operation getQualityRatingsAsyncWithHttpInfo * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatings_2AsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_2'][0]) + public function getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - $request = $this->getQualityRatings_2Request($business_id, $get_quality_rating_request, $contentType); + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45726,37 +34515,37 @@ class DbsApi } /** - * Create request for operation 'getQualityRatings_2' + * Create request for operation 'getQualityRatings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getQualityRatings_2Request($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_2'][0]) + public function getQualityRatingsRequest($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getQualityRatings_2' + 'Missing the required parameter $business_id when calling getQualityRatings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getQualityRatings_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getQualityRatings, must be bigger than or equal to 1.'); } // verify the required parameter 'get_quality_rating_request' is set if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings_2' + 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings' ); } - $resourcePath = '/businesses/{businessId}/ratings/quality'; + $resourcePath = '/v2/businesses/{businessId}/ratings/quality'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45845,38 +34634,36 @@ class DbsApi } /** - * Operation getReportInfo_1 + * Operation getRegionsCodes * - * Получение заданного отчета + * Список допустимых кодов стран * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReportInfo_1($report_id, string $contentType = self::contentTypes['getReportInfo_1'][0]) + public function getRegionsCodes(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - list($response) = $this->getReportInfo_1WithHttpInfo($report_id, $contentType); + list($response) = $this->getRegionsCodesWithHttpInfo($contentType); return $response; } /** - * Operation getReportInfo_1WithHttpInfo + * Operation getRegionsCodesWithHttpInfo * - * Получение заданного отчета + * Список допустимых кодов стран * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReportInfo_1WithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_1'][0]) + public function getRegionsCodesWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - $request = $this->getReportInfo_1Request($report_id, $contentType); + $request = $this->getRegionsCodesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -45903,196 +34690,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReportInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReportInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReportInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -46106,52 +34742,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReportInfoResponse', + '\OpenAPI\Client\Model\GetRegionsCodesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46159,7 +34764,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46167,7 +34772,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46175,7 +34780,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46183,7 +34788,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46191,26 +34796,27 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReportInfo_1Async + * Operation getRegionsCodesAsync * - * Получение заданного отчета + * Список допустимых кодов стран * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_1Async($report_id, string $contentType = self::contentTypes['getReportInfo_1'][0]) + public function getRegionsCodesAsync(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - return $this->getReportInfo_1AsyncWithHttpInfo($report_id, $contentType) + return $this->getRegionsCodesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -46219,20 +34825,19 @@ class DbsApi } /** - * Operation getReportInfo_1AsyncWithHttpInfo + * Operation getRegionsCodesAsyncWithHttpInfo * - * Получение заданного отчета + * Список допустимых кодов стран * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_1AsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_1'][0]) + public function getRegionsCodesAsyncWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - $request = $this->getReportInfo_1Request($report_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsCodesResponse'; + $request = $this->getRegionsCodesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46271,26 +34876,18 @@ class DbsApi } /** - * Create request for operation 'getReportInfo_1' + * Create request for operation 'getRegionsCodes' * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReportInfo_1Request($report_id, string $contentType = self::contentTypes['getReportInfo_1'][0]) + public function getRegionsCodesRequest(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - // verify the required parameter 'report_id' is set - if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $report_id when calling getReportInfo_1' - ); - } - - $resourcePath = '/reports/info/{reportId}'; + $resourcePath = '/v2/regions/countries'; $formParams = []; $queryParams = []; $headerParams = []; @@ -46299,14 +34896,6 @@ class DbsApi - // path params - if ($report_id !== null) { - $resourcePath = str_replace( - '{' . 'reportId' . '}', - ObjectSerializer::toPathValue($report_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -46364,7 +34953,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -46372,42 +34961,38 @@ class DbsApi } /** - * Operation getReturnApplication_1 + * Operation getReportInfo * - * Получение заявления на возврат + * Получение заданного отчета или документа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_1'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnApplication_1($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_1'][0]) + public function getReportInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - list($response) = $this->getReturnApplication_1WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReportInfoWithHttpInfo($report_id, $contentType); return $response; } /** - * Operation getReturnApplication_1WithHttpInfo + * Operation getReportInfoWithHttpInfo * - * Получение заявления на возврат + * Получение заданного отчета или документа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_1'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnApplication_1WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_1'][0]) + public function getReportInfoWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - $request = $this->getReturnApplication_1Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReportInfoRequest($report_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -46434,196 +35019,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -46637,44 +35077,21 @@ class DbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GetReportInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46682,7 +35099,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46690,7 +35107,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46698,7 +35115,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46706,7 +35123,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46714,7 +35131,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46722,28 +35139,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnApplication_1Async + * Operation getReportInfoAsync * - * Получение заявления на возврат + * Получение заданного отчета или документа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_1'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnApplication_1Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_1'][0]) + public function getReportInfoAsync($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - return $this->getReturnApplication_1AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getReportInfoAsyncWithHttpInfo($report_id, $contentType) ->then( function ($response) { return $response[0]; @@ -46752,22 +35169,20 @@ class DbsApi } /** - * Operation getReturnApplication_1AsyncWithHttpInfo + * Operation getReportInfoAsyncWithHttpInfo * - * Получение заявления на возврат + * Получение заданного отчета или документа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_1'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnApplication_1AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_1'][0]) + public function getReportInfoAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - $returnType = '\SplFileObject'; - $request = $this->getReturnApplication_1Request($campaign_id, $order_id, $return_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; + $request = $this->getReportInfoRequest($report_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46806,45 +35221,32 @@ class DbsApi } /** - * Create request for operation 'getReturnApplication_1' + * Create request for operation 'getReportInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_1'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnApplication_1Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_1'][0]) + public function getReportInfoRequest($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnApplication_1' + 'Missing the required parameter $report_id when calling getReportInfo' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturnApplication_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnApplication_1' - ); + if (strlen($report_id) > 255) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling DbsApi.getReportInfo, must be smaller than or equal to 255.'); } - - // verify the required parameter 'return_id' is set - if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnApplication_1' - ); + if (strlen($report_id) < 1) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling DbsApi.getReportInfo, must be bigger than or equal to 1.'); } + - - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; + $resourcePath = '/v2/reports/info/{reportId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -46854,33 +35256,17 @@ class DbsApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($return_id !== null) { + if ($report_id !== null) { $resourcePath = str_replace( - '{' . 'returnId' . '}', - ObjectSerializer::toPathValue($return_id), + '{' . 'reportId' . '}', + ObjectSerializer::toPathValue($report_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream', 'application/json', ], + ['application/json', ], $contentType, $multipart ); @@ -46942,46 +35328,42 @@ class DbsApi } /** - * Operation getReturnPhoto_1 + * Operation getReturn * - * Получение фотографии возврата + * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnPhoto_1($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_1'][0]) + public function getReturn($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - list($response) = $this->getReturnPhoto_1WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + list($response) = $this->getReturnWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); return $response; } /** - * Operation getReturnPhoto_1WithHttpInfo + * Operation getReturnWithHttpInfo * - * Получение фотографии возврата + * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnPhoto_1WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_1'][0]) + public function getReturnWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - $request = $this->getReturnPhoto_1Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -47008,196 +35390,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47211,44 +35448,21 @@ class DbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GetReturnResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47256,7 +35470,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47264,7 +35478,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47272,7 +35486,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47280,7 +35494,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47288,7 +35502,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47296,30 +35510,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnPhoto_1Async + * Operation getReturnAsync * - * Получение фотографии возврата + * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_1Async($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_1'][0]) + public function getReturnAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - return $this->getReturnPhoto_1AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) + return $this->getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) ->then( function ($response) { return $response[0]; @@ -47328,24 +35542,22 @@ class DbsApi } /** - * Operation getReturnPhoto_1AsyncWithHttpInfo + * Operation getReturnAsyncWithHttpInfo * - * Получение фотографии возврата + * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_1AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_1'][0]) + public function getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - $returnType = '\SplFileObject'; - $request = $this->getReturnPhoto_1Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47384,61 +35596,45 @@ class DbsApi } /** - * Create request for operation 'getReturnPhoto_1' + * Create request for operation 'getReturn' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnPhoto_1Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_1'][0]) + public function getReturnRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnPhoto_1' + 'Missing the required parameter $campaign_id when calling getReturn' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturnPhoto_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturn, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnPhoto_1' + 'Missing the required parameter $order_id when calling getReturn' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnPhoto_1' - ); - } - - // verify the required parameter 'item_id' is set - if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $item_id when calling getReturnPhoto_1' - ); - } - - // verify the required parameter 'image_hash' is set - if ($image_hash === null || (is_array($image_hash) && count($image_hash) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $image_hash when calling getReturnPhoto_1' + 'Missing the required parameter $return_id when calling getReturn' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -47471,26 +35667,10 @@ class DbsApi $resourcePath ); } - // path params - if ($item_id !== null) { - $resourcePath = str_replace( - '{' . 'itemId' . '}', - ObjectSerializer::toPathValue($item_id), - $resourcePath - ); - } - // path params - if ($image_hash !== null) { - $resourcePath = str_replace( - '{' . 'imageHash' . '}', - ObjectSerializer::toPathValue($image_hash), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream', 'application/json', ], + ['application/json', ], $contentType, $multipart ); @@ -47552,42 +35732,42 @@ class DbsApi } /** - * Operation getReturn_1 + * Operation getReturnApplication * - * Информация о невыкупе или возврате + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturn_1($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_1'][0]) + public function getReturnApplication($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - list($response) = $this->getReturn_1WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); return $response; } /** - * Operation getReturn_1WithHttpInfo + * Operation getReturnApplicationWithHttpInfo * - * Информация о невыкупе или возврате + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturn_1WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_1'][0]) + public function getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - $request = $this->getReturn_1Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -47614,196 +35794,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47817,44 +35852,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47862,7 +35874,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47870,7 +35882,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47878,7 +35890,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47886,7 +35898,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47894,7 +35906,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47902,28 +35914,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturn_1Async + * Operation getReturnApplicationAsync * - * Информация о невыкупе или возврате + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_1Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_1'][0]) + public function getReturnApplicationAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - return $this->getReturn_1AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) ->then( function ($response) { return $response[0]; @@ -47932,22 +35946,22 @@ class DbsApi } /** - * Operation getReturn_1AsyncWithHttpInfo + * Operation getReturnApplicationAsyncWithHttpInfo * - * Информация о невыкупе или возврате + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_1AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_1'][0]) + public function getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - $request = $this->getReturn_1Request($campaign_id, $order_id, $return_id, $contentType); + $returnType = '\SplFileObject'; + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47986,45 +36000,45 @@ class DbsApi } /** - * Create request for operation 'getReturn_1' + * Create request for operation 'getReturnApplication' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturn_1Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_1'][0]) + public function getReturnApplicationRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturn_1' + 'Missing the required parameter $campaign_id when calling getReturnApplication' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturn_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturnApplication, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturn_1' + 'Missing the required parameter $order_id when calling getReturnApplication' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturn_1' + 'Missing the required parameter $return_id when calling getReturnApplication' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; $formParams = []; $queryParams = []; $headerParams = []; @@ -48060,7 +36074,7 @@ class DbsApi $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/octet-stream', 'application/json', ], $contentType, $multipart ); @@ -48122,56 +36136,46 @@ class DbsApi } /** - * Operation getReturns_1 + * Operation getReturnPhoto * - * Список невыкупов и возвратов + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturns_1($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_1'][0]) + public function getReturnPhoto($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - list($response) = $this->getReturns_1WithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + list($response) = $this->getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); return $response; } /** - * Operation getReturns_1WithHttpInfo + * Operation getReturnPhotoWithHttpInfo * - * Список невыкупов и возвратов + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturns_1WithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_1'][0]) + public function getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - $request = $this->getReturns_1Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); try { $options = $this->createHttpClientOption(); @@ -48198,196 +36202,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48401,44 +36260,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnsResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48446,7 +36282,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48454,7 +36290,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48462,7 +36298,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48470,7 +36306,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48478,7 +36314,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48486,35 +36322,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturns_1Async + * Operation getReturnPhotoAsync * - * Список невыкупов и возвратов + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturns_1Async($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_1'][0]) + public function getReturnPhotoAsync($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - return $this->getReturns_1AsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + return $this->getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) ->then( function ($response) { return $response[0]; @@ -48523,29 +36356,24 @@ class DbsApi } /** - * Operation getReturns_1AsyncWithHttpInfo + * Operation getReturnPhotoAsyncWithHttpInfo * - * Список невыкупов и возвратов + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturns_1AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_1'][0]) + public function getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - $request = $this->getReturns_1Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $returnType = '\SplFileObject'; + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48584,137 +36412,67 @@ class DbsApi } /** - * Create request for operation 'getReturns_1' + * Create request for operation 'getReturnPhoto' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturns_1Request($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_1'][0]) + public function getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturns_1' + 'Missing the required parameter $campaign_id when calling getReturnPhoto' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturns_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturnPhoto, must be bigger than or equal to 1.'); } - - - if ($order_ids !== null && count($order_ids) > 50) { - throw new \InvalidArgumentException('invalid value for "$order_ids" when calling DbsApi.getReturns_1, number of items must be less than or equal to 50.'); + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getReturnPhoto' + ); } - - - + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $return_id when calling getReturnPhoto' + ); + } + // verify the required parameter 'item_id' is set + if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $item_id when calling getReturnPhoto' + ); + } + // verify the required parameter 'image_hash' is set + if ($image_hash === null || (is_array($image_hash) && count($image_hash) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $image_hash when calling getReturnPhoto' + ); + } - $resourcePath = '/campaigns/{campaignId}/returns'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $statuses, - 'statuses', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $type, - 'type', // param base name - 'ReturnType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date2, - 'from_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date2, - 'to_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -48725,10 +36483,42 @@ class DbsApi $resourcePath ); } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), + $resourcePath + ); + } + // path params + if ($item_id !== null) { + $resourcePath = str_replace( + '{' . 'itemId' . '}', + ObjectSerializer::toPathValue($item_id), + $resourcePath + ); + } + // path params + if ($image_hash !== null) { + $resourcePath = str_replace( + '{' . 'imageHash' . '}', + ObjectSerializer::toPathValue($image_hash), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/octet-stream', 'application/json', ], $contentType, $multipart ); @@ -48790,44 +36580,58 @@ class DbsApi } /** - * Operation getStocks_2 + * Operation getReturns * - * Информация об остатках и оборачиваемости + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getStocks_2($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_2'][0]) + public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - list($response) = $this->getStocks_2WithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $response; } /** - * Operation getStocks_2WithHttpInfo + * Operation getReturnsWithHttpInfo * - * Информация об остатках и оборачиваемости + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getStocks_2WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_2'][0]) + public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $request = $this->getStocks_2Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); try { $options = $this->createHttpClientOption(); @@ -48854,169 +36658,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehouseStocksResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49030,44 +36716,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + '\OpenAPI\Client\Model\GetReturnsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49075,7 +36738,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49083,7 +36746,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49091,7 +36754,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49099,7 +36770,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49107,29 +36778,38 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getStocks_2Async + * Operation getReturnsAsync * - * Информация об остатках и оборачиваемости + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStocks_2Async($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_2'][0]) + public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - return $this->getStocks_2AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) + return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) ->then( function ($response) { return $response[0]; @@ -49138,23 +36818,30 @@ class DbsApi } /** - * Operation getStocks_2AsyncWithHttpInfo + * Operation getReturnsAsyncWithHttpInfo * - * Информация об остатках и оборачиваемости + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStocks_2AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_2'][0]) + public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - $request = $this->getStocks_2Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49193,35 +36880,55 @@ class DbsApi } /** - * Create request for operation 'getStocks_2' + * Create request for operation 'getReturns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getStocks_2Request($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_2'][0]) + public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getStocks_2' + 'Missing the required parameter $campaign_id when calling getReturns' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getStocks_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getReturns, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getReturns, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling DbsApi.getReturns, number of items must be less than or equal to 50.'); + } + + + - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + + + + $resourcePath = '/v2/campaigns/{campaignId}/returns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -49246,6 +36953,78 @@ class DbsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $statuses, + 'statuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shipment_statuses, + 'shipmentStatuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'ReturnType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date2, + 'from_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date2, + 'to_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -49265,14 +37044,7 @@ class DbsApi ); // for model (json/xml) - if (isset($get_warehouse_stocks_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); - } else { - $httpBody = $get_warehouse_stocks_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -49320,7 +37092,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -49328,42 +37100,44 @@ class DbsApi } /** - * Operation getSuggestedOfferMappingEntries_3 + * Operation getStocks * - * Рекомендованные карточки для товаров + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getSuggestedOfferMappingEntries_3($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_3'][0]) + public function getStocks($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - list($response) = $this->getSuggestedOfferMappingEntries_3WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + list($response) = $this->getStocksWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $response; } /** - * Operation getSuggestedOfferMappingEntries_3WithHttpInfo + * Operation getStocksWithHttpInfo * - * Рекомендованные карточки для товаров + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getSuggestedOfferMappingEntries_3WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_3'][0]) + public function getStocksWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - $request = $this->getSuggestedOfferMappingEntries_3Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -49390,196 +37164,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49593,44 +37216,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49638,7 +37238,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49646,7 +37246,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49654,15 +37254,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49670,7 +37262,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49678,28 +37270,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappingEntries_3Async + * Operation getStocksAsync * - * Рекомендованные карточки для товаров + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedOfferMappingEntries_3Async($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_3'][0]) + public function getStocksAsync($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - return $this->getSuggestedOfferMappingEntries_3AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) + return $this->getStocksAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -49708,22 +37303,23 @@ class DbsApi } /** - * Operation getSuggestedOfferMappingEntries_3AsyncWithHttpInfo + * Operation getStocksAsyncWithHttpInfo * - * Рекомендованные карточки для товаров + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedOfferMappingEntries_3AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_3'][0]) + public function getStocksAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - $request = $this->getSuggestedOfferMappingEntries_3Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49762,44 +37358,62 @@ class DbsApi } /** - * Create request for operation 'getSuggestedOfferMappingEntries_3' + * Create request for operation 'getStocks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getSuggestedOfferMappingEntries_3Request($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_3'][0]) + public function getStocksRequest($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries_3' + 'Missing the required parameter $campaign_id when calling getStocks' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getSuggestedOfferMappingEntries_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getStocks, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set - if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries_3' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.getStocks, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -49819,12 +37433,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_suggested_offer_mapping_entries_request)) { + if (isset($get_warehouse_stocks_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mapping_entries_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); } else { - $httpBody = $get_suggested_offer_mapping_entries_request; + $httpBody = $get_warehouse_stocks_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -49882,40 +37496,42 @@ class DbsApi } /** - * Operation getSuggestedOfferMappings_0 + * Operation getSuggestedOfferMappingEntries * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Рекомендованные карточки для товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getSuggestedOfferMappings_0($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_0'][0]) + public function getSuggestedOfferMappingEntries($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - list($response) = $this->getSuggestedOfferMappings_0WithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); + list($response) = $this->getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $response; } /** - * Operation getSuggestedOfferMappings_0WithHttpInfo + * Operation getSuggestedOfferMappingEntriesWithHttpInfo * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Рекомендованные карточки для товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getSuggestedOfferMappings_0WithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_0'][0]) + public function getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $request = $this->getSuggestedOfferMappings_0Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -49942,196 +37558,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50145,44 +37616,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50190,7 +37638,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50198,7 +37646,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50206,7 +37654,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50214,7 +37662,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50222,7 +37670,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50230,27 +37678,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappings_0Async + * Operation getSuggestedOfferMappingEntriesAsync * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Рекомендованные карточки для товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getSuggestedOfferMappings_0Async($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_0'][0]) + public function getSuggestedOfferMappingEntriesAsync($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - return $this->getSuggestedOfferMappings_0AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) + return $this->getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) ->then( function ($response) { return $response[0]; @@ -50259,21 +37710,22 @@ class DbsApi } /** - * Operation getSuggestedOfferMappings_0AsyncWithHttpInfo + * Operation getSuggestedOfferMappingEntriesAsyncWithHttpInfo * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Рекомендованные карточки для товаров * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getSuggestedOfferMappings_0AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_0'][0]) + public function getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - $request = $this->getSuggestedOfferMappings_0Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -50312,31 +37764,38 @@ class DbsApi } /** - * Create request for operation 'getSuggestedOfferMappings_0' + * Create request for operation 'getSuggestedOfferMappingEntries' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getSuggestedOfferMappings_0Request($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_0'][0]) + public function getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getSuggestedOfferMappings_0' + 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getSuggestedOfferMappings_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getSuggestedOfferMappingEntries, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set + if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries' + ); + } - $resourcePath = '/businesses/{businessId}/offer-mappings/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50346,10 +37805,10 @@ class DbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -50362,12 +37821,12 @@ class DbsApi ); // for model (json/xml) - if (isset($get_suggested_offer_mappings_request)) { + if (isset($get_suggested_offer_mapping_entries_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mappings_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mapping_entries_request)); } else { - $httpBody = $get_suggested_offer_mappings_request; + $httpBody = $get_suggested_offer_mapping_entries_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -50425,42 +37884,42 @@ class DbsApi } /** - * Operation getSuggestedPrices_3 + * Operation getSuggestedOfferMappings * - * Цены для продвижения товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getSuggestedPrices_3($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_3'][0]) + public function getSuggestedOfferMappings($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - list($response) = $this->getSuggestedPrices_3WithHttpInfo($campaign_id, $suggest_prices_request, $contentType); + list($response) = $this->getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); return $response; } /** - * Operation getSuggestedPrices_3WithHttpInfo + * Operation getSuggestedOfferMappingsWithHttpInfo * - * Цены для продвижения товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getSuggestedPrices_3WithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_3'][0]) + public function getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $request = $this->getSuggestedPrices_3Request($campaign_id, $suggest_prices_request, $contentType); + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -50487,196 +37946,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SuggestPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SuggestPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuggestPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50690,44 +38004,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SuggestPricesResponse', + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50735,7 +38026,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50743,7 +38034,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50751,7 +38042,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50759,7 +38050,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50767,7 +38058,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50775,28 +38066,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedPrices_3Async + * Operation getSuggestedOfferMappingsAsync * - * Цены для продвижения товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedPrices_3Async($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_3'][0]) + public function getSuggestedOfferMappingsAsync($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - return $this->getSuggestedPrices_3AsyncWithHttpInfo($campaign_id, $suggest_prices_request, $contentType) + return $this->getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -50805,22 +38098,22 @@ class DbsApi } /** - * Operation getSuggestedPrices_3AsyncWithHttpInfo + * Operation getSuggestedOfferMappingsAsyncWithHttpInfo * - * Цены для продвижения товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedPrices_3AsyncWithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_3'][0]) + public function getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - $request = $this->getSuggestedPrices_3Request($campaign_id, $suggest_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -50859,38 +38152,32 @@ class DbsApi } /** - * Create request for operation 'getSuggestedPrices_3' + * Create request for operation 'getSuggestedOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getSuggestedPrices_3Request($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_3'][0]) + public function getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedPrices_3' + 'Missing the required parameter $business_id when calling getSuggestedOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.getSuggestedPrices_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getSuggestedOfferMappings, must be bigger than or equal to 1.'); } - // verify the required parameter 'suggest_prices_request' is set - if ($suggest_prices_request === null || (is_array($suggest_prices_request) && count($suggest_prices_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $suggest_prices_request when calling getSuggestedPrices_3' - ); - } - $resourcePath = '/campaigns/{campaignId}/offer-prices/suggestions'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50900,10 +38187,10 @@ class DbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -50916,12 +38203,12 @@ class DbsApi ); // for model (json/xml) - if (isset($suggest_prices_request)) { + if (isset($get_suggested_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($suggest_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mappings_request)); } else { - $httpBody = $suggest_prices_request; + $httpBody = $get_suggested_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -50979,38 +38266,40 @@ class DbsApi } /** - * Operation getWarehouses_1 + * Operation getWarehouses * * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getWarehouses_1($business_id, string $contentType = self::contentTypes['getWarehouses_1'][0]) + public function getWarehouses($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - list($response) = $this->getWarehouses_1WithHttpInfo($business_id, $contentType); + list($response) = $this->getWarehousesWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getWarehouses_1WithHttpInfo + * Operation getWarehousesWithHttpInfo * * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getWarehouses_1WithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses_1'][0]) + public function getWarehousesWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - $request = $this->getWarehouses_1Request($business_id, $contentType); + $request = $this->getWarehousesRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -51037,196 +38326,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehousesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehousesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehousesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -51240,34 +38384,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -51277,7 +38398,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51285,7 +38406,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51293,7 +38414,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51301,7 +38422,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51309,7 +38430,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51317,7 +38438,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51325,26 +38446,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getWarehouses_1Async + * Operation getWarehousesAsync * * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getWarehouses_1Async($business_id, string $contentType = self::contentTypes['getWarehouses_1'][0]) + public function getWarehousesAsync($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - return $this->getWarehouses_1AsyncWithHttpInfo($business_id, $contentType) + return $this->getWarehousesAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -51353,20 +38477,21 @@ class DbsApi } /** - * Operation getWarehouses_1AsyncWithHttpInfo + * Operation getWarehousesAsyncWithHttpInfo * * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getWarehouses_1AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses_1'][0]) + public function getWarehousesAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - $request = $this->getWarehouses_1Request($business_id, $contentType); + $request = $this->getWarehousesRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51405,29 +38530,30 @@ class DbsApi } /** - * Create request for operation 'getWarehouses_1' + * Create request for operation 'getWarehouses' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getWarehouses_1Request($business_id, string $contentType = self::contentTypes['getWarehouses_1'][0]) + public function getWarehousesRequest($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getWarehouses_1' + 'Missing the required parameter $business_id when calling getWarehouses' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getWarehouses_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.getWarehouses, must be bigger than or equal to 1.'); } - $resourcePath = '/businesses/{businessId}/warehouses'; + $resourcePath = '/v2/businesses/{businessId}/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -51509,42 +38635,42 @@ class DbsApi } /** - * Operation provideOrderDigitalCodes_0 + * Operation provideOrderDigitalCodes * * Передача ключей цифровых товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function provideOrderDigitalCodes_0($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes_0'][0]) + public function provideOrderDigitalCodes($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) { - list($response) = $this->provideOrderDigitalCodes_0WithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + list($response) = $this->provideOrderDigitalCodesWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); return $response; } /** - * Operation provideOrderDigitalCodes_0WithHttpInfo + * Operation provideOrderDigitalCodesWithHttpInfo * * Передача ключей цифровых товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function provideOrderDigitalCodes_0WithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes_0'][0]) + public function provideOrderDigitalCodesWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) { - $request = $this->provideOrderDigitalCodes_0Request($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + $request = $this->provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -51571,196 +38697,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -51774,34 +38755,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -51811,7 +38769,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51819,7 +38777,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51827,7 +38785,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51835,7 +38793,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51843,7 +38801,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51851,7 +38809,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51859,28 +38817,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation provideOrderDigitalCodes_0Async + * Operation provideOrderDigitalCodesAsync * * Передача ключей цифровых товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderDigitalCodes_0Async($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes_0'][0]) + public function provideOrderDigitalCodesAsync($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) { - return $this->provideOrderDigitalCodes_0AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType) + return $this->provideOrderDigitalCodesAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -51889,22 +38849,22 @@ class DbsApi } /** - * Operation provideOrderDigitalCodes_0AsyncWithHttpInfo + * Operation provideOrderDigitalCodesAsyncWithHttpInfo * * Передача ключей цифровых товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderDigitalCodes_0AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes_0'][0]) + public function provideOrderDigitalCodesAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->provideOrderDigitalCodes_0Request($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + $request = $this->provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51943,45 +38903,45 @@ class DbsApi } /** - * Create request for operation 'provideOrderDigitalCodes_0' + * Create request for operation 'provideOrderDigitalCodes' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function provideOrderDigitalCodes_0Request($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes_0'][0]) + public function provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling provideOrderDigitalCodes_0' + 'Missing the required parameter $campaign_id when calling provideOrderDigitalCodes' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.provideOrderDigitalCodes_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.provideOrderDigitalCodes, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling provideOrderDigitalCodes_0' + 'Missing the required parameter $order_id when calling provideOrderDigitalCodes' ); } // verify the required parameter 'provide_order_digital_codes_request' is set if ($provide_order_digital_codes_request === null || (is_array($provide_order_digital_codes_request) && count($provide_order_digital_codes_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $provide_order_digital_codes_request when calling provideOrderDigitalCodes_0' + 'Missing the required parameter $provide_order_digital_codes_request when calling provideOrderDigitalCodes' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/deliverDigitalGoods'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/deliverDigitalGoods'; $formParams = []; $queryParams = []; $headerParams = []; @@ -52078,42 +39038,42 @@ class DbsApi } /** - * Operation provideOrderItemIdentifiers_1 + * Operation provideOrderItemIdentifiers * * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function provideOrderItemIdentifiers_1($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_1'][0]) + public function provideOrderItemIdentifiers($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - list($response) = $this->provideOrderItemIdentifiers_1WithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + list($response) = $this->provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $response; } /** - * Operation provideOrderItemIdentifiers_1WithHttpInfo + * Operation provideOrderItemIdentifiersWithHttpInfo * * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function provideOrderItemIdentifiers_1WithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_1'][0]) + public function provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $request = $this->provideOrderItemIdentifiers_1Request($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -52140,196 +39100,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52343,34 +39158,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -52380,7 +39172,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52388,7 +39180,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52396,7 +39188,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52404,7 +39196,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52412,7 +39204,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52420,7 +39212,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52428,28 +39220,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation provideOrderItemIdentifiers_1Async + * Operation provideOrderItemIdentifiersAsync * * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiers_1Async($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_1'][0]) + public function provideOrderItemIdentifiersAsync($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - return $this->provideOrderItemIdentifiers_1AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) + return $this->provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -52458,22 +39252,22 @@ class DbsApi } /** - * Operation provideOrderItemIdentifiers_1AsyncWithHttpInfo + * Operation provideOrderItemIdentifiersAsyncWithHttpInfo * * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiers_1AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_1'][0]) + public function provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - $request = $this->provideOrderItemIdentifiers_1Request($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -52512,45 +39306,45 @@ class DbsApi } /** - * Create request for operation 'provideOrderItemIdentifiers_1' + * Create request for operation 'provideOrderItemIdentifiers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function provideOrderItemIdentifiers_1Request($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_1'][0]) + public function provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers_1' + 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.provideOrderItemIdentifiers_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.provideOrderItemIdentifiers, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers_1' + 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers' ); } // verify the required parameter 'provide_order_item_identifiers_request' is set if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers_1' + 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/identifiers'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -52647,40 +39441,40 @@ class DbsApi } /** - * Operation putBidsForBusiness_0 + * Operation putBidsForBusiness * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForBusiness_0($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_0'][0]) + public function putBidsForBusiness($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - list($response) = $this->putBidsForBusiness_0WithHttpInfo($business_id, $put_sku_bids_request, $contentType); + list($response) = $this->putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation putBidsForBusiness_0WithHttpInfo + * Operation putBidsForBusinessWithHttpInfo * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForBusiness_0WithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_0'][0]) + public function putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - $request = $this->putBidsForBusiness_0Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -52707,196 +39501,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52910,34 +39559,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -52947,7 +39573,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52955,7 +39581,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52963,7 +39589,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52971,7 +39597,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52979,7 +39605,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52987,7 +39613,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52995,27 +39621,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForBusiness_0Async + * Operation putBidsForBusinessAsync * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_0Async($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_0'][0]) + public function putBidsForBusinessAsync($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - return $this->putBidsForBusiness_0AsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) + return $this->putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -53024,21 +39652,21 @@ class DbsApi } /** - * Operation putBidsForBusiness_0AsyncWithHttpInfo + * Operation putBidsForBusinessAsyncWithHttpInfo * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_0AsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_0'][0]) + public function putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForBusiness_0Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -53077,37 +39705,37 @@ class DbsApi } /** - * Create request for operation 'putBidsForBusiness_0' + * Create request for operation 'putBidsForBusiness' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForBusiness_0Request($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_0'][0]) + public function putBidsForBusinessRequest($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling putBidsForBusiness_0' + 'Missing the required parameter $business_id when calling putBidsForBusiness' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.putBidsForBusiness_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.putBidsForBusiness, must be bigger than or equal to 1.'); } // verify the required parameter 'put_sku_bids_request' is set if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness_0' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness' ); } - $resourcePath = '/businesses/{businessId}/bids'; + $resourcePath = '/v2/businesses/{businessId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -53196,40 +39824,40 @@ class DbsApi } /** - * Operation putBidsForCampaign_0 + * Operation putBidsForCampaign * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForCampaign_0($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_0'][0]) + public function putBidsForCampaign($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - list($response) = $this->putBidsForCampaign_0WithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); + list($response) = $this->putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation putBidsForCampaign_0WithHttpInfo + * Operation putBidsForCampaignWithHttpInfo * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForCampaign_0WithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_0'][0]) + public function putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - $request = $this->putBidsForCampaign_0Request($campaign_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -53256,196 +39884,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -53459,34 +39942,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -53496,7 +39956,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53504,7 +39964,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53512,7 +39972,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53520,7 +39980,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53528,7 +39988,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53536,7 +39996,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53544,27 +40004,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForCampaign_0Async + * Operation putBidsForCampaignAsync * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_0Async($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_0'][0]) + public function putBidsForCampaignAsync($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - return $this->putBidsForCampaign_0AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) + return $this->putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -53573,21 +40035,21 @@ class DbsApi } /** - * Operation putBidsForCampaign_0AsyncWithHttpInfo + * Operation putBidsForCampaignAsyncWithHttpInfo * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_0AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_0'][0]) + public function putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForCampaign_0Request($campaign_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -53626,37 +40088,37 @@ class DbsApi } /** - * Create request for operation 'putBidsForCampaign_0' + * Create request for operation 'putBidsForCampaign' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForCampaign_0Request($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_0'][0]) + public function putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling putBidsForCampaign_0' + 'Missing the required parameter $campaign_id when calling putBidsForCampaign' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.putBidsForCampaign_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.putBidsForCampaign, must be bigger than or equal to 1.'); } // verify the required parameter 'put_sku_bids_request' is set if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign_0' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign' ); } - $resourcePath = '/campaigns/{campaignId}/bids'; + $resourcePath = '/v2/campaigns/{campaignId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -53745,42 +40207,42 @@ class DbsApi } /** - * Operation refreshFeed_0 + * Operation searchRegionChildren * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function refreshFeed_0($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_0'][0]) + public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - list($response) = $this->refreshFeed_0WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); return $response; } /** - * Operation refreshFeed_0WithHttpInfo + * Operation searchRegionChildrenWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function refreshFeed_0WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_0'][0]) + public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $request = $this->refreshFeed_0Request($campaign_id, $feed_id, $contentType); + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -53807,196 +40269,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -54010,44 +40327,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54055,7 +40349,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54063,7 +40357,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54071,7 +40365,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54079,7 +40373,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54087,7 +40381,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54095,28 +40389,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation refreshFeed_0Async + * Operation searchRegionChildrenAsync * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_0Async($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_0'][0]) + public function searchRegionChildrenAsync($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - return $this->refreshFeed_0AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->searchRegionChildrenAsyncWithHttpInfo($region_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -54125,22 +40421,22 @@ class DbsApi } /** - * Operation refreshFeed_0AsyncWithHttpInfo + * Operation searchRegionChildrenAsyncWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_0AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_0'][0]) + public function searchRegionChildrenAsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->refreshFeed_0Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -54179,59 +40475,64 @@ class DbsApi } /** - * Create request for operation 'refreshFeed_0' + * Create request for operation 'searchRegionChildren' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function refreshFeed_0Request($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_0'][0]) + public function searchRegionChildrenRequest($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling refreshFeed_0' + 'Missing the required parameter $region_id when calling searchRegionChildren' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.refreshFeed_0, must be bigger than or equal to 1.'); + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.searchRegionChildren, must be smaller than or equal to 10000.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling refreshFeed_0' - ); - } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/refresh'; + $resourcePath = '/v2/regions/{regionId}/children'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($feed_id !== null) { + if ($region_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), $resourcePath ); } @@ -54292,7 +40593,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -54300,46 +40601,38 @@ class DbsApi } /** - * Operation searchModels_0 + * Operation searchRegionsById * - * Поиск модели товара + * Информация о регионе * - * @param string $query Поисковый запрос по названию модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchModels_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SearchModelsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchModels_0($query, $region_id, $currency = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchModels_0'][0]) + public function searchRegionsById($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - list($response) = $this->searchModels_0WithHttpInfo($query, $region_id, $currency, $page, $page_size, $contentType); + list($response) = $this->searchRegionsByIdWithHttpInfo($region_id, $contentType); return $response; } /** - * Operation searchModels_0WithHttpInfo + * Operation searchRegionsByIdWithHttpInfo * - * Поиск модели товара + * Информация о регионе * - * @param string $query Поисковый запрос по названию модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchModels_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SearchModelsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchModels_0WithHttpInfo($query, $region_id, $currency = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchModels_0'][0]) + public function searchRegionsByIdWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $request = $this->searchModels_0Request($query, $region_id, $currency, $page, $page_size, $contentType); + $request = $this->searchRegionsByIdRequest($region_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -54366,196 +40659,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SearchModelsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SearchModelsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SearchModelsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -54569,52 +40711,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\SearchModelsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SearchModelsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54622,7 +40733,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54630,7 +40741,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54638,7 +40749,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54646,7 +40757,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54654,30 +40765,28 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchModels_0Async + * Operation searchRegionsByIdAsync * - * Поиск модели товара + * Информация о регионе * - * @param string $query Поисковый запрос по названию модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchModels_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchModels_0Async($query, $region_id, $currency = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchModels_0'][0]) + public function searchRegionsByIdAsync($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - return $this->searchModels_0AsyncWithHttpInfo($query, $region_id, $currency, $page, $page_size, $contentType) + return $this->searchRegionsByIdAsyncWithHttpInfo($region_id, $contentType) ->then( function ($response) { return $response[0]; @@ -54686,24 +40795,20 @@ class DbsApi } /** - * Operation searchModels_0AsyncWithHttpInfo + * Operation searchRegionsByIdAsyncWithHttpInfo * - * Поиск модели товара + * Информация о регионе * - * @param string $query Поисковый запрос по названию модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchModels_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchModels_0AsyncWithHttpInfo($query, $region_id, $currency = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchModels_0'][0]) + public function searchRegionsByIdAsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $returnType = '\OpenAPI\Client\Model\SearchModelsResponse'; - $request = $this->searchModels_0Request($query, $region_id, $currency, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByIdRequest($region_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -54742,96 +40847,42 @@ class DbsApi } /** - * Create request for operation 'searchModels_0' + * Create request for operation 'searchRegionsById' * - * @param string $query Поисковый запрос по названию модели товара. (required) - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой отображаются цены предложений на страницах с результатами поиска. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. Значение по умолчанию: используется национальная валюта магазина (национальная валюта страны происхождения магазина). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchModels_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchModels_0Request($query, $region_id, $currency = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchModels_0'][0]) + public function searchRegionsByIdRequest($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - // verify the required parameter 'query' is set - if ($query === null || (is_array($query) && count($query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $query when calling searchModels_0' - ); - } - // verify the required parameter 'region_id' is set if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchModels_0' + 'Missing the required parameter $region_id when calling searchRegionsById' ); } - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.searchModels_0, must be smaller than or equal to 10000.'); - } - - - - $resourcePath = '/models'; + $resourcePath = '/v2/regions/{regionId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name - 'string', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $region_id, - 'regionId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($region_id !== null) { + $resourcePath = str_replace( + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -54897,42 +40948,42 @@ class DbsApi } /** - * Operation searchRegionChildren_2 + * Operation searchRegionsByName * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionChildren_2($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_2'][0]) + public function searchRegionsByName($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - list($response) = $this->searchRegionChildren_2WithHttpInfo($region_id, $page, $page_size, $contentType); + list($response) = $this->searchRegionsByNameWithHttpInfo($name, $page_token, $limit, $contentType); return $response; } /** - * Operation searchRegionChildren_2WithHttpInfo + * Operation searchRegionsByNameWithHttpInfo * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionChildren_2WithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_2'][0]) + public function searchRegionsByNameWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $request = $this->searchRegionChildren_2Request($region_id, $page, $page_size, $contentType); + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -54959,196 +41010,39 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -55162,52 +41056,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55215,7 +41078,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55223,15 +41086,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55239,7 +41094,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55247,28 +41102,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionChildren_2Async + * Operation searchRegionsByNameAsync * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_2Async($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_2'][0]) + public function searchRegionsByNameAsync($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - return $this->searchRegionChildren_2AsyncWithHttpInfo($region_id, $page, $page_size, $contentType) + return $this->searchRegionsByNameAsyncWithHttpInfo($name, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -55277,22 +41134,22 @@ class DbsApi } /** - * Operation searchRegionChildren_2AsyncWithHttpInfo + * Operation searchRegionsByNameAsyncWithHttpInfo * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_2AsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_2'][0]) + public function searchRegionsByNameAsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - $request = $this->searchRegionChildren_2Request($region_id, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -55331,33 +41188,33 @@ class DbsApi } /** - * Create request for operation 'searchRegionChildren_2' + * Create request for operation 'searchRegionsByName' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionChildren_2Request($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_2'][0]) + public function searchRegionsByNameRequest($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionChildren_2' + 'Missing the required parameter $name when calling searchRegionsByName' ); } - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling DbsApi.searchRegionChildren_2, must be smaller than or equal to 10000.'); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DbsApi.searchRegionsByName, must be bigger than or equal to 1.'); } - - $resourcePath = '/regions/{regionId}/children'; + $resourcePath = '/v2/regions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -55366,17 +41223,26 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $name, + 'name', // param base name + 'string', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -55384,14 +41250,6 @@ class DbsApi ) ?? []); - // path params - if ($region_id !== null) { - $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -55457,38 +41315,42 @@ class DbsApi } /** - * Operation searchRegionsById_2 + * Operation sendFileToChat * - * Информация о регионе + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsById_2($region_id, string $contentType = self::contentTypes['searchRegionsById_2'][0]) + public function sendFileToChat($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - list($response) = $this->searchRegionsById_2WithHttpInfo($region_id, $contentType); + list($response) = $this->sendFileToChatWithHttpInfo($business_id, $chat_id, $file, $contentType); return $response; } /** - * Operation searchRegionsById_2WithHttpInfo + * Operation sendFileToChatWithHttpInfo * - * Информация о регионе + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsById_2WithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_2'][0]) + public function sendFileToChatWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $request = $this->searchRegionsById_2Request($region_id, $contentType); + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); try { $options = $this->createHttpClientOption(); @@ -55515,169 +41377,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -55691,44 +41435,29 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55736,7 +41465,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55744,7 +41473,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55752,7 +41481,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55760,7 +41489,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55768,26 +41497,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsById_2Async + * Operation sendFileToChatAsync * - * Информация о регионе + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_2Async($region_id, string $contentType = self::contentTypes['searchRegionsById_2'][0]) + public function sendFileToChatAsync($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - return $this->searchRegionsById_2AsyncWithHttpInfo($region_id, $contentType) + return $this->sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) ->then( function ($response) { return $response[0]; @@ -55796,20 +41529,22 @@ class DbsApi } /** - * Operation searchRegionsById_2AsyncWithHttpInfo + * Operation sendFileToChatAsyncWithHttpInfo * - * Информация о регионе + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_2AsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_2'][0]) + public function sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsById_2Request($region_id, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -55848,44 +41583,85 @@ class DbsApi } /** - * Create request for operation 'searchRegionsById_2' + * Create request for operation 'sendFileToChat' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsById_2Request($region_id, string $contentType = self::contentTypes['searchRegionsById_2'][0]) + public function sendFileToChatRequest($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling sendFileToChat' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionsById_2' + 'Missing the required parameter $chat_id when calling sendFileToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling sendFileToChat' ); } - $resourcePath = '/regions/{regionId}'; + $resourcePath = '/v2/businesses/{businessId}/chats/file/send'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); // path params - if ($region_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } + // form params + $formDataProcessor = new FormDataProcessor(); + $formData = $formDataProcessor->prepare([ + 'file' => $file, + ]); + + $formParams = $formDataProcessor->flatten($formData); + $multipart = $formDataProcessor->has_file; + + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -55941,7 +41717,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -55949,42 +41725,42 @@ class DbsApi } /** - * Operation searchRegionsByName_2 + * Operation sendMessageToChat * - * Поиск регионов по их имени + * Отправка сообщения в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsByName_2($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_2'][0]) + public function sendMessageToChat($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - list($response) = $this->searchRegionsByName_2WithHttpInfo($name, $page_token, $limit, $contentType); + list($response) = $this->sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $response; } /** - * Operation searchRegionsByName_2WithHttpInfo + * Operation sendMessageToChatWithHttpInfo * - * Поиск регионов по их имени + * Отправка сообщения в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsByName_2WithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_2'][0]) + public function sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $request = $this->searchRegionsByName_2Request($name, $page_token, $limit, $contentType); + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -56011,142 +41787,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -56160,44 +41845,29 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56205,7 +41875,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56213,7 +41883,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56221,7 +41899,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56229,28 +41907,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsByName_2Async + * Operation sendMessageToChatAsync * - * Поиск регионов по их имени + * Отправка сообщения в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_2Async($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_2'][0]) + public function sendMessageToChatAsync($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - return $this->searchRegionsByName_2AsyncWithHttpInfo($name, $page_token, $limit, $contentType) + return $this->sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -56259,22 +41939,22 @@ class DbsApi } /** - * Operation searchRegionsByName_2AsyncWithHttpInfo + * Operation sendMessageToChatAsyncWithHttpInfo * - * Поиск регионов по их имени + * Отправка сообщения в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_2AsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_2'][0]) + public function sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsByName_2Request($name, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -56313,30 +41993,48 @@ class DbsApi } /** - * Create request for operation 'searchRegionsByName_2' + * Create request for operation 'sendMessageToChat' * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsByName_2Request($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_2'][0]) + public function sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling searchRegionsByName_2' + 'Missing the required parameter $business_id when calling sendMessageToChat' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.sendMessageToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling sendMessageToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.sendMessageToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'send_message_to_chat_request' is set + if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat' ); } - - - $resourcePath = '/regions'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -56345,33 +42043,23 @@ class DbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $name, - 'name', // param base name - 'string', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -56381,7 +42069,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($send_message_to_chat_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + } else { + $httpBody = $send_message_to_chat_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -56429,7 +42124,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -56437,42 +42132,42 @@ class DbsApi } /** - * Operation sendFileToChat_0 + * Operation setOrderBoxLayout * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function sendFileToChat_0($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_0'][0]) + public function setOrderBoxLayout($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - list($response) = $this->sendFileToChat_0WithHttpInfo($business_id, $chat_id, $file, $contentType); + list($response) = $this->setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $response; } /** - * Operation sendFileToChat_0WithHttpInfo + * Operation setOrderBoxLayoutWithHttpInfo * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendFileToChat_0WithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_0'][0]) + public function setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $request = $this->sendFileToChat_0Request($business_id, $chat_id, $file, $contentType); + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -56499,196 +42194,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -56702,44 +42252,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56747,7 +42274,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56755,7 +42282,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56763,7 +42290,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56771,7 +42298,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56779,7 +42306,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56787,28 +42314,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendFileToChat_0Async + * Operation setOrderBoxLayoutAsync * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendFileToChat_0Async($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_0'][0]) + public function setOrderBoxLayoutAsync($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - return $this->sendFileToChat_0AsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) + return $this->setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) ->then( function ($response) { return $response[0]; @@ -56817,22 +42346,22 @@ class DbsApi } /** - * Operation sendFileToChat_0AsyncWithHttpInfo + * Operation setOrderBoxLayoutAsyncWithHttpInfo * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendFileToChat_0AsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_0'][0]) + public function setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendFileToChat_0Request($business_id, $chat_id, $file, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -56871,87 +42400,71 @@ class DbsApi } /** - * Create request for operation 'sendFileToChat_0' + * Create request for operation 'setOrderBoxLayout' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendFileToChat_0Request($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_0'][0]) + public function setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendFileToChat_0' + 'Missing the required parameter $campaign_id when calling setOrderBoxLayout' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.sendFileToChat_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderBoxLayout, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendFileToChat_0' + 'Missing the required parameter $order_id when calling setOrderBoxLayout' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.sendFileToChat_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'file' is set - if ($file === null || (is_array($file) && count($file) === 0)) { + + // verify the required parameter 'set_order_box_layout_request' is set + if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file when calling sendFileToChat_0' + 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout' ); } - $resourcePath = '/businesses/{businessId}/chats/file/send'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } - - // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = []; - $paramFiles = is_array($file) ? $file : [$file]; - foreach ($paramFiles as $paramFile) { - $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); } + $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -56959,7 +42472,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($set_order_box_layout_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + } else { + $httpBody = $set_order_box_layout_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -57007,7 +42527,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -57015,42 +42535,42 @@ class DbsApi } /** - * Operation sendMessageToChat_0 + * Operation setOrderDeliveryDate * - * Отправка сообщения в чат + * Изменение даты доставки заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request set_order_delivery_date_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function sendMessageToChat_0($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_0'][0]) + public function setOrderDeliveryDate($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate'][0]) { - list($response) = $this->sendMessageToChat_0WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); + list($response) = $this->setOrderDeliveryDateWithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, $contentType); return $response; } /** - * Operation sendMessageToChat_0WithHttpInfo + * Operation setOrderDeliveryDateWithHttpInfo * - * Отправка сообщения в чат + * Изменение даты доставки заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendMessageToChat_0WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_0'][0]) + public function setOrderDeliveryDateWithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate'][0]) { - $request = $this->sendMessageToChat_0Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->setOrderDeliveryDateRequest($campaign_id, $order_id, $set_order_delivery_date_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -57077,196 +42597,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -57280,34 +42655,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -57317,7 +42669,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57325,7 +42677,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57333,7 +42685,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57341,7 +42693,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57349,7 +42701,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57357,7 +42709,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57365,28 +42717,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendMessageToChat_0Async + * Operation setOrderDeliveryDateAsync * - * Отправка сообщения в чат + * Изменение даты доставки заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMessageToChat_0Async($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_0'][0]) + public function setOrderDeliveryDateAsync($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate'][0]) { - return $this->sendMessageToChat_0AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) + return $this->setOrderDeliveryDateAsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, $contentType) ->then( function ($response) { return $response[0]; @@ -57395,22 +42749,22 @@ class DbsApi } /** - * Operation sendMessageToChat_0AsyncWithHttpInfo + * Operation setOrderDeliveryDateAsyncWithHttpInfo * - * Отправка сообщения в чат + * Изменение даты доставки заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMessageToChat_0AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_0'][0]) + public function setOrderDeliveryDateAsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendMessageToChat_0Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->setOrderDeliveryDateRequest($campaign_id, $order_id, $set_order_delivery_date_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -57449,70 +42803,66 @@ class DbsApi } /** - * Create request for operation 'sendMessageToChat_0' + * Create request for operation 'setOrderDeliveryDate' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendMessageToChat_0Request($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_0'][0]) + public function setOrderDeliveryDateRequest($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendMessageToChat_0' + 'Missing the required parameter $campaign_id when calling setOrderDeliveryDate' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.sendMessageToChat_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderDeliveryDate, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendMessageToChat_0' + 'Missing the required parameter $order_id when calling setOrderDeliveryDate' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling DbsApi.sendMessageToChat_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'send_message_to_chat_request' is set - if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + + // verify the required parameter 'set_order_delivery_date_request' is set + if ($set_order_delivery_date_request === null || (is_array($set_order_delivery_date_request) && count($set_order_delivery_date_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat_0' + 'Missing the required parameter $set_order_delivery_date_request when calling setOrderDeliveryDate' ); } - $resourcePath = '/businesses/{businessId}/chats/message'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/date'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -57525,12 +42875,12 @@ class DbsApi ); // for model (json/xml) - if (isset($send_message_to_chat_request)) { + if (isset($set_order_delivery_date_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_delivery_date_request)); } else { - $httpBody = $send_message_to_chat_request; + $httpBody = $set_order_delivery_date_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -57580,7 +42930,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -57588,44 +42938,42 @@ class DbsApi } /** - * Operation setFeedParams_0 + * Operation setOrderDeliveryTrackCode * - * Изменение параметров прайс-листа + * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request set_order_delivery_track_code_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setFeedParams_0($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_0'][0]) + public function setOrderDeliveryTrackCode($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode'][0]) { - list($response) = $this->setFeedParams_0WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType); + list($response) = $this->setOrderDeliveryTrackCodeWithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType); return $response; } /** - * Operation setFeedParams_0WithHttpInfo + * Operation setOrderDeliveryTrackCodeWithHttpInfo * - * Изменение параметров прайс-листа + * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setFeedParams_0WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_0'][0]) + public function setOrderDeliveryTrackCodeWithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode'][0]) { - $request = $this->setFeedParams_0Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->setOrderDeliveryTrackCodeRequest($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -57652,223 +43000,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -57882,34 +43058,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -57919,7 +43072,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57927,7 +43080,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57935,7 +43088,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57943,7 +43096,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57951,7 +43104,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57959,15 +43112,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57975,29 +43120,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setFeedParams_0Async + * Operation setOrderDeliveryTrackCodeAsync * - * Изменение параметров прайс-листа + * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_0Async($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_0'][0]) + public function setOrderDeliveryTrackCodeAsync($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode'][0]) { - return $this->setFeedParams_0AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType) + return $this->setOrderDeliveryTrackCodeAsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType) ->then( function ($response) { return $response[0]; @@ -58006,23 +43152,22 @@ class DbsApi } /** - * Operation setFeedParams_0AsyncWithHttpInfo + * Operation setOrderDeliveryTrackCodeAsyncWithHttpInfo * - * Изменение параметров прайс-листа + * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_0AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_0'][0]) + public function setOrderDeliveryTrackCodeAsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setFeedParams_0Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->setOrderDeliveryTrackCodeRequest($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -58061,46 +43206,45 @@ class DbsApi } /** - * Create request for operation 'setFeedParams_0' + * Create request for operation 'setOrderDeliveryTrackCode' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function setFeedParams_0Request($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_0'][0]) + public function setOrderDeliveryTrackCodeRequest($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setFeedParams_0' + 'Missing the required parameter $campaign_id when calling setOrderDeliveryTrackCode' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setFeedParams_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderDeliveryTrackCode, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling setFeedParams_0' + 'Missing the required parameter $order_id when calling setOrderDeliveryTrackCode' ); } - // verify the required parameter 'set_feed_params_request' is set - if ($set_feed_params_request === null || (is_array($set_feed_params_request) && count($set_feed_params_request) === 0)) { + // verify the required parameter 'set_order_delivery_track_code_request' is set + if ($set_order_delivery_track_code_request === null || (is_array($set_order_delivery_track_code_request) && count($set_order_delivery_track_code_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_feed_params_request when calling setFeedParams_0' + 'Missing the required parameter $set_order_delivery_track_code_request when calling setOrderDeliveryTrackCode' ); } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/params'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/track'; $formParams = []; $queryParams = []; $headerParams = []; @@ -58118,10 +43262,10 @@ class DbsApi ); } // path params - if ($feed_id !== null) { + if ($order_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -58134,12 +43278,12 @@ class DbsApi ); // for model (json/xml) - if (isset($set_feed_params_request)) { + if (isset($set_order_delivery_track_code_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_feed_params_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_delivery_track_code_request)); } else { - $httpBody = $set_feed_params_request; + $httpBody = $set_order_delivery_track_code_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -58197,42 +43341,46 @@ class DbsApi } /** - * Operation setOrderBoxLayout_2 + * Operation setOrderShipmentBoxes * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_2'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function setOrderBoxLayout_2($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_2'][0]) + public function setOrderShipmentBoxes($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - list($response) = $this->setOrderBoxLayout_2WithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + list($response) = $this->setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $response; } /** - * Operation setOrderBoxLayout_2WithHttpInfo + * Operation setOrderShipmentBoxesWithHttpInfo * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_2'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function setOrderBoxLayout_2WithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_2'][0]) + public function setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $request = $this->setOrderBoxLayout_2Request($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -58259,196 +43407,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -58462,44 +43465,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58507,7 +43487,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58515,7 +43495,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58523,7 +43503,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58531,7 +43511,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58539,7 +43519,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58547,28 +43527,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderBoxLayout_2Async + * Operation setOrderShipmentBoxesAsync * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_2'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function setOrderBoxLayout_2Async($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_2'][0]) + public function setOrderShipmentBoxesAsync($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - return $this->setOrderBoxLayout_2AsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) + return $this->setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -58577,22 +43561,24 @@ class DbsApi } /** - * Operation setOrderBoxLayout_2AsyncWithHttpInfo + * Operation setOrderShipmentBoxesAsyncWithHttpInfo * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_2'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function setOrderBoxLayout_2AsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_2'][0]) + public function setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - $request = $this->setOrderBoxLayout_2Request($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -58631,45 +43617,54 @@ class DbsApi } /** - * Create request for operation 'setOrderBoxLayout_2' + * Create request for operation 'setOrderShipmentBoxes' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_2'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function setOrderBoxLayout_2Request($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_2'][0]) + public function setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderBoxLayout_2' + 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderBoxLayout_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderShipmentBoxes, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderBoxLayout_2' + 'Missing the required parameter $order_id when calling setOrderShipmentBoxes' ); } - // verify the required parameter 'set_order_box_layout_request' is set - if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes' + ); + } + + // verify the required parameter 'set_order_shipment_boxes_request' is set + if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout_2' + 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/boxes'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -58694,6 +43689,14 @@ class DbsApi $resourcePath ); } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -58703,12 +43706,12 @@ class DbsApi ); // for model (json/xml) - if (isset($set_order_box_layout_request)) { + if (isset($set_order_shipment_boxes_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); } else { - $httpBody = $set_order_box_layout_request; + $httpBody = $set_order_shipment_boxes_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -58766,42 +43769,46 @@ class DbsApi } /** - * Operation setOrderDeliveryDate_0 + * Operation setReturnDecision * - * Изменение даты доставки заказа + * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request set_order_delivery_date_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request set_return_decision_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function setOrderDeliveryDate_0($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate_0'][0]) + public function setReturnDecision($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { - list($response) = $this->setOrderDeliveryDate_0WithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, $contentType); + list($response) = $this->setReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType); return $response; } /** - * Operation setOrderDeliveryDate_0WithHttpInfo + * Operation setReturnDecisionWithHttpInfo * - * Изменение даты доставки заказа + * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function setOrderDeliveryDate_0WithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate_0'][0]) + public function setReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { - $request = $this->setOrderDeliveryDate_0Request($campaign_id, $order_id, $set_order_delivery_date_request, $contentType); + $request = $this->setReturnDecisionRequest($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -58828,196 +43835,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -59031,34 +43893,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -59068,7 +43907,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59076,7 +43915,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59084,7 +43923,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59092,7 +43931,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59100,7 +43939,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59108,7 +43947,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59116,28 +43955,32 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderDeliveryDate_0Async + * Operation setReturnDecisionAsync * - * Изменение даты доставки заказа + * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function setOrderDeliveryDate_0Async($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate_0'][0]) + public function setReturnDecisionAsync($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { - return $this->setOrderDeliveryDate_0AsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, $contentType) + return $this->setReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType) ->then( function ($response) { return $response[0]; @@ -59146,22 +43989,24 @@ class DbsApi } /** - * Operation setOrderDeliveryDate_0AsyncWithHttpInfo + * Operation setReturnDecisionAsyncWithHttpInfo * - * Изменение даты доставки заказа + * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function setOrderDeliveryDate_0AsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate_0'][0]) + public function setReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setOrderDeliveryDate_0Request($campaign_id, $order_id, $set_order_delivery_date_request, $contentType); + $request = $this->setReturnDecisionRequest($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -59200,45 +44045,54 @@ class DbsApi } /** - * Create request for operation 'setOrderDeliveryDate_0' + * Create request for operation 'setReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function setOrderDeliveryDate_0Request($campaign_id, $order_id, $set_order_delivery_date_request, string $contentType = self::contentTypes['setOrderDeliveryDate_0'][0]) + public function setReturnDecisionRequest($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderDeliveryDate_0' + 'Missing the required parameter $campaign_id when calling setReturnDecision' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderDeliveryDate_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setReturnDecision, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderDeliveryDate_0' + 'Missing the required parameter $order_id when calling setReturnDecision' ); } - // verify the required parameter 'set_order_delivery_date_request' is set - if ($set_order_delivery_date_request === null || (is_array($set_order_delivery_date_request) && count($set_order_delivery_date_request) === 0)) { + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $return_id when calling setReturnDecision' + ); + } + + // verify the required parameter 'set_return_decision_request' is set + if ($set_return_decision_request === null || (is_array($set_return_decision_request) && count($set_return_decision_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_delivery_date_request when calling setOrderDeliveryDate_0' + 'Missing the required parameter $set_return_decision_request when calling setReturnDecision' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/date'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision'; $formParams = []; $queryParams = []; $headerParams = []; @@ -59263,6 +44117,14 @@ class DbsApi $resourcePath ); } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -59272,12 +44134,12 @@ class DbsApi ); // for model (json/xml) - if (isset($set_order_delivery_date_request)) { + if (isset($set_return_decision_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_delivery_date_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_return_decision_request)); } else { - $httpBody = $set_order_delivery_date_request; + $httpBody = $set_return_decision_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -59327,7 +44189,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -59335,42 +44197,40 @@ class DbsApi } /** - * Operation setOrderDeliveryTrackCode_0 + * Operation skipGoodsFeedbacksReaction * - * Передача трек‑номера посылки + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request set_order_delivery_track_code_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderDeliveryTrackCode_0($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode_0'][0]) + public function skipGoodsFeedbacksReaction($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - list($response) = $this->setOrderDeliveryTrackCode_0WithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType); + list($response) = $this->skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); return $response; } /** - * Operation setOrderDeliveryTrackCode_0WithHttpInfo + * Operation skipGoodsFeedbacksReactionWithHttpInfo * - * Передача трек‑номера посылки + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderDeliveryTrackCode_0WithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode_0'][0]) + public function skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - $request = $this->setOrderDeliveryTrackCode_0Request($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -59397,196 +44257,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -59600,34 +44315,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -59637,7 +44329,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59645,7 +44337,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59653,7 +44345,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59661,7 +44353,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59669,7 +44361,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59677,7 +44369,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59685,28 +44377,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderDeliveryTrackCode_0Async + * Operation skipGoodsFeedbacksReactionAsync * - * Передача трек‑номера посылки + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderDeliveryTrackCode_0Async($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode_0'][0]) + public function skipGoodsFeedbacksReactionAsync($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - return $this->setOrderDeliveryTrackCode_0AsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType) + return $this->skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) ->then( function ($response) { return $response[0]; @@ -59715,22 +44408,21 @@ class DbsApi } /** - * Operation setOrderDeliveryTrackCode_0AsyncWithHttpInfo + * Operation skipGoodsFeedbacksReactionAsyncWithHttpInfo * - * Передача трек‑номера посылки + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderDeliveryTrackCode_0AsyncWithHttpInfo($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode_0'][0]) + public function skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setOrderDeliveryTrackCode_0Request($campaign_id, $order_id, $set_order_delivery_track_code_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -59769,45 +44461,37 @@ class DbsApi } /** - * Create request for operation 'setOrderDeliveryTrackCode_0' + * Create request for operation 'skipGoodsFeedbacksReaction' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderDeliveryTrackCode_0Request($campaign_id, $order_id, $set_order_delivery_track_code_request, string $contentType = self::contentTypes['setOrderDeliveryTrackCode_0'][0]) + public function skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderDeliveryTrackCode_0' + 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderDeliveryTrackCode_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.skipGoodsFeedbacksReaction, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderDeliveryTrackCode_0' - ); - } - - // verify the required parameter 'set_order_delivery_track_code_request' is set - if ($set_order_delivery_track_code_request === null || (is_array($set_order_delivery_track_code_request) && count($set_order_delivery_track_code_request) === 0)) { + // verify the required parameter 'skip_goods_feedback_reaction_request' is set + if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_delivery_track_code_request when calling setOrderDeliveryTrackCode_0' + 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/track'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/skip-reaction'; $formParams = []; $queryParams = []; $headerParams = []; @@ -59817,18 +44501,10 @@ class DbsApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -59841,12 +44517,12 @@ class DbsApi ); // for model (json/xml) - if (isset($set_order_delivery_track_code_request)) { + if (isset($skip_goods_feedback_reaction_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_delivery_track_code_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); } else { - $httpBody = $set_order_delivery_track_code_request; + $httpBody = $skip_goods_feedback_reaction_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -59904,44 +44580,44 @@ class DbsApi } /** - * Operation setOrderShipmentBoxes_1 + * Operation submitReturnDecision * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderShipmentBoxes_1($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_1'][0]) + public function submitReturnDecision($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - list($response) = $this->setOrderShipmentBoxes_1WithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + list($response) = $this->submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $response; } /** - * Operation setOrderShipmentBoxes_1WithHttpInfo + * Operation submitReturnDecisionWithHttpInfo * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderShipmentBoxes_1WithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_1'][0]) + public function submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $request = $this->setOrderShipmentBoxes_1Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -59968,196 +44644,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -60171,44 +44702,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60216,7 +44724,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60224,7 +44732,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60232,7 +44740,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60240,7 +44748,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60248,7 +44756,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60256,29 +44764,31 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderShipmentBoxes_1Async + * Operation submitReturnDecisionAsync * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxes_1Async($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_1'][0]) + public function submitReturnDecisionAsync($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - return $this->setOrderShipmentBoxes_1AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) + return $this->submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType) ->then( function ($response) { return $response[0]; @@ -60287,23 +44797,23 @@ class DbsApi } /** - * Operation setOrderShipmentBoxes_1AsyncWithHttpInfo + * Operation submitReturnDecisionAsyncWithHttpInfo * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxes_1AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_1'][0]) + public function submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - $request = $this->setOrderShipmentBoxes_1Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -60342,53 +44852,47 @@ class DbsApi } /** - * Create request for operation 'setOrderShipmentBoxes_1' + * Create request for operation 'submitReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_1'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderShipmentBoxes_1Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_1'][0]) + public function submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes_1' + 'Missing the required parameter $campaign_id when calling submitReturnDecision' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setOrderShipmentBoxes_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.submitReturnDecision, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderShipmentBoxes_1' + 'Missing the required parameter $order_id when calling submitReturnDecision' ); } - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes_1' + 'Missing the required parameter $return_id when calling submitReturnDecision' ); } - // verify the required parameter 'set_order_shipment_boxes_request' is set - if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes_1' - ); - } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -60414,10 +44918,10 @@ class DbsApi ); } // path params - if ($shipment_id !== null) { + if ($return_id !== null) { $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), $resourcePath ); } @@ -60430,12 +44934,12 @@ class DbsApi ); // for model (json/xml) - if (isset($set_order_shipment_boxes_request)) { + if (isset($submit_return_decision_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($submit_return_decision_request)); } else { - $httpBody = $set_order_shipment_boxes_request; + $httpBody = $submit_return_decision_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -60485,7 +44989,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -60493,44 +44997,40 @@ class DbsApi } /** - * Operation setReturnDecision_0 + * Operation updateBusinessPrices * - * Принятие или изменение решения по возврату + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request set_return_decision_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setReturnDecision_0($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision_0'][0]) + public function updateBusinessPrices($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - list($response) = $this->setReturnDecision_0WithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType); + list($response) = $this->updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, $contentType); return $response; } /** - * Operation setReturnDecision_0WithHttpInfo + * Operation updateBusinessPricesWithHttpInfo * - * Принятие или изменение решения по возврату + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setReturnDecision_0WithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision_0'][0]) + public function updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - $request = $this->setReturnDecision_0Request($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -60557,196 +45057,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -60760,34 +45121,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -60797,7 +45135,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60805,7 +45143,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60813,7 +45151,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60821,7 +45159,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60829,7 +45167,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60837,7 +45175,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60845,29 +45191,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setReturnDecision_0Async + * Operation updateBusinessPricesAsync * - * Принятие или изменение решения по возврату + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setReturnDecision_0Async($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision_0'][0]) + public function updateBusinessPricesAsync($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - return $this->setReturnDecision_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType) + return $this->updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -60876,23 +45222,21 @@ class DbsApi } /** - * Operation setReturnDecision_0AsyncWithHttpInfo + * Operation updateBusinessPricesAsyncWithHttpInfo * - * Принятие или изменение решения по возврату + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setReturnDecision_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision_0'][0]) + public function updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setReturnDecision_0Request($campaign_id, $order_id, $return_id, $set_return_decision_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -60931,53 +45275,37 @@ class DbsApi } /** - * Create request for operation 'setReturnDecision_0' + * Create request for operation 'updateBusinessPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setReturnDecision_0Request($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision_0'][0]) + public function updateBusinessPricesRequest($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setReturnDecision_0' + 'Missing the required parameter $business_id when calling updateBusinessPrices' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.setReturnDecision_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateBusinessPrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setReturnDecision_0' - ); - } - - // verify the required parameter 'return_id' is set - if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling setReturnDecision_0' - ); - } - - // verify the required parameter 'set_return_decision_request' is set - if ($set_return_decision_request === null || (is_array($set_return_decision_request) && count($set_return_decision_request) === 0)) { + // verify the required parameter 'update_business_prices_request' is set + if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_return_decision_request when calling setReturnDecision_0' + 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -60987,26 +45315,10 @@ class DbsApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($return_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'returnId' . '}', - ObjectSerializer::toPathValue($return_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -61019,12 +45331,12 @@ class DbsApi ); // for model (json/xml) - if (isset($set_return_decision_request)) { + if (isset($update_business_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_return_decision_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); } else { - $httpBody = $set_return_decision_request; + $httpBody = $update_business_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -61082,40 +45394,40 @@ class DbsApi } /** - * Operation skipGoodsFeedbacksReaction_2 + * Operation updateCampaignOffers * - * Отказ от ответа на отзывы + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function skipGoodsFeedbacksReaction_2($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_2'][0]) + public function updateCampaignOffers($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - list($response) = $this->skipGoodsFeedbacksReaction_2WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); + list($response) = $this->updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); return $response; } /** - * Operation skipGoodsFeedbacksReaction_2WithHttpInfo + * Operation updateCampaignOffersWithHttpInfo * - * Отказ от ответа на отзывы + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function skipGoodsFeedbacksReaction_2WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_2'][0]) + public function updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - $request = $this->skipGoodsFeedbacksReaction_2Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -61142,196 +45454,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -61345,34 +45518,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -61382,7 +45532,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61390,7 +45540,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61398,7 +45548,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61406,7 +45556,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61414,7 +45564,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61422,7 +45572,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61430,27 +45588,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation skipGoodsFeedbacksReaction_2Async + * Operation updateCampaignOffersAsync * - * Отказ от ответа на отзывы + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_2Async($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_2'][0]) + public function updateCampaignOffersAsync($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - return $this->skipGoodsFeedbacksReaction_2AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) + return $this->updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -61459,21 +45619,21 @@ class DbsApi } /** - * Operation skipGoodsFeedbacksReaction_2AsyncWithHttpInfo + * Operation updateCampaignOffersAsyncWithHttpInfo * - * Отказ от ответа на отзывы + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_2AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_2'][0]) + public function updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->skipGoodsFeedbacksReaction_2Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -61512,37 +45672,37 @@ class DbsApi } /** - * Create request for operation 'skipGoodsFeedbacksReaction_2' + * Create request for operation 'updateCampaignOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function skipGoodsFeedbacksReaction_2Request($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_2'][0]) + public function updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction_2' + 'Missing the required parameter $campaign_id when calling updateCampaignOffers' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.skipGoodsFeedbacksReaction_2, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'skip_goods_feedback_reaction_request' is set - if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { + // verify the required parameter 'update_campaign_offers_request' is set + if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction_2' + 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/skip-reaction'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -61552,10 +45712,10 @@ class DbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -61568,12 +45728,12 @@ class DbsApi ); // for model (json/xml) - if (isset($skip_goods_feedback_reaction_request)) { + if (isset($update_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); } else { - $httpBody = $skip_goods_feedback_reaction_request; + $httpBody = $update_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -61631,42 +45791,42 @@ class DbsApi } /** - * Operation submitReturnDecision_0 + * Operation updateExternalOrderId * - * Подтверждение решения по возврату + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function submitReturnDecision_0($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision_0'][0]) + public function updateExternalOrderId($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - list($response) = $this->submitReturnDecision_0WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $response; } /** - * Operation submitReturnDecision_0WithHttpInfo + * Operation updateExternalOrderIdWithHttpInfo * - * Подтверждение решения по возврату + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function submitReturnDecision_0WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision_0'][0]) + public function updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - $request = $this->submitReturnDecision_0Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -61693,196 +45853,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -61896,34 +45911,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -61933,7 +45925,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61941,7 +45933,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61949,7 +45941,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61957,7 +45949,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61965,7 +45957,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61973,7 +45965,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61981,28 +45973,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation submitReturnDecision_0Async + * Operation updateExternalOrderIdAsync * - * Подтверждение решения по возврату + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function submitReturnDecision_0Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision_0'][0]) + public function updateExternalOrderIdAsync($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - return $this->submitReturnDecision_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType) ->then( function ($response) { return $response[0]; @@ -62011,22 +46005,22 @@ class DbsApi } /** - * Operation submitReturnDecision_0AsyncWithHttpInfo + * Operation updateExternalOrderIdAsyncWithHttpInfo * - * Подтверждение решения по возврату + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function submitReturnDecision_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision_0'][0]) + public function updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->submitReturnDecision_0Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -62065,45 +46059,45 @@ class DbsApi } /** - * Create request for operation 'submitReturnDecision_0' + * Create request for operation 'updateExternalOrderId' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function submitReturnDecision_0Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision_0'][0]) + public function updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling submitReturnDecision_0' + 'Missing the required parameter $campaign_id when calling updateExternalOrderId' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.submitReturnDecision_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateExternalOrderId, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling submitReturnDecision_0' + 'Missing the required parameter $order_id when calling updateExternalOrderId' ); } - // verify the required parameter 'return_id' is set - if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + // verify the required parameter 'update_external_order_id_request' is set + if ($update_external_order_id_request === null || (is_array($update_external_order_id_request) && count($update_external_order_id_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling submitReturnDecision_0' + 'Missing the required parameter $update_external_order_id_request when calling updateExternalOrderId' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/external-id'; $formParams = []; $queryParams = []; $headerParams = []; @@ -62128,14 +46122,6 @@ class DbsApi $resourcePath ); } - // path params - if ($return_id !== null) { - $resourcePath = str_replace( - '{' . 'returnId' . '}', - ObjectSerializer::toPathValue($return_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -62145,7 +46131,14 @@ class DbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($update_external_order_id_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_external_order_id_request)); + } else { + $httpBody = $update_external_order_id_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -62201,40 +46194,40 @@ class DbsApi } /** - * Operation updateBusinessPrices_2 + * Operation updateGoodsFeedbackComment * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateBusinessPrices_2($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_2'][0]) + public function updateGoodsFeedbackComment($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - list($response) = $this->updateBusinessPrices_2WithHttpInfo($business_id, $update_business_prices_request, $contentType); + list($response) = $this->updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation updateBusinessPrices_2WithHttpInfo + * Operation updateGoodsFeedbackCommentWithHttpInfo * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateBusinessPrices_2WithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_2'][0]) + public function updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $request = $this->updateBusinessPrices_2Request($business_id, $update_business_prices_request, $contentType); + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -62261,223 +46254,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -62491,44 +46312,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62536,7 +46334,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62544,7 +46342,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62552,7 +46350,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62560,7 +46358,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62568,15 +46366,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62584,27 +46374,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateBusinessPrices_2Async + * Operation updateGoodsFeedbackCommentAsync * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_2Async($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_2'][0]) + public function updateGoodsFeedbackCommentAsync($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - return $this->updateBusinessPrices_2AsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) + return $this->updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -62613,21 +46405,21 @@ class DbsApi } /** - * Operation updateBusinessPrices_2AsyncWithHttpInfo + * Operation updateGoodsFeedbackCommentAsyncWithHttpInfo * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_2AsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_2'][0]) + public function updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateBusinessPrices_2Request($business_id, $update_business_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -62666,37 +46458,37 @@ class DbsApi } /** - * Create request for operation 'updateBusinessPrices_2' + * Create request for operation 'updateGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateBusinessPrices_2Request($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_2'][0]) + public function updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateBusinessPrices_2' + 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateBusinessPrices_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateGoodsFeedbackComment, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_business_prices_request' is set - if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { + // verify the required parameter 'update_goods_feedback_comment_request' is set + if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices_2' + 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment' ); } - $resourcePath = '/businesses/{businessId}/offer-prices/updates'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -62722,12 +46514,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_business_prices_request)) { + if (isset($update_goods_feedback_comment_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); } else { - $httpBody = $update_business_prices_request; + $httpBody = $update_goods_feedback_comment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -62785,40 +46577,40 @@ class DbsApi } /** - * Operation updateCampaignOffers_0 + * Operation updateGoodsQuestionTextEntity * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateCampaignOffers_0($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_0'][0]) + public function updateGoodsQuestionTextEntity($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - list($response) = $this->updateCampaignOffers_0WithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); + list($response) = $this->updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType); return $response; } /** - * Operation updateCampaignOffers_0WithHttpInfo + * Operation updateGoodsQuestionTextEntityWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateCampaignOffers_0WithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_0'][0]) + public function updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $request = $this->updateCampaignOffers_0Request($campaign_id, $update_campaign_offers_request, $contentType); + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -62845,223 +46637,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -63075,44 +46695,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63120,7 +46717,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63128,7 +46725,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63136,7 +46733,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63144,7 +46741,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63152,15 +46749,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63168,27 +46757,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateCampaignOffers_0Async + * Operation updateGoodsQuestionTextEntityAsync * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_0Async($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_0'][0]) + public function updateGoodsQuestionTextEntityAsync($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - return $this->updateCampaignOffers_0AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) + return $this->updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType) ->then( function ($response) { return $response[0]; @@ -63197,21 +46788,21 @@ class DbsApi } /** - * Operation updateCampaignOffers_0AsyncWithHttpInfo + * Operation updateGoodsQuestionTextEntityAsyncWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_0AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_0'][0]) + public function updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateCampaignOffers_0Request($campaign_id, $update_campaign_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse'; + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -63250,37 +46841,37 @@ class DbsApi } /** - * Create request for operation 'updateCampaignOffers_0' + * Create request for operation 'updateGoodsQuestionTextEntity' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCampaignOffers_0Request($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_0'][0]) + public function updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateCampaignOffers_0' + 'Missing the required parameter $business_id when calling updateGoodsQuestionTextEntity' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateCampaignOffers_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateGoodsQuestionTextEntity, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_campaign_offers_request' is set - if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { + // verify the required parameter 'update_goods_question_text_entity_request' is set + if ($update_goods_question_text_entity_request === null || (is_array($update_goods_question_text_entity_request) && count($update_goods_question_text_entity_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers_0' + 'Missing the required parameter $update_goods_question_text_entity_request when calling updateGoodsQuestionTextEntity' ); } - $resourcePath = '/campaigns/{campaignId}/offers/update'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -63290,10 +46881,10 @@ class DbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -63306,12 +46897,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_campaign_offers_request)) { + if (isset($update_goods_question_text_entity_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_question_text_entity_request)); } else { - $httpBody = $update_campaign_offers_request; + $httpBody = $update_goods_question_text_entity_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -63369,40 +46960,40 @@ class DbsApi } /** - * Operation updateGoodsFeedbackComment_2 + * Operation updateOfferContent * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateGoodsFeedbackComment_2($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_2'][0]) + public function updateOfferContent($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - list($response) = $this->updateGoodsFeedbackComment_2WithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); + list($response) = $this->updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, $contentType); return $response; } /** - * Operation updateGoodsFeedbackComment_2WithHttpInfo + * Operation updateOfferContentWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateGoodsFeedbackComment_2WithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_2'][0]) + public function updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - $request = $this->updateGoodsFeedbackComment_2Request($business_id, $update_goods_feedback_comment_request, $contentType); + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -63429,196 +47020,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -63632,44 +47084,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + '\OpenAPI\Client\Model\UpdateOfferContentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63677,7 +47106,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63685,7 +47114,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63693,7 +47122,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63701,7 +47130,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63709,7 +47138,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63717,27 +47154,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateGoodsFeedbackComment_2Async + * Operation updateOfferContentAsync * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_2Async($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_2'][0]) + public function updateOfferContentAsync($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - return $this->updateGoodsFeedbackComment_2AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) + return $this->updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) ->then( function ($response) { return $response[0]; @@ -63746,21 +47185,21 @@ class DbsApi } /** - * Operation updateGoodsFeedbackComment_2AsyncWithHttpInfo + * Operation updateOfferContentAsyncWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_2AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_2'][0]) + public function updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - $request = $this->updateGoodsFeedbackComment_2Request($business_id, $update_goods_feedback_comment_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -63799,37 +47238,37 @@ class DbsApi } /** - * Create request for operation 'updateGoodsFeedbackComment_2' + * Create request for operation 'updateOfferContent' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGoodsFeedbackComment_2Request($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_2'][0]) + public function updateOfferContentRequest($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment_2' + 'Missing the required parameter $business_id when calling updateOfferContent' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateGoodsFeedbackComment_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateOfferContent, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_goods_feedback_comment_request' is set - if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { + // verify the required parameter 'update_offer_content_request' is set + if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment_2' + 'Missing the required parameter $update_offer_content_request when calling updateOfferContent' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/update'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -63855,12 +47294,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_goods_feedback_comment_request)) { + if (isset($update_offer_content_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_content_request)); } else { - $httpBody = $update_goods_feedback_comment_request; + $httpBody = $update_offer_content_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -63918,40 +47357,42 @@ class DbsApi } /** - * Operation updateOfferContent_0 + * Operation updateOfferMappingEntries * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function updateOfferContent_0($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_0'][0]) + public function updateOfferMappingEntries($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - list($response) = $this->updateOfferContent_0WithHttpInfo($business_id, $update_offer_content_request, $contentType); + list($response) = $this->updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); return $response; } /** - * Operation updateOfferContent_0WithHttpInfo + * Operation updateOfferMappingEntriesWithHttpInfo * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function updateOfferContent_0WithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_0'][0]) + public function updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - $request = $this->updateOfferContent_0Request($business_id, $update_offer_content_request, $contentType); + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -63978,223 +47419,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferContentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -64208,44 +47483,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOfferContentResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64253,7 +47505,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64261,7 +47513,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64269,7 +47521,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64277,7 +47529,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64285,7 +47537,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64293,7 +47545,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64301,27 +47553,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferContent_0Async + * Operation updateOfferMappingEntriesAsync * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function updateOfferContent_0Async($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_0'][0]) + public function updateOfferMappingEntriesAsync($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - return $this->updateOfferContent_0AsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) + return $this->updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) ->then( function ($response) { return $response[0]; @@ -64330,21 +47585,22 @@ class DbsApi } /** - * Operation updateOfferContent_0AsyncWithHttpInfo + * Operation updateOfferMappingEntriesAsyncWithHttpInfo * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function updateOfferContent_0AsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_0'][0]) + public function updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - $request = $this->updateOfferContent_0Request($business_id, $update_offer_content_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -64383,37 +47639,38 @@ class DbsApi } /** - * Create request for operation 'updateOfferContent_0' + * Create request for operation 'updateOfferMappingEntries' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function updateOfferContent_0Request($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_0'][0]) + public function updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferContent_0' + 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateOfferContent_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOfferMappingEntries, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_offer_content_request' is set - if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { + // verify the required parameter 'update_offer_mapping_entry_request' is set + if ($update_offer_mapping_entry_request === null || (is_array($update_offer_mapping_entry_request) && count($update_offer_mapping_entry_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_content_request when calling updateOfferContent_0' + 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries' ); } - $resourcePath = '/businesses/{businessId}/offer-cards/update'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -64423,10 +47680,10 @@ class DbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -64439,12 +47696,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_offer_content_request)) { + if (isset($update_offer_mapping_entry_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_content_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mapping_entry_request)); } else { - $httpBody = $update_offer_content_request; + $httpBody = $update_offer_mapping_entry_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -64502,42 +47759,42 @@ class DbsApi } /** - * Operation updateOfferMappingEntries_3 + * Operation updateOfferMappings * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferMappingEntries_3($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_3'][0]) + public function updateOfferMappings($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - list($response) = $this->updateOfferMappingEntries_3WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); + list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType); return $response; } /** - * Operation updateOfferMappingEntries_3WithHttpInfo + * Operation updateOfferMappingsWithHttpInfo * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappingEntries_3WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_3'][0]) + public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $request = $this->updateOfferMappingEntries_3Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -64564,223 +47821,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -64794,44 +47885,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64839,7 +47907,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64847,7 +47915,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64855,7 +47923,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64863,7 +47931,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64871,7 +47939,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64879,7 +47947,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64887,28 +47955,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappingEntries_3Async + * Operation updateOfferMappingsAsync * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function updateOfferMappingEntries_3Async($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_3'][0]) + public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - return $this->updateOfferMappingEntries_3AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) + return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -64917,22 +47987,22 @@ class DbsApi } /** - * Operation updateOfferMappingEntries_3AsyncWithHttpInfo + * Operation updateOfferMappingsAsyncWithHttpInfo * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function updateOfferMappingEntries_3AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_3'][0]) + public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOfferMappingEntries_3Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -64971,51 +48041,61 @@ class DbsApi } /** - * Create request for operation 'updateOfferMappingEntries_3' + * Create request for operation 'updateOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function updateOfferMappingEntries_3Request($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_3'][0]) + public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries_3' + 'Missing the required parameter $business_id when calling updateOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOfferMappingEntries_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateOfferMappings, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_offer_mapping_entry_request' is set - if ($update_offer_mapping_entry_request === null || (is_array($update_offer_mapping_entry_request) && count($update_offer_mapping_entry_request) === 0)) { + // verify the required parameter 'update_offer_mappings_request' is set + if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries_3' + 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings' ); } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/updates'; + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/update'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -65028,12 +48108,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_offer_mapping_entry_request)) { + if (isset($update_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mapping_entry_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mappings_request)); } else { - $httpBody = $update_offer_mapping_entry_request; + $httpBody = $update_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -65091,40 +48171,41 @@ class DbsApi } /** - * Operation updateOfferMappings_0 + * Operation updateOrderItems * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return void */ - public function updateOfferMappings_0($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_0'][0]) + public function updateOrderItems($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - list($response) = $this->updateOfferMappings_0WithHttpInfo($business_id, $update_offer_mappings_request, $contentType); - return $response; + $this->updateOrderItemsWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType); } /** - * Operation updateOfferMappings_0WithHttpInfo + * Operation updateOrderItemsWithHttpInfo * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappings_0WithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_0'][0]) + public function updateOrderItemsWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - $request = $this->updateOfferMappings_0Request($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -65149,276 +48230,9 @@ class DbsApi $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65426,7 +48240,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65434,7 +48248,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65442,7 +48256,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65450,7 +48264,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65458,15 +48272,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65474,27 +48280,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappings_0Async + * Operation updateOrderItemsAsync * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_0Async($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_0'][0]) + public function updateOrderItemsAsync($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - return $this->updateOfferMappings_0AsyncWithHttpInfo($business_id, $update_offer_mappings_request, $contentType) + return $this->updateOrderItemsAsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType) ->then( function ($response) { return $response[0]; @@ -65503,40 +48312,28 @@ class DbsApi } /** - * Operation updateOfferMappings_0AsyncWithHttpInfo + * Operation updateOrderItemsAsyncWithHttpInfo * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_0AsyncWithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_0'][0]) + public function updateOrderItemsAsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - $request = $this->updateOfferMappings_0Request($business_id, $update_offer_mappings_request, $contentType); + $returnType = ''; + $request = $this->updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -65556,37 +48353,45 @@ class DbsApi } /** - * Create request for operation 'updateOfferMappings_0' + * Create request for operation 'updateOrderItems' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferMappings_0Request($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_0'][0]) + public function updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferMappings_0' + 'Missing the required parameter $campaign_id when calling updateOrderItems' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updateOfferMappings_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderItems, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_offer_mappings_request' is set - if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling updateOrderItems' + ); + } + + // verify the required parameter 'update_order_item_request' is set + if ($update_order_item_request === null || (is_array($update_order_item_request) && count($update_order_item_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings_0' + 'Missing the required parameter $update_order_item_request when calling updateOrderItems' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/update'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -65596,10 +48401,18 @@ class DbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -65612,12 +48425,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_offer_mappings_request)) { + if (isset($update_order_item_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mappings_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_item_request)); } else { - $httpBody = $update_offer_mappings_request; + $httpBody = $update_order_item_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -65667,7 +48480,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -65675,41 +48488,42 @@ class DbsApi } /** - * Operation updateOrderItems_1 + * Operation updateOrderStatus * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderItems_1($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_1'][0]) + public function updateOrderStatus($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $this->updateOrderItems_1WithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType); + list($response) = $this->updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + return $response; } /** - * Operation updateOrderItems_1WithHttpInfo + * Operation updateOrderStatusWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderItems_1WithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_1'][0]) + public function updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $request = $this->updateOrderItems_1Request($campaign_id, $order_id, $update_order_item_request, $contentType); + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -65734,10 +48548,81 @@ class DbsApi $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65745,7 +48630,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65753,7 +48638,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65761,7 +48646,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65769,7 +48654,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65777,7 +48662,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65785,28 +48670,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderItems_1Async + * Operation updateOrderStatusAsync * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderItems_1Async($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_1'][0]) + public function updateOrderStatusAsync($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - return $this->updateOrderItems_1AsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType) + return $this->updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -65815,28 +48702,41 @@ class DbsApi } /** - * Operation updateOrderItems_1AsyncWithHttpInfo + * Operation updateOrderStatusAsyncWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderItems_1AsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_1'][0]) + public function updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $returnType = ''; - $request = $this->updateOrderItems_1Request($campaign_id, $order_id, $update_order_item_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -65856,45 +48756,45 @@ class DbsApi } /** - * Create request for operation 'updateOrderItems_1' + * Create request for operation 'updateOrderStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderItems_1Request($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_1'][0]) + public function updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderItems_1' + 'Missing the required parameter $campaign_id when calling updateOrderStatus' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderItems_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderStatus, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderItems_1' + 'Missing the required parameter $order_id when calling updateOrderStatus' ); } - // verify the required parameter 'update_order_item_request' is set - if ($update_order_item_request === null || (is_array($update_order_item_request) && count($update_order_item_request) === 0)) { + // verify the required parameter 'update_order_status_request' is set + if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_item_request when calling updateOrderItems_1' + 'Missing the required parameter $update_order_status_request when calling updateOrderStatus' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/items'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -65928,12 +48828,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_order_item_request)) { + if (isset($update_order_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_item_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); } else { - $httpBody = $update_order_item_request; + $httpBody = $update_order_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -65991,42 +48891,40 @@ class DbsApi } /** - * Operation updateOrderStatus_1 + * Operation updateOrderStatuses * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStatus_1($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_1'][0]) + public function updateOrderStatuses($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - list($response) = $this->updateOrderStatus_1WithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + list($response) = $this->updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); return $response; } /** - * Operation updateOrderStatus_1WithHttpInfo + * Operation updateOrderStatusesWithHttpInfo * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStatus_1WithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_1'][0]) + public function updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - $request = $this->updateOrderStatus_1Request($campaign_id, $order_id, $update_order_status_request, $contentType); + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -66053,196 +48951,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -66256,44 +49009,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66301,7 +49031,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66309,7 +49039,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66317,7 +49047,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66325,7 +49055,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66333,7 +49063,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66341,28 +49071,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStatus_1Async + * Operation updateOrderStatusesAsync * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatus_1Async($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_1'][0]) + public function updateOrderStatusesAsync($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - return $this->updateOrderStatus_1AsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) + return $this->updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) ->then( function ($response) { return $response[0]; @@ -66371,22 +49102,21 @@ class DbsApi } /** - * Operation updateOrderStatus_1AsyncWithHttpInfo + * Operation updateOrderStatusesAsyncWithHttpInfo * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatus_1AsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_1'][0]) + public function updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - $request = $this->updateOrderStatus_1Request($campaign_id, $order_id, $update_order_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -66425,45 +49155,37 @@ class DbsApi } /** - * Create request for operation 'updateOrderStatus_1' + * Create request for operation 'updateOrderStatuses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStatus_1Request($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_1'][0]) + public function updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStatus_1' + 'Missing the required parameter $campaign_id when calling updateOrderStatuses' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderStatus_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderStatuses, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderStatus_1' - ); - } - - // verify the required parameter 'update_order_status_request' is set - if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { + // verify the required parameter 'update_order_statuses_request' is set + if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_status_request when calling updateOrderStatus_1' + 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/status'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/status-update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -66480,14 +49202,6 @@ class DbsApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -66497,12 +49211,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_order_status_request)) { + if (isset($update_order_statuses_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); } else { - $httpBody = $update_order_status_request; + $httpBody = $update_order_statuses_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -66552,7 +49266,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -66560,40 +49274,42 @@ class DbsApi } /** - * Operation updateOrderStatuses_1 + * Operation updateOrderStorageLimit * - * Изменение статусов нескольких заказов + * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request update_order_storage_limit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStatuses_1($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_1'][0]) + public function updateOrderStorageLimit($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit'][0]) { - list($response) = $this->updateOrderStatuses_1WithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); + list($response) = $this->updateOrderStorageLimitWithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, $contentType); return $response; } /** - * Operation updateOrderStatuses_1WithHttpInfo + * Operation updateOrderStorageLimitWithHttpInfo * - * Изменение статусов нескольких заказов + * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStatuses_1WithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_1'][0]) + public function updateOrderStorageLimitWithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit'][0]) { - $request = $this->updateOrderStatuses_1Request($campaign_id, $update_order_statuses_request, $contentType); + $request = $this->updateOrderStorageLimitRequest($campaign_id, $order_id, $update_order_storage_limit_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -66620,196 +49336,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -66823,44 +49394,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66868,7 +49416,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66876,7 +49424,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66884,7 +49432,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66892,7 +49440,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66900,7 +49448,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66908,27 +49456,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStatuses_1Async + * Operation updateOrderStorageLimitAsync * - * Изменение статусов нескольких заказов + * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatuses_1Async($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_1'][0]) + public function updateOrderStorageLimitAsync($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit'][0]) { - return $this->updateOrderStatuses_1AsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) + return $this->updateOrderStorageLimitAsyncWithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, $contentType) ->then( function ($response) { return $response[0]; @@ -66937,21 +49488,22 @@ class DbsApi } /** - * Operation updateOrderStatuses_1AsyncWithHttpInfo + * Operation updateOrderStorageLimitAsyncWithHttpInfo * - * Изменение статусов нескольких заказов + * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatuses_1AsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_1'][0]) + public function updateOrderStorageLimitAsyncWithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - $request = $this->updateOrderStatuses_1Request($campaign_id, $update_order_statuses_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateOrderStorageLimitRequest($campaign_id, $order_id, $update_order_storage_limit_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -66990,37 +49542,45 @@ class DbsApi } /** - * Create request for operation 'updateOrderStatuses_1' + * Create request for operation 'updateOrderStorageLimit' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStatuses_1Request($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_1'][0]) + public function updateOrderStorageLimitRequest($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStatuses_1' + 'Missing the required parameter $campaign_id when calling updateOrderStorageLimit' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderStatuses_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderStorageLimit, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_order_statuses_request' is set - if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling updateOrderStorageLimit' + ); + } + + // verify the required parameter 'update_order_storage_limit_request' is set + if ($update_order_storage_limit_request === null || (is_array($update_order_storage_limit_request) && count($update_order_storage_limit_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses_1' + 'Missing the required parameter $update_order_storage_limit_request when calling updateOrderStorageLimit' ); } - $resourcePath = '/campaigns/{campaignId}/orders/status-update'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/storage-limit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -67037,6 +49597,14 @@ class DbsApi $resourcePath ); } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -67046,12 +49614,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_order_statuses_request)) { + if (isset($update_order_storage_limit_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_storage_limit_request)); } else { - $httpBody = $update_order_statuses_request; + $httpBody = $update_order_storage_limit_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -67101,7 +49669,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -67109,42 +49677,42 @@ class DbsApi } /** - * Operation updateOrderStorageLimit_0 + * Operation updateOutlet * - * Продление срока хранения заказа + * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request update_order_storage_limit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request change_outlet_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStorageLimit_0($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit_0'][0]) + public function updateOutlet($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet'][0]) { - list($response) = $this->updateOrderStorageLimit_0WithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, $contentType); + list($response) = $this->updateOutletWithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, $contentType); return $response; } /** - * Operation updateOrderStorageLimit_0WithHttpInfo + * Operation updateOutletWithHttpInfo * - * Продление срока хранения заказа + * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStorageLimit_0WithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit_0'][0]) + public function updateOutletWithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet'][0]) { - $request = $this->updateOrderStorageLimit_0Request($campaign_id, $order_id, $update_order_storage_limit_request, $contentType); + $request = $this->updateOutletRequest($campaign_id, $outlet_id, $change_outlet_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -67171,196 +49739,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -67374,34 +49797,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -67411,7 +49811,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67419,7 +49819,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67427,7 +49827,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67435,7 +49835,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67443,7 +49843,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67451,7 +49851,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67459,28 +49859,30 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStorageLimit_0Async + * Operation updateOutletAsync * - * Продление срока хранения заказа + * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStorageLimit_0Async($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit_0'][0]) + public function updateOutletAsync($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet'][0]) { - return $this->updateOrderStorageLimit_0AsyncWithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, $contentType) + return $this->updateOutletAsyncWithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, $contentType) ->then( function ($response) { return $response[0]; @@ -67489,22 +49891,22 @@ class DbsApi } /** - * Operation updateOrderStorageLimit_0AsyncWithHttpInfo + * Operation updateOutletAsyncWithHttpInfo * - * Продление срока хранения заказа + * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStorageLimit_0AsyncWithHttpInfo($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit_0'][0]) + public function updateOutletAsyncWithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOrderStorageLimit_0Request($campaign_id, $order_id, $update_order_storage_limit_request, $contentType); + $request = $this->updateOutletRequest($campaign_id, $outlet_id, $change_outlet_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -67543,45 +49945,48 @@ class DbsApi } /** - * Create request for operation 'updateOrderStorageLimit_0' + * Create request for operation 'updateOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $outlet_id Идентификатор точки продаж. (required) + * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStorageLimit_0Request($campaign_id, $order_id, $update_order_storage_limit_request, string $contentType = self::contentTypes['updateOrderStorageLimit_0'][0]) + public function updateOutletRequest($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStorageLimit_0' + 'Missing the required parameter $campaign_id when calling updateOutlet' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOrderStorageLimit_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOutlet, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'outlet_id' is set + if ($outlet_id === null || (is_array($outlet_id) && count($outlet_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderStorageLimit_0' + 'Missing the required parameter $outlet_id when calling updateOutlet' ); } - - // verify the required parameter 'update_order_storage_limit_request' is set - if ($update_order_storage_limit_request === null || (is_array($update_order_storage_limit_request) && count($update_order_storage_limit_request) === 0)) { + if ($outlet_id < 1) { + throw new \InvalidArgumentException('invalid value for "$outlet_id" when calling DbsApi.updateOutlet, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'change_outlet_request' is set + if ($change_outlet_request === null || (is_array($change_outlet_request) && count($change_outlet_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_storage_limit_request when calling updateOrderStorageLimit_0' + 'Missing the required parameter $change_outlet_request when calling updateOutlet' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/storage-limit'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/{outletId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -67599,10 +50004,10 @@ class DbsApi ); } // path params - if ($order_id !== null) { + if ($outlet_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'outletId' . '}', + ObjectSerializer::toPathValue($outlet_id), $resourcePath ); } @@ -67615,12 +50020,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_order_storage_limit_request)) { + if (isset($change_outlet_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_storage_limit_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($change_outlet_request)); } else { - $httpBody = $update_order_storage_limit_request; + $httpBody = $change_outlet_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -67678,40 +50083,40 @@ class DbsApi } /** - * Operation updateOutletLicenses_0 + * Operation updateOutletLicenses * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request update_outlet_license_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOutletLicenses_0($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses_0'][0]) + public function updateOutletLicenses($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses'][0]) { - list($response) = $this->updateOutletLicenses_0WithHttpInfo($campaign_id, $update_outlet_license_request, $contentType); + list($response) = $this->updateOutletLicensesWithHttpInfo($campaign_id, $update_outlet_license_request, $contentType); return $response; } /** - * Operation updateOutletLicenses_0WithHttpInfo + * Operation updateOutletLicensesWithHttpInfo * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOutletLicenses_0WithHttpInfo($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses_0'][0]) + public function updateOutletLicensesWithHttpInfo($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses'][0]) { - $request = $this->updateOutletLicenses_0Request($campaign_id, $update_outlet_license_request, $contentType); + $request = $this->updateOutletLicensesRequest($campaign_id, $update_outlet_license_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -67738,196 +50143,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -67941,34 +50201,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -67978,7 +50215,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67986,7 +50223,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -67994,7 +50231,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68002,7 +50239,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68010,7 +50247,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68018,7 +50255,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68026,27 +50263,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOutletLicenses_0Async + * Operation updateOutletLicensesAsync * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOutletLicenses_0Async($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses_0'][0]) + public function updateOutletLicensesAsync($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses'][0]) { - return $this->updateOutletLicenses_0AsyncWithHttpInfo($campaign_id, $update_outlet_license_request, $contentType) + return $this->updateOutletLicensesAsyncWithHttpInfo($campaign_id, $update_outlet_license_request, $contentType) ->then( function ($response) { return $response[0]; @@ -68055,21 +50294,21 @@ class DbsApi } /** - * Operation updateOutletLicenses_0AsyncWithHttpInfo + * Operation updateOutletLicensesAsyncWithHttpInfo * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOutletLicenses_0AsyncWithHttpInfo($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses_0'][0]) + public function updateOutletLicensesAsyncWithHttpInfo($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOutletLicenses_0Request($campaign_id, $update_outlet_license_request, $contentType); + $request = $this->updateOutletLicensesRequest($campaign_id, $update_outlet_license_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -68108,37 +50347,37 @@ class DbsApi } /** - * Create request for operation 'updateOutletLicenses_0' + * Create request for operation 'updateOutletLicenses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOutletLicenses_0Request($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses_0'][0]) + public function updateOutletLicensesRequest($campaign_id, $update_outlet_license_request, string $contentType = self::contentTypes['updateOutletLicenses'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOutletLicenses_0' + 'Missing the required parameter $campaign_id when calling updateOutletLicenses' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOutletLicenses_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOutletLicenses, must be bigger than or equal to 1.'); } // verify the required parameter 'update_outlet_license_request' is set if ($update_outlet_license_request === null || (is_array($update_outlet_license_request) && count($update_outlet_license_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_outlet_license_request when calling updateOutletLicenses_0' + 'Missing the required parameter $update_outlet_license_request when calling updateOutletLicenses' ); } - $resourcePath = '/campaigns/{campaignId}/outlets/licenses'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/licenses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -68227,42 +50466,40 @@ class DbsApi } /** - * Operation updateOutlet_0 + * Operation updatePrices * - * Изменение информации о точке продаж + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOutlet_0($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet_0'][0]) + public function updatePrices($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - list($response) = $this->updateOutlet_0WithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, $contentType); + list($response) = $this->updatePricesWithHttpInfo($campaign_id, $update_prices_request, $contentType); return $response; } /** - * Operation updateOutlet_0WithHttpInfo + * Operation updatePricesWithHttpInfo * - * Изменение информации о точке продаж + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOutlet_0WithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet_0'][0]) + public function updatePricesWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - $request = $this->updateOutlet_0Request($campaign_id, $outlet_id, $change_outlet_request, $contentType); + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -68289,196 +50526,57 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -68492,34 +50590,11 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -68529,7 +50604,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68537,7 +50612,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68545,7 +50620,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68553,7 +50628,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68561,7 +50636,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68569,7 +50644,15 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -68577,28 +50660,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOutlet_0Async + * Operation updatePricesAsync * - * Изменение информации о точке продаж + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOutlet_0Async($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet_0'][0]) + public function updatePricesAsync($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - return $this->updateOutlet_0AsyncWithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, $contentType) + return $this->updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -68607,22 +50691,21 @@ class DbsApi } /** - * Operation updateOutlet_0AsyncWithHttpInfo + * Operation updatePricesAsyncWithHttpInfo * - * Изменение информации о точке продаж + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOutlet_0AsyncWithHttpInfo($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet_0'][0]) + public function updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOutlet_0Request($campaign_id, $outlet_id, $change_outlet_request, $contentType); + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -68661,48 +50744,37 @@ class DbsApi } /** - * Create request for operation 'updateOutlet_0' + * Create request for operation 'updatePrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $outlet_id Идентификатор точки продаж. (required) - * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOutlet_0Request($campaign_id, $outlet_id, $change_outlet_request, string $contentType = self::contentTypes['updateOutlet_0'][0]) + public function updatePricesRequest($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOutlet_0' + 'Missing the required parameter $campaign_id when calling updatePrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateOutlet_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'outlet_id' is set - if ($outlet_id === null || (is_array($outlet_id) && count($outlet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $outlet_id when calling updateOutlet_0' - ); - } - if ($outlet_id < 1) { - throw new \InvalidArgumentException('invalid value for "$outlet_id" when calling DbsApi.updateOutlet_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updatePrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'change_outlet_request' is set - if ($change_outlet_request === null || (is_array($change_outlet_request) && count($change_outlet_request) === 0)) { + // verify the required parameter 'update_prices_request' is set + if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $change_outlet_request when calling updateOutlet_0' + 'Missing the required parameter $update_prices_request when calling updatePrices' ); } - $resourcePath = '/campaigns/{campaignId}/outlets/{outletId}'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -68719,14 +50791,6 @@ class DbsApi $resourcePath ); } - // path params - if ($outlet_id !== null) { - $resourcePath = str_replace( - '{' . 'outletId' . '}', - ObjectSerializer::toPathValue($outlet_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -68736,12 +50800,12 @@ class DbsApi ); // for model (json/xml) - if (isset($change_outlet_request)) { + if (isset($update_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($change_outlet_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); } else { - $httpBody = $change_outlet_request; + $httpBody = $update_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -68791,7 +50855,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -68799,40 +50863,40 @@ class DbsApi } /** - * Operation updatePrices_2 + * Operation updatePromoOffers * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePrices_2($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_2'][0]) + public function updatePromoOffers($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - list($response) = $this->updatePrices_2WithHttpInfo($campaign_id, $update_prices_request, $contentType); + list($response) = $this->updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, $contentType); return $response; } /** - * Operation updatePrices_2WithHttpInfo + * Operation updatePromoOffersWithHttpInfo * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePrices_2WithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_2'][0]) + public function updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $request = $this->updatePrices_2Request($campaign_id, $update_prices_request, $contentType); + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -68859,223 +50923,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -69089,44 +50981,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69134,7 +51003,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69142,7 +51011,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69150,7 +51019,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69158,7 +51027,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69166,15 +51035,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69182,27 +51043,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePrices_2Async + * Operation updatePromoOffersAsync * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_2Async($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_2'][0]) + public function updatePromoOffersAsync($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - return $this->updatePrices_2AsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) + return $this->updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -69211,21 +51074,21 @@ class DbsApi } /** - * Operation updatePrices_2AsyncWithHttpInfo + * Operation updatePromoOffersAsyncWithHttpInfo * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_2AsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_2'][0]) + public function updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updatePrices_2Request($campaign_id, $update_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -69264,37 +51127,37 @@ class DbsApi } /** - * Create request for operation 'updatePrices_2' + * Create request for operation 'updatePromoOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePrices_2Request($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_2'][0]) + public function updatePromoOffersRequest($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updatePrices_2' + 'Missing the required parameter $business_id when calling updatePromoOffers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updatePrices_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updatePromoOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_prices_request' is set - if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { + // verify the required parameter 'update_promo_offers_request' is set + if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_prices_request when calling updatePrices_2' + 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offer-prices/updates'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -69304,10 +51167,10 @@ class DbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -69320,12 +51183,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_prices_request)) { + if (isset($update_promo_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_promo_offers_request)); } else { - $httpBody = $update_prices_request; + $httpBody = $update_promo_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -69383,40 +51246,40 @@ class DbsApi } /** - * Operation updatePromoOffers_2 + * Operation updateStocks * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePromoOffers_2($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_2'][0]) + public function updateStocks($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - list($response) = $this->updatePromoOffers_2WithHttpInfo($business_id, $update_promo_offers_request, $contentType); + list($response) = $this->updateStocksWithHttpInfo($campaign_id, $update_stocks_request, $contentType); return $response; } /** - * Operation updatePromoOffers_2WithHttpInfo + * Operation updateStocksWithHttpInfo * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePromoOffers_2WithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_2'][0]) + public function updateStocksWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - $request = $this->updatePromoOffers_2Request($business_id, $update_promo_offers_request, $contentType); + $request = $this->updateStocksRequest($campaign_id, $update_stocks_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -69443,196 +51306,51 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdatePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -69646,44 +51364,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69691,7 +51386,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69699,7 +51394,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69707,7 +51402,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69715,7 +51410,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69723,7 +51418,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -69731,27 +51426,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePromoOffers_2Async + * Operation updateStocksAsync * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_2Async($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_2'][0]) + public function updateStocksAsync($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - return $this->updatePromoOffers_2AsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) + return $this->updateStocksAsyncWithHttpInfo($campaign_id, $update_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -69760,21 +51457,21 @@ class DbsApi } /** - * Operation updatePromoOffers_2AsyncWithHttpInfo + * Operation updateStocksAsyncWithHttpInfo * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_2AsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_2'][0]) + public function updateStocksAsyncWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - $request = $this->updatePromoOffers_2Request($business_id, $update_promo_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateStocksRequest($campaign_id, $update_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -69813,37 +51510,37 @@ class DbsApi } /** - * Create request for operation 'updatePromoOffers_2' + * Create request for operation 'updateStocks' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePromoOffers_2Request($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_2'][0]) + public function updateStocksRequest($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updatePromoOffers_2' + 'Missing the required parameter $campaign_id when calling updateStocks' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling DbsApi.updatePromoOffers_2, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateStocks, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_promo_offers_request' is set - if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { + // verify the required parameter 'update_stocks_request' is set + if ($update_stocks_request === null || (is_array($update_stocks_request) && count($update_stocks_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers_2' + 'Missing the required parameter $update_stocks_request when calling updateStocks' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/update'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -69853,10 +51550,10 @@ class DbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -69869,12 +51566,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_promo_offers_request)) { + if (isset($update_stocks_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_promo_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stocks_request)); } else { - $httpBody = $update_promo_offers_request; + $httpBody = $update_stocks_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -69924,7 +51621,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -69932,40 +51629,40 @@ class DbsApi } /** - * Operation updateStocks_1 + * Operation updateWarehouseStatus * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateStocks_1($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_1'][0]) + public function updateWarehouseStatus($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - list($response) = $this->updateStocks_1WithHttpInfo($campaign_id, $update_stocks_request, $contentType); + list($response) = $this->updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType); return $response; } /** - * Operation updateStocks_1WithHttpInfo + * Operation updateWarehouseStatusWithHttpInfo * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateStocks_1WithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_1'][0]) + public function updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - $request = $this->updateStocks_1Request($campaign_id, $update_stocks_request, $contentType); + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -69992,196 +51689,45 @@ class DbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -70195,44 +51741,21 @@ class DbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -70240,7 +51763,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -70248,7 +51771,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -70256,15 +51779,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -70272,7 +51787,7 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -70280,27 +51795,29 @@ class DbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateStocks_1Async + * Operation updateWarehouseStatusAsync * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStocks_1Async($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_1'][0]) + public function updateWarehouseStatusAsync($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - return $this->updateStocks_1AsyncWithHttpInfo($campaign_id, $update_stocks_request, $contentType) + return $this->updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -70309,21 +51826,21 @@ class DbsApi } /** - * Operation updateStocks_1AsyncWithHttpInfo + * Operation updateWarehouseStatusAsyncWithHttpInfo * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStocks_1AsyncWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_1'][0]) + public function updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateStocks_1Request($campaign_id, $update_stocks_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse'; + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -70362,37 +51879,37 @@ class DbsApi } /** - * Create request for operation 'updateStocks_1' + * Create request for operation 'updateWarehouseStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateStocks_1Request($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_1'][0]) + public function updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateStocks_1' + 'Missing the required parameter $campaign_id when calling updateWarehouseStatus' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateStocks_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling DbsApi.updateWarehouseStatus, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_stocks_request' is set - if ($update_stocks_request === null || (is_array($update_stocks_request) && count($update_stocks_request) === 0)) { + // verify the required parameter 'update_warehouse_status_request' is set + if ($update_warehouse_status_request === null || (is_array($update_warehouse_status_request) && count($update_warehouse_status_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_stocks_request when calling updateStocks_1' + 'Missing the required parameter $update_warehouse_status_request when calling updateWarehouseStatus' ); } - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/warehouse/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -70418,12 +51935,12 @@ class DbsApi ); // for model (json/xml) - if (isset($update_stocks_request)) { + if (isset($update_warehouse_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stocks_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_warehouse_status_request)); } else { - $httpBody = $update_stocks_request; + $httpBody = $update_warehouse_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -70473,7 +51990,7 @@ class DbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -70496,6 +52013,57 @@ class DbsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/DeliveryServicesApi.php b/erp24/lib/yandex_market_api/Api/DeliveryServicesApi.php index b23e554a..ace09402 100644 --- a/erp24/lib/yandex_market_api/Api/DeliveryServicesApi.php +++ b/erp24/lib/yandex_market_api/Api/DeliveryServicesApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -179,196 +182,51 @@ class DeliveryServicesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetDeliveryServicesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -382,34 +240,11 @@ class DeliveryServicesApi ); } - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -419,7 +254,7 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -427,7 +262,7 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -435,7 +270,7 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +278,7 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +286,7 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +294,7 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,8 +302,10 @@ class DeliveryServicesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -556,7 +393,7 @@ class DeliveryServicesApi { - $resourcePath = '/delivery/services'; + $resourcePath = '/v2/delivery/services'; $formParams = []; $queryParams = []; $headerParams = []; @@ -645,6 +482,57 @@ class DeliveryServicesApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/ExpressApi.php b/erp24/lib/yandex_market_api/Api/ExpressApi.php index 013fb78d..c384a40c 100644 --- a/erp24/lib/yandex_market_api/Api/ExpressApi.php +++ b/erp24/lib/yandex_market_api/Api/ExpressApi.php @@ -1,7 +1,7 @@ [ + 'addHiddenOffers' => [ 'application/json', ], - 'addOffersToArchive_3' => [ + 'addOffersToArchive' => [ 'application/json', ], - 'calculateTariffs_3' => [ + 'calculateTariffs' => [ 'application/json', ], - 'confirmBusinessPrices_3' => [ + 'confirmBusinessPrices' => [ 'application/json', ], - 'confirmCampaignPrices_3' => [ + 'confirmCampaignPrices' => [ 'application/json', ], - 'createChat_3' => [ + 'createChat' => [ 'application/json', ], - 'deleteCampaignOffers_3' => [ + 'deleteCampaignOffers' => [ 'application/json', ], - 'deleteGoodsFeedbackComment_3' => [ + 'deleteGoodsFeedbackComment' => [ 'application/json', ], - 'deleteHiddenOffers_3' => [ + 'deleteHiddenOffers' => [ 'application/json', ], - 'deleteOffersFromArchive_3' => [ + 'deleteOffers' => [ 'application/json', ], - 'deleteOffers_3' => [ + 'deleteOffersFromArchive' => [ 'application/json', ], - 'deletePromoOffers_3' => [ + 'deletePromoOffers' => [ 'application/json', ], - 'generateBoostConsolidatedReport_3' => [ + 'generateBannersStatisticsReport' => [ 'application/json', ], - 'generateCompetitorsPositionReport_3' => [ + 'generateBoostConsolidatedReport' => [ 'application/json', ], - 'generateGoodsFeedbackReport_3' => [ + 'generateClosureDocumentsDetalizationReport' => [ 'application/json', ], - 'generateGoodsRealizationReport_2' => [ + 'generateClosureDocumentsReport' => [ 'application/json', ], - 'generateMassOrderLabelsReport_2' => [ + 'generateCompetitorsPositionReport' => [ 'application/json', ], - 'generateOrderLabel_2' => [ + 'generateGoodsFeedbackReport' => [ 'application/json', ], - 'generateOrderLabels_2' => [ + 'generateGoodsPricesReport' => [ 'application/json', ], - 'generatePricesReport_3' => [ + 'generateGoodsRealizationReport' => [ 'application/json', ], - 'generateShelfsStatisticsReport_3' => [ + 'generateJewelryFiscalReport' => [ 'application/json', ], - 'generateShowsSalesReport_3' => [ + 'generateKeyIndicatorsReport' => [ 'application/json', ], - 'generateStocksOnWarehousesReport_3' => [ + 'generateMassOrderLabelsReport' => [ 'application/json', ], - 'generateUnitedMarketplaceServicesReport_3' => [ + 'generateOfferBarcodes' => [ 'application/json', ], - 'generateUnitedNettingReport_3' => [ + 'generateOrderLabel' => [ 'application/json', ], - 'generateUnitedOrdersReport_3' => [ + 'generateOrderLabels' => [ 'application/json', ], - 'getAllOffers_2' => [ + 'generatePricesReport' => [ 'application/json', ], - 'getBidsInfoForBusiness_3' => [ + 'generateSalesGeographyReport' => [ 'application/json', ], - 'getBidsRecommendations_3' => [ + 'generateShelfsStatisticsReport' => [ 'application/json', ], - 'getBusinessQuarantineOffers_3' => [ + 'generateShowsBoostReport' => [ 'application/json', ], - 'getBusinessSettings_3' => [ + 'generateShowsSalesReport' => [ 'application/json', ], - 'getCampaignLogins_1' => [ + 'generateStocksOnWarehousesReport' => [ 'application/json', ], - 'getCampaignOffers_3' => [ + 'generateUnitedMarketplaceServicesReport' => [ 'application/json', ], - 'getCampaignQuarantineOffers_3' => [ + 'generateUnitedNettingReport' => [ 'application/json', ], - 'getCampaignRegion_3' => [ + 'generateUnitedOrdersReport' => [ 'application/json', ], - 'getCampaignSettings_2' => [ + 'generateUnitedReturnsReport' => [ 'application/json', ], - 'getCampaign_1' => [ + 'getAuthTokenInfo' => [ 'application/json', ], - 'getCampaignsByLogin_1' => [ + 'getBidsInfoForBusiness' => [ 'application/json', ], - 'getCampaigns_1' => [ + 'getBidsRecommendations' => [ 'application/json', ], - 'getCategoriesMaxSaleQuantum_3' => [ + 'getBusinessOrders' => [ 'application/json', ], - 'getCategoriesTree_3' => [ + 'getBusinessQuarantineOffers' => [ 'application/json', ], - 'getCategoryContentParameters_3' => [ + 'getBusinessSettings' => [ 'application/json', ], - 'getChatHistory_3' => [ + 'getCampaign' => [ 'application/json', ], - 'getChats_3' => [ + 'getCampaignOffers' => [ 'application/json', ], - 'getDeliveryServices_2' => [ + 'getCampaignQuarantineOffers' => [ 'application/json', ], - 'getFeedIndexLogs_2' => [ + 'getCampaignSettings' => [ 'application/json', ], - 'getFeed_2' => [ + 'getCampaigns' => [ 'application/json', ], - 'getFeedbackAndCommentUpdates_3' => [ + 'getCategoriesMaxSaleQuantum' => [ 'application/json', ], - 'getFeeds_2' => [ + 'getCategoriesTree' => [ 'application/json', ], - 'getGoodsFeedbackComments_3' => [ + 'getCategoryContentParameters' => [ 'application/json', ], - 'getGoodsFeedbacks_3' => [ + 'getChat' => [ 'application/json', ], - 'getGoodsStats_2' => [ + 'getChatHistory' => [ 'application/json', ], - 'getHiddenOffers_3' => [ + 'getChatMessage' => [ 'application/json', ], - 'getOfferCardsContentStatus_3' => [ + 'getChats' => [ 'application/json', ], - 'getOfferMappingEntries_2' => [ + 'getDefaultPrices' => [ 'application/json', ], - 'getOfferMappings_3' => [ + 'getDeliveryServices' => [ 'application/json', ], - 'getOfferRecommendations_3' => [ + 'getGoodsFeedbackComments' => [ 'application/json', ], - 'getOffers_2' => [ + 'getGoodsFeedbacks' => [ 'application/json', ], - 'getOrderBusinessBuyerInfo_3' => [ + 'getGoodsQuestionAnswers' => [ 'application/json', ], - 'getOrderBusinessDocumentsInfo_3' => [ + 'getGoodsQuestions' => [ 'application/json', ], - 'getOrderLabelsData_2' => [ + 'getGoodsStats' => [ 'application/json', ], - 'getOrder_3' => [ + 'getHiddenOffers' => [ 'application/json', ], - 'getOrdersStats_3' => [ + 'getOfferCardsContentStatus' => [ 'application/json', ], - 'getOrders_3' => [ + 'getOfferMappingEntries' => [ 'application/json', ], - 'getPricesByOfferIds_3' => [ + 'getOfferMappings' => [ 'application/json', ], - 'getPrices_3' => [ + 'getOfferRecommendations' => [ 'application/json', ], - 'getPromoOffers_3' => [ + 'getOrder' => [ 'application/json', ], - 'getPromos_3' => [ + 'getOrderBusinessBuyerInfo' => [ 'application/json', ], - 'getQualityRatingDetails_2' => [ + 'getOrderBusinessDocumentsInfo' => [ 'application/json', ], - 'getQualityRatings_3' => [ + 'getOrderIdentifiersStatus' => [ 'application/json', ], - 'getReportInfo_3' => [ + 'getOrderLabelsData' => [ 'application/json', ], - 'getReturnApplication_2' => [ + 'getOrders' => [ 'application/json', ], - 'getReturnPhoto_2' => [ + 'getOrdersStats' => [ 'application/json', ], - 'getReturn_2' => [ + 'getPagedWarehouses' => [ 'application/json', ], - 'getReturns_2' => [ + 'getPrices' => [ 'application/json', ], - 'getStocks_3' => [ + 'getPricesByOfferIds' => [ 'application/json', ], - 'getSuggestedOfferMappingEntries_2' => [ + 'getPromoOffers' => [ 'application/json', ], - 'getSuggestedOfferMappings_3' => [ + 'getPromos' => [ 'application/json', ], - 'getSuggestedPrices_2' => [ + 'getQualityRatingDetails' => [ 'application/json', ], - 'getWarehouses_2' => [ + 'getQualityRatings' => [ 'application/json', ], - 'provideOrderItemIdentifiers_2' => [ + 'getRegionsCodes' => [ 'application/json', ], - 'putBidsForBusiness_3' => [ + 'getReportInfo' => [ 'application/json', ], - 'putBidsForCampaign_2' => [ + 'getReturn' => [ 'application/json', ], - 'refreshFeed_2' => [ + 'getReturnApplication' => [ 'application/json', ], - 'searchRegionChildren_3' => [ + 'getReturnPhoto' => [ 'application/json', ], - 'searchRegionsById_3' => [ + 'getReturns' => [ 'application/json', ], - 'searchRegionsByName_3' => [ + 'getStocks' => [ 'application/json', ], - 'sendFileToChat_3' => [ + 'getSuggestedOfferMappingEntries' => [ + 'application/json', + ], + 'getSuggestedOfferMappings' => [ + 'application/json', + ], + 'getWarehouses' => [ + 'application/json', + ], + 'provideOrderItemIdentifiers' => [ + 'application/json', + ], + 'putBidsForBusiness' => [ + 'application/json', + ], + 'putBidsForCampaign' => [ + 'application/json', + ], + 'searchRegionChildren' => [ + 'application/json', + ], + 'searchRegionsById' => [ + 'application/json', + ], + 'searchRegionsByName' => [ + 'application/json', + ], + 'sendFileToChat' => [ 'multipart/form-data', ], - 'sendMessageToChat_3' => [ + 'sendMessageToChat' => [ + 'application/json', + ], + 'setOrderBoxLayout' => [ 'application/json', ], - 'setFeedParams_2' => [ + 'setOrderShipmentBoxes' => [ 'application/json', ], - 'setOrderBoxLayout_1' => [ + 'skipGoodsFeedbacksReaction' => [ 'application/json', ], - 'setOrderShipmentBoxes_2' => [ + 'submitReturnDecision' => [ 'application/json', ], - 'skipGoodsFeedbacksReaction_3' => [ + 'updateBusinessPrices' => [ 'application/json', ], - 'updateBusinessPrices_3' => [ + 'updateCampaignOffers' => [ 'application/json', ], - 'updateCampaignOffers_3' => [ + 'updateExternalOrderId' => [ 'application/json', ], - 'updateGoodsFeedbackComment_3' => [ + 'updateGoodsFeedbackComment' => [ 'application/json', ], - 'updateOfferContent_3' => [ + 'updateGoodsQuestionTextEntity' => [ 'application/json', ], - 'updateOfferMappingEntries_2' => [ + 'updateOfferContent' => [ 'application/json', ], - 'updateOfferMappings_3' => [ + 'updateOfferMappingEntries' => [ 'application/json', ], - 'updateOrderItems_2' => [ + 'updateOfferMappings' => [ 'application/json', ], - 'updateOrderStatus_2' => [ + 'updateOrderItems' => [ 'application/json', ], - 'updateOrderStatuses_2' => [ + 'updateOrderStatus' => [ 'application/json', ], - 'updatePrices_3' => [ + 'updateOrderStatuses' => [ 'application/json', ], - 'updatePromoOffers_3' => [ + 'updatePrices' => [ 'application/json', ], - 'updateStocks_2' => [ + 'updatePromoOffers' => [ 'application/json', ], - 'verifyOrderEac_0' => [ + 'updateStocks' => [ + 'application/json', + ], + 'updateWarehouseStatus' => [ + 'application/json', + ], + 'verifyOrderEac' => [ 'application/json', ], ]; @@ -398,10 +437,10 @@ class ExpressApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -438,40 +477,40 @@ class ExpressApi } /** - * Operation addHiddenOffers_3 + * Operation addHiddenOffers * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addHiddenOffers_3($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_3'][0]) + public function addHiddenOffers($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - list($response) = $this->addHiddenOffers_3WithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); + list($response) = $this->addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); return $response; } /** - * Operation addHiddenOffers_3WithHttpInfo + * Operation addHiddenOffersWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addHiddenOffers_3WithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_3'][0]) + public function addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - $request = $this->addHiddenOffers_3Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -498,196 +537,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -701,34 +595,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -738,7 +609,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -746,7 +617,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -754,7 +625,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -762,7 +633,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -770,7 +641,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -778,7 +649,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -786,27 +657,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addHiddenOffers_3Async + * Operation addHiddenOffersAsync * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_3Async($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_3'][0]) + public function addHiddenOffersAsync($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - return $this->addHiddenOffers_3AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) + return $this->addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -815,21 +688,21 @@ class ExpressApi } /** - * Operation addHiddenOffers_3AsyncWithHttpInfo + * Operation addHiddenOffersAsyncWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_3AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_3'][0]) + public function addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->addHiddenOffers_3Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -868,37 +741,37 @@ class ExpressApi } /** - * Create request for operation 'addHiddenOffers_3' + * Create request for operation 'addHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addHiddenOffers_3Request($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_3'][0]) + public function addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling addHiddenOffers_3' + 'Missing the required parameter $campaign_id when calling addHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.addHiddenOffers_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.addHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'add_hidden_offers_request' is set if ($add_hidden_offers_request === null || (is_array($add_hidden_offers_request) && count($add_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers_3' + 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -987,40 +860,40 @@ class ExpressApi } /** - * Operation addOffersToArchive_3 + * Operation addOffersToArchive * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addOffersToArchive_3($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_3'][0]) + public function addOffersToArchive($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - list($response) = $this->addOffersToArchive_3WithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); + list($response) = $this->addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); return $response; } /** - * Operation addOffersToArchive_3WithHttpInfo + * Operation addOffersToArchiveWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addOffersToArchive_3WithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_3'][0]) + public function addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - $request = $this->addOffersToArchive_3Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1047,223 +920,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AddOffersToArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1277,34 +984,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1314,7 +998,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1322,7 +1006,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1330,7 +1014,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1338,7 +1022,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1346,7 +1030,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1354,7 +1038,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1362,7 +1046,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1370,27 +1054,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addOffersToArchive_3Async + * Operation addOffersToArchiveAsync * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_3Async($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_3'][0]) + public function addOffersToArchiveAsync($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - return $this->addOffersToArchive_3AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) + return $this->addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1399,21 +1085,21 @@ class ExpressApi } /** - * Operation addOffersToArchive_3AsyncWithHttpInfo + * Operation addOffersToArchiveAsyncWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_3AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_3'][0]) + public function addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - $request = $this->addOffersToArchive_3Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1452,37 +1138,37 @@ class ExpressApi } /** - * Create request for operation 'addOffersToArchive_3' + * Create request for operation 'addOffersToArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addOffersToArchive_3Request($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_3'][0]) + public function addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling addOffersToArchive_3' + 'Missing the required parameter $business_id when calling addOffersToArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.addOffersToArchive_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.addOffersToArchive, must be bigger than or equal to 1.'); } // verify the required parameter 'add_offers_to_archive_request' is set if ($add_offers_to_archive_request === null || (is_array($add_offers_to_archive_request) && count($add_offers_to_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive_3' + 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/archive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1571,38 +1257,38 @@ class ExpressApi } /** - * Operation calculateTariffs_3 + * Operation calculateTariffs * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function calculateTariffs_3($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_3'][0]) + public function calculateTariffs($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - list($response) = $this->calculateTariffs_3WithHttpInfo($calculate_tariffs_request, $contentType); + list($response) = $this->calculateTariffsWithHttpInfo($calculate_tariffs_request, $contentType); return $response; } /** - * Operation calculateTariffs_3WithHttpInfo + * Operation calculateTariffsWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function calculateTariffs_3WithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_3'][0]) + public function calculateTariffsWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - $request = $this->calculateTariffs_3Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1629,196 +1315,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CalculateTariffsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1832,34 +1373,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1869,7 +1387,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1877,7 +1395,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1885,7 +1403,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1893,7 +1411,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1901,7 +1419,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1909,7 +1427,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1917,26 +1435,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation calculateTariffs_3Async + * Operation calculateTariffsAsync * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_3Async($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_3'][0]) + public function calculateTariffsAsync($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - return $this->calculateTariffs_3AsyncWithHttpInfo($calculate_tariffs_request, $contentType) + return $this->calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1945,20 +1465,20 @@ class ExpressApi } /** - * Operation calculateTariffs_3AsyncWithHttpInfo + * Operation calculateTariffsAsyncWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_3AsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_3'][0]) + public function calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - $request = $this->calculateTariffs_3Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1997,26 +1517,26 @@ class ExpressApi } /** - * Create request for operation 'calculateTariffs_3' + * Create request for operation 'calculateTariffs' * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function calculateTariffs_3Request($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_3'][0]) + public function calculateTariffsRequest($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { // verify the required parameter 'calculate_tariffs_request' is set if ($calculate_tariffs_request === null || (is_array($calculate_tariffs_request) && count($calculate_tariffs_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs_3' + 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs' ); } - $resourcePath = '/tariffs/calculate'; + $resourcePath = '/v2/tariffs/calculate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2097,40 +1617,40 @@ class ExpressApi } /** - * Operation confirmBusinessPrices_3 + * Operation confirmBusinessPrices * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmBusinessPrices_3($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_3'][0]) + public function confirmBusinessPrices($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - list($response) = $this->confirmBusinessPrices_3WithHttpInfo($business_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmBusinessPrices_3WithHttpInfo + * Operation confirmBusinessPricesWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmBusinessPrices_3WithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_3'][0]) + public function confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - $request = $this->confirmBusinessPrices_3Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2157,223 +1677,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2387,34 +1741,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2424,7 +1755,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2432,7 +1763,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2440,7 +1771,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2448,7 +1779,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2456,7 +1787,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2464,7 +1795,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2472,7 +1803,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2480,27 +1811,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmBusinessPrices_3Async + * Operation confirmBusinessPricesAsync * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_3Async($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_3'][0]) + public function confirmBusinessPricesAsync($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - return $this->confirmBusinessPrices_3AsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) + return $this->confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2509,21 +1842,21 @@ class ExpressApi } /** - * Operation confirmBusinessPrices_3AsyncWithHttpInfo + * Operation confirmBusinessPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_3AsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_3'][0]) + public function confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmBusinessPrices_3Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2562,37 +1895,37 @@ class ExpressApi } /** - * Create request for operation 'confirmBusinessPrices_3' + * Create request for operation 'confirmBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmBusinessPrices_3Request($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_3'][0]) + public function confirmBusinessPricesRequest($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling confirmBusinessPrices_3' + 'Missing the required parameter $business_id when calling confirmBusinessPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.confirmBusinessPrices_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.confirmBusinessPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices_3' + 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices' ); } - $resourcePath = '/businesses/{businessId}/price-quarantine/confirm'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2681,40 +2014,40 @@ class ExpressApi } /** - * Operation confirmCampaignPrices_3 + * Operation confirmCampaignPrices * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmCampaignPrices_3($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_3'][0]) + public function confirmCampaignPrices($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - list($response) = $this->confirmCampaignPrices_3WithHttpInfo($campaign_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmCampaignPrices_3WithHttpInfo + * Operation confirmCampaignPricesWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmCampaignPrices_3WithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_3'][0]) + public function confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - $request = $this->confirmCampaignPrices_3Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2741,223 +2074,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2971,34 +2138,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3008,7 +2152,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3016,7 +2160,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3024,7 +2168,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3032,7 +2176,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3040,7 +2184,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3048,7 +2192,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3056,7 +2200,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3064,27 +2208,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmCampaignPrices_3Async + * Operation confirmCampaignPricesAsync * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_3Async($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_3'][0]) + public function confirmCampaignPricesAsync($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - return $this->confirmCampaignPrices_3AsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) + return $this->confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3093,21 +2239,21 @@ class ExpressApi } /** - * Operation confirmCampaignPrices_3AsyncWithHttpInfo + * Operation confirmCampaignPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_3AsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_3'][0]) + public function confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmCampaignPrices_3Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3146,37 +2292,37 @@ class ExpressApi } /** - * Create request for operation 'confirmCampaignPrices_3' + * Create request for operation 'confirmCampaignPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmCampaignPrices_3Request($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_3'][0]) + public function confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling confirmCampaignPrices_3' + 'Missing the required parameter $campaign_id when calling confirmCampaignPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.confirmCampaignPrices_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.confirmCampaignPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices_3' + 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3265,40 +2411,40 @@ class ExpressApi } /** - * Operation createChat_3 + * Operation createChat * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function createChat_3($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_3'][0]) + public function createChat($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - list($response) = $this->createChat_3WithHttpInfo($business_id, $create_chat_request, $contentType); + list($response) = $this->createChatWithHttpInfo($business_id, $create_chat_request, $contentType); return $response; } /** - * Operation createChat_3WithHttpInfo + * Operation createChatWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createChat_3WithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_3'][0]) + public function createChatWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - $request = $this->createChat_3Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3325,196 +2471,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateChatResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateChatResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateChatResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3528,34 +2529,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3565,7 +2543,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3573,7 +2551,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3581,7 +2559,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3589,7 +2567,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3597,7 +2575,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3605,7 +2583,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3613,27 +2591,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation createChat_3Async + * Operation createChatAsync * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_3Async($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_3'][0]) + public function createChatAsync($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - return $this->createChat_3AsyncWithHttpInfo($business_id, $create_chat_request, $contentType) + return $this->createChatAsyncWithHttpInfo($business_id, $create_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3642,21 +2622,21 @@ class ExpressApi } /** - * Operation createChat_3AsyncWithHttpInfo + * Operation createChatAsyncWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_3AsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_3'][0]) + public function createChatAsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - $request = $this->createChat_3Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3695,37 +2675,37 @@ class ExpressApi } /** - * Create request for operation 'createChat_3' + * Create request for operation 'createChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createChat_3Request($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_3'][0]) + public function createChatRequest($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling createChat_3' + 'Missing the required parameter $business_id when calling createChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.createChat_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.createChat, must be bigger than or equal to 1.'); } // verify the required parameter 'create_chat_request' is set if ($create_chat_request === null || (is_array($create_chat_request) && count($create_chat_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_chat_request when calling createChat_3' + 'Missing the required parameter $create_chat_request when calling createChat' ); } - $resourcePath = '/businesses/{businessId}/chats/new'; + $resourcePath = '/v2/businesses/{businessId}/chats/new'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3814,40 +2794,40 @@ class ExpressApi } /** - * Operation deleteCampaignOffers_3 + * Operation deleteCampaignOffers * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteCampaignOffers_3($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_3'][0]) + public function deleteCampaignOffers($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - list($response) = $this->deleteCampaignOffers_3WithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); + list($response) = $this->deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); return $response; } /** - * Operation deleteCampaignOffers_3WithHttpInfo + * Operation deleteCampaignOffersWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCampaignOffers_3WithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_3'][0]) + public function deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - $request = $this->deleteCampaignOffers_3Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3874,223 +2854,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4104,34 +2918,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4141,7 +2932,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4149,7 +2940,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4157,7 +2948,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4165,7 +2956,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4173,7 +2964,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4181,7 +2972,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4189,7 +2980,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4197,27 +2988,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteCampaignOffers_3Async + * Operation deleteCampaignOffersAsync * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_3Async($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_3'][0]) + public function deleteCampaignOffersAsync($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - return $this->deleteCampaignOffers_3AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) + return $this->deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4226,21 +3019,21 @@ class ExpressApi } /** - * Operation deleteCampaignOffers_3AsyncWithHttpInfo + * Operation deleteCampaignOffersAsyncWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_3AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_3'][0]) + public function deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - $request = $this->deleteCampaignOffers_3Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4279,37 +3072,37 @@ class ExpressApi } /** - * Create request for operation 'deleteCampaignOffers_3' + * Create request for operation 'deleteCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCampaignOffers_3Request($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_3'][0]) + public function deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteCampaignOffers_3' + 'Missing the required parameter $campaign_id when calling deleteCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.deleteCampaignOffers_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.deleteCampaignOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_campaign_offers_request' is set if ($delete_campaign_offers_request === null || (is_array($delete_campaign_offers_request) && count($delete_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers_3' + 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4398,40 +3191,40 @@ class ExpressApi } /** - * Operation deleteGoodsFeedbackComment_3 + * Operation deleteGoodsFeedbackComment * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteGoodsFeedbackComment_3($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_3'][0]) + public function deleteGoodsFeedbackComment($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - list($response) = $this->deleteGoodsFeedbackComment_3WithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); + list($response) = $this->deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation deleteGoodsFeedbackComment_3WithHttpInfo + * Operation deleteGoodsFeedbackCommentWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteGoodsFeedbackComment_3WithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_3'][0]) + public function deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - $request = $this->deleteGoodsFeedbackComment_3Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4458,196 +3251,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4661,34 +3309,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4698,7 +3323,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4706,7 +3331,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4714,7 +3339,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4722,7 +3347,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4730,7 +3355,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4738,7 +3363,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4746,27 +3371,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteGoodsFeedbackComment_3Async + * Operation deleteGoodsFeedbackCommentAsync * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_3Async($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_3'][0]) + public function deleteGoodsFeedbackCommentAsync($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - return $this->deleteGoodsFeedbackComment_3AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) + return $this->deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4775,21 +3402,21 @@ class ExpressApi } /** - * Operation deleteGoodsFeedbackComment_3AsyncWithHttpInfo + * Operation deleteGoodsFeedbackCommentAsyncWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_3AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_3'][0]) + public function deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteGoodsFeedbackComment_3Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4828,37 +3455,37 @@ class ExpressApi } /** - * Create request for operation 'deleteGoodsFeedbackComment_3' + * Create request for operation 'deleteGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteGoodsFeedbackComment_3Request($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_3'][0]) + public function deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment_3' + 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deleteGoodsFeedbackComment_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deleteGoodsFeedbackComment, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_goods_feedback_comment_request' is set if ($delete_goods_feedback_comment_request === null || (is_array($delete_goods_feedback_comment_request) && count($delete_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment_3' + 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/delete'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4947,40 +3574,40 @@ class ExpressApi } /** - * Operation deleteHiddenOffers_3 + * Operation deleteHiddenOffers * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteHiddenOffers_3($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_3'][0]) + public function deleteHiddenOffers($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - list($response) = $this->deleteHiddenOffers_3WithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); + list($response) = $this->deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); return $response; } /** - * Operation deleteHiddenOffers_3WithHttpInfo + * Operation deleteHiddenOffersWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteHiddenOffers_3WithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_3'][0]) + public function deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - $request = $this->deleteHiddenOffers_3Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5007,223 +3634,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5237,34 +3698,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5274,7 +3712,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5282,7 +3720,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5290,7 +3728,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5298,7 +3736,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5306,7 +3744,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5314,7 +3752,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5322,7 +3760,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5330,27 +3768,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteHiddenOffers_3Async + * Operation deleteHiddenOffersAsync * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_3Async($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_3'][0]) + public function deleteHiddenOffersAsync($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - return $this->deleteHiddenOffers_3AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) + return $this->deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5359,21 +3799,21 @@ class ExpressApi } /** - * Operation deleteHiddenOffers_3AsyncWithHttpInfo + * Operation deleteHiddenOffersAsyncWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_3AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_3'][0]) + public function deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteHiddenOffers_3Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5412,37 +3852,37 @@ class ExpressApi } /** - * Create request for operation 'deleteHiddenOffers_3' + * Create request for operation 'deleteHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteHiddenOffers_3Request($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_3'][0]) + public function deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteHiddenOffers_3' + 'Missing the required parameter $campaign_id when calling deleteHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.deleteHiddenOffers_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.deleteHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_hidden_offers_request' is set if ($delete_hidden_offers_request === null || (is_array($delete_hidden_offers_request) && count($delete_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers_3' + 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5531,40 +3971,40 @@ class ExpressApi } /** - * Operation deleteOffersFromArchive_3 + * Operation deleteOffers * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffersFromArchive_3($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_3'][0]) + public function deleteOffers($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - list($response) = $this->deleteOffersFromArchive_3WithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); + list($response) = $this->deleteOffersWithHttpInfo($business_id, $delete_offers_request, $contentType); return $response; } /** - * Operation deleteOffersFromArchive_3WithHttpInfo + * Operation deleteOffersWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffersFromArchive_3WithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_3'][0]) + public function deleteOffersWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $request = $this->deleteOffersFromArchive_3Request($business_id, $delete_offers_from_archive_request, $contentType); + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5591,223 +4031,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5821,44 +4095,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + '\OpenAPI\Client\Model\DeleteOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5866,7 +4117,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5874,7 +4125,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5882,7 +4133,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5890,7 +4141,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5898,7 +4149,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5906,7 +4157,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5914,27 +4165,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffersFromArchive_3Async + * Operation deleteOffersAsync * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_3Async($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_3'][0]) + public function deleteOffersAsync($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - return $this->deleteOffersFromArchive_3AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) + return $this->deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5943,21 +4196,21 @@ class ExpressApi } /** - * Operation deleteOffersFromArchive_3AsyncWithHttpInfo + * Operation deleteOffersAsyncWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_3AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_3'][0]) + public function deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - $request = $this->deleteOffersFromArchive_3Request($business_id, $delete_offers_from_archive_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5996,37 +4249,37 @@ class ExpressApi } /** - * Create request for operation 'deleteOffersFromArchive_3' + * Create request for operation 'deleteOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffersFromArchive_3Request($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_3'][0]) + public function deleteOffersRequest($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffersFromArchive_3' + 'Missing the required parameter $business_id when calling deleteOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deleteOffersFromArchive_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deleteOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_from_archive_request' is set - if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { + // verify the required parameter 'delete_offers_request' is set + if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive_3' + 'Missing the required parameter $delete_offers_request when calling deleteOffers' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/unarchive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6052,12 +4305,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($delete_offers_from_archive_request)) { + if (isset($delete_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); } else { - $httpBody = $delete_offers_from_archive_request; + $httpBody = $delete_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6115,40 +4368,40 @@ class ExpressApi } /** - * Operation deleteOffers_3 + * Operation deleteOffersFromArchive * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffers_3($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_3'][0]) + public function deleteOffersFromArchive($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - list($response) = $this->deleteOffers_3WithHttpInfo($business_id, $delete_offers_request, $contentType); + list($response) = $this->deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); return $response; } /** - * Operation deleteOffers_3WithHttpInfo + * Operation deleteOffersFromArchiveWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffers_3WithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_3'][0]) + public function deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $request = $this->deleteOffers_3Request($business_id, $delete_offers_request, $contentType); + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6175,223 +4428,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6405,44 +4492,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersResponse', + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6450,7 +4514,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6458,7 +4522,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6466,7 +4530,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6474,7 +4538,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6482,7 +4546,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6490,7 +4554,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6498,27 +4562,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffers_3Async + * Operation deleteOffersFromArchiveAsync * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_3Async($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_3'][0]) + public function deleteOffersFromArchiveAsync($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - return $this->deleteOffers_3AsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) + return $this->deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -6527,21 +4593,21 @@ class ExpressApi } /** - * Operation deleteOffers_3AsyncWithHttpInfo + * Operation deleteOffersFromArchiveAsyncWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_3AsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_3'][0]) + public function deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - $request = $this->deleteOffers_3Request($business_id, $delete_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6580,37 +4646,37 @@ class ExpressApi } /** - * Create request for operation 'deleteOffers_3' + * Create request for operation 'deleteOffersFromArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffers_3Request($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_3'][0]) + public function deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffers_3' + 'Missing the required parameter $business_id when calling deleteOffersFromArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deleteOffers_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deleteOffersFromArchive, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_request' is set - if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { + // verify the required parameter 'delete_offers_from_archive_request' is set + if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_request when calling deleteOffers_3' + 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/delete'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/unarchive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6636,12 +4702,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($delete_offers_request)) { + if (isset($delete_offers_from_archive_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); } else { - $httpBody = $delete_offers_request; + $httpBody = $delete_offers_from_archive_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6699,40 +4765,40 @@ class ExpressApi } /** - * Operation deletePromoOffers_3 + * Operation deletePromoOffers * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deletePromoOffers_3($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_3'][0]) + public function deletePromoOffers($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - list($response) = $this->deletePromoOffers_3WithHttpInfo($business_id, $delete_promo_offers_request, $contentType); + list($response) = $this->deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, $contentType); return $response; } /** - * Operation deletePromoOffers_3WithHttpInfo + * Operation deletePromoOffersWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deletePromoOffers_3WithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_3'][0]) + public function deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - $request = $this->deletePromoOffers_3Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6759,196 +4825,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeletePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6962,34 +4883,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -6999,7 +4897,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7007,7 +4905,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7015,7 +4913,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7023,7 +4921,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7031,7 +4929,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7039,7 +4937,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7047,27 +4945,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deletePromoOffers_3Async + * Operation deletePromoOffersAsync * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_3Async($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_3'][0]) + public function deletePromoOffersAsync($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - return $this->deletePromoOffers_3AsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) + return $this->deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -7076,21 +4976,21 @@ class ExpressApi } /** - * Operation deletePromoOffers_3AsyncWithHttpInfo + * Operation deletePromoOffersAsyncWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_3AsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_3'][0]) + public function deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - $request = $this->deletePromoOffers_3Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7129,37 +5029,37 @@ class ExpressApi } /** - * Create request for operation 'deletePromoOffers_3' + * Create request for operation 'deletePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deletePromoOffers_3Request($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_3'][0]) + public function deletePromoOffersRequest($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deletePromoOffers_3' + 'Missing the required parameter $business_id when calling deletePromoOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deletePromoOffers_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.deletePromoOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_promo_offers_request' is set if ($delete_promo_offers_request === null || (is_array($delete_promo_offers_request) && count($delete_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers_3' + 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/delete'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7248,40 +5148,40 @@ class ExpressApi } /** - * Operation generateBoostConsolidatedReport_3 + * Operation generateBannersStatisticsReport * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateBoostConsolidatedReport_3($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_3'][0]) + public function generateBannersStatisticsReport($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - list($response) = $this->generateBoostConsolidatedReport_3WithHttpInfo($generate_boost_consolidated_request, $format, $contentType); + list($response) = $this->generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format, $contentType); return $response; } /** - * Operation generateBoostConsolidatedReport_3WithHttpInfo + * Operation generateBannersStatisticsReportWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateBoostConsolidatedReport_3WithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_3'][0]) + public function generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - $request = $this->generateBoostConsolidatedReport_3Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -7308,169 +5208,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7484,34 +5260,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -7521,7 +5274,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7529,7 +5282,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7537,7 +5290,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7545,7 +5298,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7553,7 +5306,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7561,27 +5314,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateBoostConsolidatedReport_3Async + * Operation generateBannersStatisticsReportAsync * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_3Async($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_3'][0]) + public function generateBannersStatisticsReportAsync($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - return $this->generateBoostConsolidatedReport_3AsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) + return $this->generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -7590,21 +5345,21 @@ class ExpressApi } /** - * Operation generateBoostConsolidatedReport_3AsyncWithHttpInfo + * Operation generateBannersStatisticsReportAsyncWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_3AsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_3'][0]) + public function generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateBoostConsolidatedReport_3Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7643,28 +5398,28 @@ class ExpressApi } /** - * Create request for operation 'generateBoostConsolidatedReport_3' + * Create request for operation 'generateBannersStatisticsReport' * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateBoostConsolidatedReport_3Request($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_3'][0]) + public function generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - // verify the required parameter 'generate_boost_consolidated_request' is set - if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { + // verify the required parameter 'generate_banners_statistics_request' is set + if ($generate_banners_statistics_request === null || (is_array($generate_banners_statistics_request) && count($generate_banners_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport_3' + 'Missing the required parameter $generate_banners_statistics_request when calling generateBannersStatisticsReport' ); } - $resourcePath = '/reports/boost-consolidated/generate'; + $resourcePath = '/v2/reports/banners-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7691,12 +5446,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_boost_consolidated_request)) { + if (isset($generate_banners_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_banners_statistics_request)); } else { - $httpBody = $generate_boost_consolidated_request; + $httpBody = $generate_banners_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7754,40 +5509,40 @@ class ExpressApi } /** - * Operation generateCompetitorsPositionReport_3 + * Operation generateBoostConsolidatedReport * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateCompetitorsPositionReport_3($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_3'][0]) + public function generateBoostConsolidatedReport($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - list($response) = $this->generateCompetitorsPositionReport_3WithHttpInfo($generate_competitors_position_report_request, $format, $contentType); + list($response) = $this->generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format, $contentType); return $response; } /** - * Operation generateCompetitorsPositionReport_3WithHttpInfo + * Operation generateBoostConsolidatedReportWithHttpInfo * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateCompetitorsPositionReport_3WithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_3'][0]) + public function generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - $request = $this->generateCompetitorsPositionReport_3Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -7814,169 +5569,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7990,34 +5621,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8027,7 +5635,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8035,7 +5643,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8043,7 +5651,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8051,7 +5659,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8059,7 +5667,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8067,27 +5675,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateCompetitorsPositionReport_3Async + * Operation generateBoostConsolidatedReportAsync * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_3Async($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_3'][0]) + public function generateBoostConsolidatedReportAsync($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - return $this->generateCompetitorsPositionReport_3AsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) + return $this->generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -8096,21 +5706,21 @@ class ExpressApi } /** - * Operation generateCompetitorsPositionReport_3AsyncWithHttpInfo + * Operation generateBoostConsolidatedReportAsyncWithHttpInfo * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_3AsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_3'][0]) + public function generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateCompetitorsPositionReport_3Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8149,28 +5759,28 @@ class ExpressApi } /** - * Create request for operation 'generateCompetitorsPositionReport_3' + * Create request for operation 'generateBoostConsolidatedReport' * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateCompetitorsPositionReport_3Request($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_3'][0]) + public function generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - // verify the required parameter 'generate_competitors_position_report_request' is set - if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { + // verify the required parameter 'generate_boost_consolidated_request' is set + if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport_3' + 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport' ); } - $resourcePath = '/reports/competitors-position/generate'; + $resourcePath = '/v2/reports/boost-consolidated/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8197,12 +5807,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_competitors_position_report_request)) { + if (isset($generate_boost_consolidated_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); } else { - $httpBody = $generate_competitors_position_report_request; + $httpBody = $generate_boost_consolidated_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8260,40 +5870,40 @@ class ExpressApi } /** - * Operation generateGoodsFeedbackReport_3 + * Operation generateClosureDocumentsDetalizationReport * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsFeedbackReport_3($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_3'][0]) + public function generateClosureDocumentsDetalizationReport($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - list($response) = $this->generateGoodsFeedbackReport_3WithHttpInfo($generate_goods_feedback_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType); return $response; } /** - * Operation generateGoodsFeedbackReport_3WithHttpInfo + * Operation generateClosureDocumentsDetalizationReportWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsFeedbackReport_3WithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_3'][0]) + public function generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - $request = $this->generateGoodsFeedbackReport_3Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -8320,169 +5930,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8496,34 +5988,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8533,7 +6002,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8541,7 +6010,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8549,7 +6018,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8557,7 +6026,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8565,7 +6042,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8573,27 +6050,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsFeedbackReport_3Async + * Operation generateClosureDocumentsDetalizationReportAsync * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_3Async($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_3'][0]) + public function generateClosureDocumentsDetalizationReportAsync($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - return $this->generateGoodsFeedbackReport_3AsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) + return $this->generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -8602,21 +6081,21 @@ class ExpressApi } /** - * Operation generateGoodsFeedbackReport_3AsyncWithHttpInfo + * Operation generateClosureDocumentsDetalizationReportAsyncWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_3AsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_3'][0]) + public function generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsFeedbackReport_3Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8655,28 +6134,28 @@ class ExpressApi } /** - * Create request for operation 'generateGoodsFeedbackReport_3' + * Create request for operation 'generateClosureDocumentsDetalizationReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsFeedbackReport_3Request($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_3'][0]) + public function generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - // verify the required parameter 'generate_goods_feedback_request' is set - if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { + // verify the required parameter 'generate_closure_documents_detalization_request' is set + if ($generate_closure_documents_detalization_request === null || (is_array($generate_closure_documents_detalization_request) && count($generate_closure_documents_detalization_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport_3' + 'Missing the required parameter $generate_closure_documents_detalization_request when calling generateClosureDocumentsDetalizationReport' ); } - $resourcePath = '/reports/goods-feedback/generate'; + $resourcePath = '/v2/reports/closure-documents/detalization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8703,12 +6182,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_goods_feedback_request)) { + if (isset($generate_closure_documents_detalization_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_detalization_request)); } else { - $httpBody = $generate_goods_feedback_request; + $httpBody = $generate_closure_documents_detalization_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8766,40 +6245,38 @@ class ExpressApi } /** - * Operation generateGoodsRealizationReport_2 + * Operation generateClosureDocumentsReport * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsRealizationReport_2($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_2'][0]) + public function generateClosureDocumentsReport($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - list($response) = $this->generateGoodsRealizationReport_2WithHttpInfo($generate_goods_realization_report_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, $contentType); return $response; } /** - * Operation generateGoodsRealizationReport_2WithHttpInfo + * Operation generateClosureDocumentsReportWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsRealizationReport_2WithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_2'][0]) + public function generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - $request = $this->generateGoodsRealizationReport_2Request($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -8826,169 +6303,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9002,34 +6355,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9039,7 +6369,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9047,7 +6377,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9055,7 +6385,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9063,7 +6393,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9071,7 +6401,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9079,27 +6409,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsRealizationReport_2Async + * Operation generateClosureDocumentsReportAsync * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReport_2Async($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_2'][0]) + public function generateClosureDocumentsReportAsync($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - return $this->generateGoodsRealizationReport_2AsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) + return $this->generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, $contentType) ->then( function ($response) { return $response[0]; @@ -9108,21 +6439,20 @@ class ExpressApi } /** - * Operation generateGoodsRealizationReport_2AsyncWithHttpInfo + * Operation generateClosureDocumentsReportAsyncWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReport_2AsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_2'][0]) + public function generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsRealizationReport_2Request($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9161,43 +6491,32 @@ class ExpressApi } /** - * Create request for operation 'generateGoodsRealizationReport_2' + * Create request for operation 'generateClosureDocumentsReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsRealizationReport_2Request($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_2'][0]) + public function generateClosureDocumentsReportRequest($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - // verify the required parameter 'generate_goods_realization_report_request' is set - if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { + // verify the required parameter 'generate_closure_documents_request' is set + if ($generate_closure_documents_request === null || (is_array($generate_closure_documents_request) && count($generate_closure_documents_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport_2' + 'Missing the required parameter $generate_closure_documents_request when calling generateClosureDocumentsReport' ); } - - $resourcePath = '/reports/goods-realization/generate'; + $resourcePath = '/v2/reports/closure-documents/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -9209,12 +6528,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_goods_realization_report_request)) { + if (isset($generate_closure_documents_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_request)); } else { - $httpBody = $generate_goods_realization_report_request; + $httpBody = $generate_closure_documents_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9272,40 +6591,40 @@ class ExpressApi } /** - * Operation generateMassOrderLabelsReport_2 + * Operation generateCompetitorsPositionReport * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateMassOrderLabelsReport_2($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_2'][0]) + public function generateCompetitorsPositionReport($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - list($response) = $this->generateMassOrderLabelsReport_2WithHttpInfo($generate_mass_order_labels_request, $format, $contentType); + list($response) = $this->generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format, $contentType); return $response; } /** - * Operation generateMassOrderLabelsReport_2WithHttpInfo + * Operation generateCompetitorsPositionReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateMassOrderLabelsReport_2WithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_2'][0]) + public function generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - $request = $this->generateMassOrderLabelsReport_2Request($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -9332,169 +6651,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9508,34 +6703,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9545,7 +6717,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9553,7 +6725,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9561,7 +6733,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9569,7 +6741,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9577,7 +6749,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9585,27 +6757,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateMassOrderLabelsReport_2Async + * Operation generateCompetitorsPositionReportAsync * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReport_2Async($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_2'][0]) + public function generateCompetitorsPositionReportAsync($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - return $this->generateMassOrderLabelsReport_2AsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) + return $this->generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -9614,21 +6788,21 @@ class ExpressApi } /** - * Operation generateMassOrderLabelsReport_2AsyncWithHttpInfo + * Operation generateCompetitorsPositionReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReport_2AsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_2'][0]) + public function generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateMassOrderLabelsReport_2Request($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9667,28 +6841,28 @@ class ExpressApi } /** - * Create request for operation 'generateMassOrderLabelsReport_2' + * Create request for operation 'generateCompetitorsPositionReport' * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateMassOrderLabelsReport_2Request($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_2'][0]) + public function generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - // verify the required parameter 'generate_mass_order_labels_request' is set - if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { + // verify the required parameter 'generate_competitors_position_report_request' is set + if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport_2' + 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport' ); } - $resourcePath = '/reports/documents/labels/generate'; + $resourcePath = '/v2/reports/competitors-position/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9699,7 +6873,7 @@ class ExpressApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required @@ -9715,12 +6889,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_mass_order_labels_request)) { + if (isset($generate_competitors_position_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); } else { - $httpBody = $generate_mass_order_labels_request; + $httpBody = $generate_competitors_position_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9778,46 +6952,40 @@ class ExpressApi } /** - * Operation generateOrderLabel_2 + * Operation generateGoodsFeedbackReport * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateOrderLabel_2($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_2'][0]) + public function generateGoodsFeedbackReport($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - list($response) = $this->generateOrderLabel_2WithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + list($response) = $this->generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format, $contentType); return $response; } /** - * Operation generateOrderLabel_2WithHttpInfo + * Operation generateGoodsFeedbackReportWithHttpInfo * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateOrderLabel_2WithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_2'][0]) + public function generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $request = $this->generateOrderLabel_2Request($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -9844,196 +7012,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10047,44 +7064,21 @@ class ExpressApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10092,7 +7086,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10100,7 +7094,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10108,15 +7102,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10124,7 +7110,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10132,30 +7118,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateOrderLabel_2Async + * Operation generateGoodsFeedbackReportAsync * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabel_2Async($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_2'][0]) + public function generateGoodsFeedbackReportAsync($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - return $this->generateOrderLabel_2AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType) + return $this->generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -10164,24 +7149,21 @@ class ExpressApi } /** - * Operation generateOrderLabel_2AsyncWithHttpInfo + * Operation generateGoodsFeedbackReportAsyncWithHttpInfo * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabel_2AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_2'][0]) + public function generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $returnType = '\SplFileObject'; - $request = $this->generateOrderLabel_2Request($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10220,55 +7202,28 @@ class ExpressApi } /** - * Create request for operation 'generateOrderLabel_2' + * Create request for operation 'generateGoodsFeedbackReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateOrderLabel_2Request($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_2'][0]) + public function generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling generateOrderLabel_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.generateOrderLabel_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling generateOrderLabel_2' - ); - } - - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling generateOrderLabel_2' - ); - } - - // verify the required parameter 'box_id' is set - if ($box_id === null || (is_array($box_id) && count($box_id) === 0)) { + // verify the required parameter 'generate_goods_feedback_request' is set + if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $box_id when calling generateOrderLabel_2' + 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; + $resourcePath = '/v2/reports/goods-feedback/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10279,55 +7234,30 @@ class ExpressApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($shipment_id !== null) { - $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), - $resourcePath - ); - } - // path params - if ($box_id !== null) { - $resourcePath = str_replace( - '{' . 'boxId' . '}', - ObjectSerializer::toPathValue($box_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + } else { + $httpBody = $generate_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -10375,7 +7305,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10383,42 +7313,40 @@ class ExpressApi } /** - * Operation generateOrderLabels_2 + * Operation generateGoodsPricesReport * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateOrderLabels_2($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_2'][0]) + public function generateGoodsPricesReport($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - list($response) = $this->generateOrderLabels_2WithHttpInfo($campaign_id, $order_id, $format, $contentType); + list($response) = $this->generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format, $contentType); return $response; } /** - * Operation generateOrderLabels_2WithHttpInfo + * Operation generateGoodsPricesReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateOrderLabels_2WithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_2'][0]) + public function generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $request = $this->generateOrderLabels_2Request($campaign_id, $order_id, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -10445,196 +7373,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10648,44 +7425,21 @@ class ExpressApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10693,7 +7447,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10701,7 +7455,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10709,15 +7463,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10725,7 +7471,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10733,28 +7479,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateOrderLabels_2Async + * Operation generateGoodsPricesReportAsync * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabels_2Async($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_2'][0]) + public function generateGoodsPricesReportAsync($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - return $this->generateOrderLabels_2AsyncWithHttpInfo($campaign_id, $order_id, $format, $contentType) + return $this->generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -10763,22 +7510,21 @@ class ExpressApi } /** - * Operation generateOrderLabels_2AsyncWithHttpInfo + * Operation generateGoodsPricesReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabels_2AsyncWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_2'][0]) + public function generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $returnType = '\SplFileObject'; - $request = $this->generateOrderLabels_2Request($campaign_id, $order_id, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10817,39 +7563,28 @@ class ExpressApi } /** - * Create request for operation 'generateOrderLabels_2' + * Create request for operation 'generateGoodsPricesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateOrderLabels_2Request($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_2'][0]) + public function generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling generateOrderLabels_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.generateOrderLabels_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'generate_goods_prices_report_request' is set + if ($generate_goods_prices_report_request === null || (is_array($generate_goods_prices_report_request) && count($generate_goods_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling generateOrderLabels_2' + 'Missing the required parameter $generate_goods_prices_report_request when calling generateGoodsPricesReport' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; + $resourcePath = '/v2/reports/goods-prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10860,39 +7595,30 @@ class ExpressApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_goods_prices_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_prices_report_request)); + } else { + $httpBody = $generate_goods_prices_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -10940,7 +7666,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10948,40 +7674,40 @@ class ExpressApi } /** - * Operation generatePricesReport_3 + * Operation generateGoodsRealizationReport * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generatePricesReport_3($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_3'][0]) + public function generateGoodsRealizationReport($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - list($response) = $this->generatePricesReport_3WithHttpInfo($generate_prices_report_request, $format, $contentType); + list($response) = $this->generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format, $contentType); return $response; } /** - * Operation generatePricesReport_3WithHttpInfo + * Operation generateGoodsRealizationReportWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generatePricesReport_3WithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_3'][0]) + public function generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - $request = $this->generatePricesReport_3Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11008,169 +7734,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11184,34 +7792,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11221,7 +7806,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11229,7 +7814,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11237,7 +7822,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11245,7 +7830,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11253,7 +7846,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11261,27 +7854,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generatePricesReport_3Async + * Operation generateGoodsRealizationReportAsync * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_3Async($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_3'][0]) + public function generateGoodsRealizationReportAsync($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - return $this->generatePricesReport_3AsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) + return $this->generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -11290,21 +7885,21 @@ class ExpressApi } /** - * Operation generatePricesReport_3AsyncWithHttpInfo + * Operation generateGoodsRealizationReportAsyncWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_3AsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_3'][0]) + public function generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generatePricesReport_3Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11343,28 +7938,28 @@ class ExpressApi } /** - * Create request for operation 'generatePricesReport_3' + * Create request for operation 'generateGoodsRealizationReport' * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generatePricesReport_3Request($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_3'][0]) + public function generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - // verify the required parameter 'generate_prices_report_request' is set - if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { + // verify the required parameter 'generate_goods_realization_report_request' is set + if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport_3' + 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport' ); } - $resourcePath = '/reports/prices/generate'; + $resourcePath = '/v2/reports/goods-realization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11391,12 +7986,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_prices_report_request)) { + if (isset($generate_goods_realization_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); } else { - $httpBody = $generate_prices_report_request; + $httpBody = $generate_goods_realization_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11454,40 +8049,40 @@ class ExpressApi } /** - * Operation generateShelfsStatisticsReport_3 + * Operation generateJewelryFiscalReport * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShelfsStatisticsReport_3($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_3'][0]) + public function generateJewelryFiscalReport($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - list($response) = $this->generateShelfsStatisticsReport_3WithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); + list($response) = $this->generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType); return $response; } /** - * Operation generateShelfsStatisticsReport_3WithHttpInfo + * Operation generateJewelryFiscalReportWithHttpInfo * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShelfsStatisticsReport_3WithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_3'][0]) + public function generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - $request = $this->generateShelfsStatisticsReport_3Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11514,169 +8109,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11690,34 +8161,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11727,7 +8175,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11735,7 +8183,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11743,7 +8191,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11751,7 +8199,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11759,7 +8207,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11767,27 +8215,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShelfsStatisticsReport_3Async + * Operation generateJewelryFiscalReportAsync * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_3Async($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_3'][0]) + public function generateJewelryFiscalReportAsync($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - return $this->generateShelfsStatisticsReport_3AsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) + return $this->generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -11796,21 +8246,21 @@ class ExpressApi } /** - * Operation generateShelfsStatisticsReport_3AsyncWithHttpInfo + * Operation generateJewelryFiscalReportAsyncWithHttpInfo * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_3AsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_3'][0]) + public function generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShelfsStatisticsReport_3Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11849,28 +8299,28 @@ class ExpressApi } /** - * Create request for operation 'generateShelfsStatisticsReport_3' + * Create request for operation 'generateJewelryFiscalReport' * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShelfsStatisticsReport_3Request($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_3'][0]) + public function generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - // verify the required parameter 'generate_shelfs_statistics_request' is set - if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { + // verify the required parameter 'generate_jewelry_fiscal_report_request' is set + if ($generate_jewelry_fiscal_report_request === null || (is_array($generate_jewelry_fiscal_report_request) && count($generate_jewelry_fiscal_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport_3' + 'Missing the required parameter $generate_jewelry_fiscal_report_request when calling generateJewelryFiscalReport' ); } - $resourcePath = '/reports/shelf-statistics/generate'; + $resourcePath = '/v2/reports/jewelry-fiscal/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11897,12 +8347,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_shelfs_statistics_request)) { + if (isset($generate_jewelry_fiscal_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_jewelry_fiscal_report_request)); } else { - $httpBody = $generate_shelfs_statistics_request; + $httpBody = $generate_jewelry_fiscal_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11960,40 +8410,40 @@ class ExpressApi } /** - * Operation generateShowsSalesReport_3 + * Operation generateKeyIndicatorsReport * - * Отчет «Аналитика продаж» + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShowsSalesReport_3($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_3'][0]) + public function generateKeyIndicatorsReport($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - list($response) = $this->generateShowsSalesReport_3WithHttpInfo($generate_shows_sales_report_request, $format, $contentType); + list($response) = $this->generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format, $contentType); return $response; } /** - * Operation generateShowsSalesReport_3WithHttpInfo + * Operation generateKeyIndicatorsReportWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShowsSalesReport_3WithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_3'][0]) + public function generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - $request = $this->generateShowsSalesReport_3Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12020,169 +8470,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12196,34 +8522,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12233,7 +8536,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12241,7 +8544,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12249,7 +8552,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12257,7 +8560,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12265,7 +8568,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12273,27 +8576,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShowsSalesReport_3Async + * Operation generateKeyIndicatorsReportAsync * - * Отчет «Аналитика продаж» + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_3Async($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_3'][0]) + public function generateKeyIndicatorsReportAsync($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - return $this->generateShowsSalesReport_3AsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) + return $this->generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12302,21 +8607,21 @@ class ExpressApi } /** - * Operation generateShowsSalesReport_3AsyncWithHttpInfo + * Operation generateKeyIndicatorsReportAsyncWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_3AsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_3'][0]) + public function generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShowsSalesReport_3Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12355,28 +8660,28 @@ class ExpressApi } /** - * Create request for operation 'generateShowsSalesReport_3' + * Create request for operation 'generateKeyIndicatorsReport' * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShowsSalesReport_3Request($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_3'][0]) + public function generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - // verify the required parameter 'generate_shows_sales_report_request' is set - if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { + // verify the required parameter 'generate_key_indicators_request' is set + if ($generate_key_indicators_request === null || (is_array($generate_key_indicators_request) && count($generate_key_indicators_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport_3' + 'Missing the required parameter $generate_key_indicators_request when calling generateKeyIndicatorsReport' ); } - $resourcePath = '/reports/shows-sales/generate'; + $resourcePath = '/v2/reports/key-indicators/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12403,12 +8708,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_shows_sales_report_request)) { + if (isset($generate_key_indicators_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_key_indicators_request)); } else { - $httpBody = $generate_shows_sales_report_request; + $httpBody = $generate_key_indicators_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12466,40 +8771,40 @@ class ExpressApi } /** - * Operation generateStocksOnWarehousesReport_3 + * Operation generateMassOrderLabelsReport * - * Отчет по остаткам на складах + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateStocksOnWarehousesReport_3($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_3'][0]) + public function generateMassOrderLabelsReport($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - list($response) = $this->generateStocksOnWarehousesReport_3WithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + list($response) = $this->generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format, $contentType); return $response; } /** - * Operation generateStocksOnWarehousesReport_3WithHttpInfo + * Operation generateMassOrderLabelsReportWithHttpInfo * - * Отчет по остаткам на складах + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateStocksOnWarehousesReport_3WithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_3'][0]) + public function generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - $request = $this->generateStocksOnWarehousesReport_3Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12526,169 +8831,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12702,34 +8883,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12739,7 +8897,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12747,7 +8905,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12755,7 +8913,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12763,7 +8921,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12771,7 +8929,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12779,27 +8937,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateStocksOnWarehousesReport_3Async + * Operation generateMassOrderLabelsReportAsync * - * Отчет по остаткам на складах + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_3Async($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_3'][0]) + public function generateMassOrderLabelsReportAsync($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - return $this->generateStocksOnWarehousesReport_3AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) + return $this->generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12808,21 +8968,21 @@ class ExpressApi } /** - * Operation generateStocksOnWarehousesReport_3AsyncWithHttpInfo + * Operation generateMassOrderLabelsReportAsyncWithHttpInfo * - * Отчет по остаткам на складах + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_3AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_3'][0]) + public function generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateStocksOnWarehousesReport_3Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12861,28 +9021,28 @@ class ExpressApi } /** - * Create request for operation 'generateStocksOnWarehousesReport_3' + * Create request for operation 'generateMassOrderLabelsReport' * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateStocksOnWarehousesReport_3Request($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_3'][0]) + public function generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set - if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { + // verify the required parameter 'generate_mass_order_labels_request' is set + if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport_3' + 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport' ); } - $resourcePath = '/reports/stocks-on-warehouses/generate'; + $resourcePath = '/v2/reports/documents/labels/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12893,7 +9053,7 @@ class ExpressApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required @@ -12909,12 +9069,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_stocks_on_warehouses_report_request)) { + if (isset($generate_mass_order_labels_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); } else { - $httpBody = $generate_stocks_on_warehouses_report_request; + $httpBody = $generate_mass_order_labels_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12972,40 +9132,40 @@ class ExpressApi } /** - * Operation generateUnitedMarketplaceServicesReport_3 + * Operation generateOfferBarcodes * - * Отчет по стоимости услуг + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedMarketplaceServicesReport_3($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_3'][0]) + public function generateOfferBarcodes($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - list($response) = $this->generateUnitedMarketplaceServicesReport_3WithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType); + list($response) = $this->generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType); return $response; } /** - * Operation generateUnitedMarketplaceServicesReport_3WithHttpInfo + * Operation generateOfferBarcodesWithHttpInfo * - * Отчет по стоимости услуг + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedMarketplaceServicesReport_3WithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_3'][0]) + public function generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $request = $this->generateUnitedMarketplaceServicesReport_3Request($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -13032,169 +9192,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13208,44 +9250,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13253,7 +9272,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13261,7 +9280,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13269,7 +9288,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13277,7 +9296,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13285,27 +9312,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedMarketplaceServicesReport_3Async + * Operation generateOfferBarcodesAsync * - * Отчет по стоимости услуг + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_3Async($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_3'][0]) + public function generateOfferBarcodesAsync($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - return $this->generateUnitedMarketplaceServicesReport_3AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType) + return $this->generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -13314,21 +9343,21 @@ class ExpressApi } /** - * Operation generateUnitedMarketplaceServicesReport_3AsyncWithHttpInfo + * Operation generateOfferBarcodesAsyncWithHttpInfo * - * Отчет по стоимости услуг + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_3AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_3'][0]) + public function generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedMarketplaceServicesReport_3Request($generate_united_marketplace_services_report_request, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse'; + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13367,45 +9396,53 @@ class ExpressApi } /** - * Create request for operation 'generateUnitedMarketplaceServicesReport_3' + * Create request for operation 'generateOfferBarcodes' * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedMarketplaceServicesReport_3Request($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_3'][0]) + public function generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - // verify the required parameter 'generate_united_marketplace_services_report_request' is set - if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport_3' + 'Missing the required parameter $business_id when calling generateOfferBarcodes' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.generateOfferBarcodes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'generate_offer_barcodes_request' is set + if ($generate_offer_barcodes_request === null || (is_array($generate_offer_barcodes_request) && count($generate_offer_barcodes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_offer_barcodes_request when calling generateOfferBarcodes' ); } - - $resourcePath = '/reports/united-marketplace-services/generate'; + $resourcePath = '/v1/businesses/{businessId}/offer-mappings/barcodes/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -13415,12 +9452,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($generate_united_marketplace_services_report_request)) { + if (isset($generate_offer_barcodes_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_offer_barcodes_request)); } else { - $httpBody = $generate_united_marketplace_services_report_request; + $httpBody = $generate_offer_barcodes_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13478,40 +9515,46 @@ class ExpressApi } /** - * Operation generateUnitedNettingReport_3 + * Operation generateOrderLabel * - * Отчет по платежам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedNettingReport_3($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_3'][0]) + public function generateOrderLabel($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - list($response) = $this->generateUnitedNettingReport_3WithHttpInfo($generate_united_netting_report_request, $format, $contentType); + list($response) = $this->generateOrderLabelWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); return $response; } /** - * Operation generateUnitedNettingReport_3WithHttpInfo + * Operation generateOrderLabelWithHttpInfo * - * Отчет по платежам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedNettingReport_3WithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_3'][0]) + public function generateOrderLabelWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - $request = $this->generateUnitedNettingReport_3Request($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -13538,169 +9581,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13714,44 +9639,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13759,7 +9661,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13767,7 +9669,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13775,7 +9677,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13783,7 +9693,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13791,27 +9701,32 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedNettingReport_3Async + * Operation generateOrderLabelAsync * - * Отчет по платежам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_3Async($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_3'][0]) + public function generateOrderLabelAsync($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - return $this->generateUnitedNettingReport_3AsyncWithHttpInfo($generate_united_netting_report_request, $format, $contentType) + return $this->generateOrderLabelAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -13820,21 +9735,24 @@ class ExpressApi } /** - * Operation generateUnitedNettingReport_3AsyncWithHttpInfo + * Operation generateOrderLabelAsyncWithHttpInfo * - * Отчет по платежам + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_3AsyncWithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_3'][0]) + public function generateOrderLabelAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedNettingReport_3Request($generate_united_netting_report_request, $format, $contentType); + $returnType = '\SplFileObject'; + $request = $this->generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13873,28 +9791,55 @@ class ExpressApi } /** - * Create request for operation 'generateUnitedNettingReport_3' + * Create request for operation 'generateOrderLabel' * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedNettingReport_3Request($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_3'][0]) + public function generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - // verify the required parameter 'generate_united_netting_report_request' is set - if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport_3' + 'Missing the required parameter $campaign_id when calling generateOrderLabel' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.generateOrderLabel, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling generateOrderLabel' + ); + } + + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $shipment_id when calling generateOrderLabel' + ); + } + + // verify the required parameter 'box_id' is set + if ($box_id === null || (is_array($box_id) && count($box_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $box_id when calling generateOrderLabel' ); } - $resourcePath = '/reports/united-netting/generate'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13905,30 +9850,55 @@ class ExpressApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), + $resourcePath + ); + } + // path params + if ($box_id !== null) { + $resourcePath = str_replace( + '{' . 'boxId' . '}', + ObjectSerializer::toPathValue($box_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); // for model (json/xml) - if (isset($generate_united_netting_report_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); - } else { - $httpBody = $generate_united_netting_report_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -13976,7 +9946,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13984,40 +9954,42 @@ class ExpressApi } /** - * Operation generateUnitedOrdersReport_3 + * Operation generateOrderLabels * - * Отчет по заказам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedOrdersReport_3($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_3'][0]) + public function generateOrderLabels($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - list($response) = $this->generateUnitedOrdersReport_3WithHttpInfo($generate_united_orders_request, $format, $contentType); + list($response) = $this->generateOrderLabelsWithHttpInfo($campaign_id, $order_id, $format, $contentType); return $response; } /** - * Operation generateUnitedOrdersReport_3WithHttpInfo + * Operation generateOrderLabelsWithHttpInfo * - * Отчет по заказам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedOrdersReport_3WithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_3'][0]) + public function generateOrderLabelsWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - $request = $this->generateUnitedOrdersReport_3Request($generate_united_orders_request, $format, $contentType); + $request = $this->generateOrderLabelsRequest($campaign_id, $order_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14044,169 +10016,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14220,44 +10074,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14265,7 +10096,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14273,7 +10104,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14281,7 +10112,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14289,7 +10128,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14297,27 +10136,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedOrdersReport_3Async + * Operation generateOrderLabelsAsync * - * Отчет по заказам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReport_3Async($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_3'][0]) + public function generateOrderLabelsAsync($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - return $this->generateUnitedOrdersReport_3AsyncWithHttpInfo($generate_united_orders_request, $format, $contentType) + return $this->generateOrderLabelsAsyncWithHttpInfo($campaign_id, $order_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14326,21 +10168,22 @@ class ExpressApi } /** - * Operation generateUnitedOrdersReport_3AsyncWithHttpInfo + * Operation generateOrderLabelsAsyncWithHttpInfo * - * Отчет по заказам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReport_3AsyncWithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_3'][0]) + public function generateOrderLabelsAsyncWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedOrdersReport_3Request($generate_united_orders_request, $format, $contentType); + $returnType = '\SplFileObject'; + $request = $this->generateOrderLabelsRequest($campaign_id, $order_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14379,28 +10222,39 @@ class ExpressApi } /** - * Create request for operation 'generateUnitedOrdersReport_3' + * Create request for operation 'generateOrderLabels' * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedOrdersReport_3Request($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_3'][0]) + public function generateOrderLabelsRequest($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - // verify the required parameter 'generate_united_orders_request' is set - if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport_3' + 'Missing the required parameter $campaign_id when calling generateOrderLabels' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.generateOrderLabels, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling generateOrderLabels' ); } - $resourcePath = '/reports/united-orders/generate'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14411,30 +10265,39 @@ class ExpressApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); // for model (json/xml) - if (isset($generate_united_orders_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); - } else { - $httpBody = $generate_united_orders_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -14482,7 +10345,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14490,44 +10353,42 @@ class ExpressApi } /** - * Operation getAllOffers_2 + * Operation generatePricesReport * - * Все предложения магазина + * Отчет «Цены на рынке» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getAllOffers_2($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_2'][0]) + public function generatePricesReport($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - list($response) = $this->getAllOffers_2WithHttpInfo($campaign_id, $feed_id, $chunk, $contentType); + list($response) = $this->generatePricesReportWithHttpInfo($generate_prices_report_request, $format, $contentType); return $response; } /** - * Operation getAllOffers_2WithHttpInfo + * Operation generatePricesReportWithHttpInfo * - * Все предложения магазина + * Отчет «Цены на рынке» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getAllOffers_2WithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_2'][0]) + public function generatePricesReportWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $request = $this->getAllOffers_2Request($campaign_id, $feed_id, $chunk, $contentType); + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14554,196 +10415,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetAllOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetAllOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetAllOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14757,44 +10467,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetAllOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14802,7 +10489,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14810,7 +10497,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14818,15 +10505,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14834,7 +10513,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14842,29 +10521,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllOffers_2Async + * Operation generatePricesReportAsync * - * Все предложения магазина + * Отчет «Цены на рынке» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getAllOffers_2Async($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_2'][0]) + public function generatePricesReportAsync($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - return $this->getAllOffers_2AsyncWithHttpInfo($campaign_id, $feed_id, $chunk, $contentType) + return $this->generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14873,23 +10553,22 @@ class ExpressApi } /** - * Operation getAllOffers_2AsyncWithHttpInfo + * Operation generatePricesReportAsyncWithHttpInfo * - * Все предложения магазина + * Отчет «Цены на рынке» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getAllOffers_2AsyncWithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_2'][0]) + public function generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - $request = $this->getAllOffers_2Request($campaign_id, $feed_id, $chunk, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14928,34 +10607,29 @@ class ExpressApi } /** - * Create request for operation 'getAllOffers_2' + * Create request for operation 'generatePricesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getAllOffers_2Request($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_2'][0]) + public function generatePricesReportRequest($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_prices_report_request' is set + if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getAllOffers_2' + 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getAllOffers_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/offers/all'; + $resourcePath = '/v2/reports/prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14964,32 +10638,15 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chunk, - 'chunk', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -14999,7 +10656,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_prices_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + } else { + $httpBody = $generate_prices_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -15047,7 +10711,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -15055,44 +10719,40 @@ class ExpressApi } /** - * Operation getBidsInfoForBusiness_3 + * Operation generateSalesGeographyReport * - * Информация об установленных ставках + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBidsInfoForBusiness_3($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_3'][0]) + public function generateSalesGeographyReport($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - list($response) = $this->getBidsInfoForBusiness_3WithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + list($response) = $this->generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format, $contentType); return $response; } /** - * Operation getBidsInfoForBusiness_3WithHttpInfo + * Operation generateSalesGeographyReportWithHttpInfo * - * Информация об установленных ставках + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBidsInfoForBusiness_3WithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_3'][0]) + public function generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $request = $this->getBidsInfoForBusiness_3Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -15119,196 +10779,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15322,44 +10831,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsInfoResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15367,7 +10853,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15375,7 +10861,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15383,15 +10869,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15399,7 +10877,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15407,29 +10885,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsInfoForBusiness_3Async + * Operation generateSalesGeographyReportAsync * - * Информация об установленных ставках + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsInfoForBusiness_3Async($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_3'][0]) + public function generateSalesGeographyReportAsync($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - return $this->getBidsInfoForBusiness_3AsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) + return $this->generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -15438,23 +10916,21 @@ class ExpressApi } /** - * Operation getBidsInfoForBusiness_3AsyncWithHttpInfo + * Operation generateSalesGeographyReportAsyncWithHttpInfo * - * Информация об установленных ставках + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsInfoForBusiness_3AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_3'][0]) + public function generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - $request = $this->getBidsInfoForBusiness_3Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15493,35 +10969,28 @@ class ExpressApi } /** - * Create request for operation 'getBidsInfoForBusiness_3' + * Create request for operation 'generateSalesGeographyReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBidsInfoForBusiness_3Request($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_3'][0]) + public function generateSalesGeographyReportRequest($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_sales_geography_request' is set + if ($generate_sales_geography_request === null || (is_array($generate_sales_geography_request) && count($generate_sales_geography_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsInfoForBusiness_3' + 'Missing the required parameter $generate_sales_geography_request when calling generateSalesGeographyReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBidsInfoForBusiness_3, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/businesses/{businessId}/bids/info'; + $resourcePath = '/v2/reports/sales-geography/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15530,32 +10999,15 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -15565,12 +11017,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_bids_info_request)) { + if (isset($generate_sales_geography_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_sales_geography_request)); } else { - $httpBody = $get_bids_info_request; + $httpBody = $generate_sales_geography_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -15628,40 +11080,40 @@ class ExpressApi } /** - * Operation getBidsRecommendations_3 + * Operation generateShelfsStatisticsReport * - * Рекомендованные ставки для заданных товаров + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBidsRecommendations_3($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_3'][0]) + public function generateShelfsStatisticsReport($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - list($response) = $this->getBidsRecommendations_3WithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); + list($response) = $this->generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); return $response; } /** - * Operation getBidsRecommendations_3WithHttpInfo + * Operation generateShelfsStatisticsReportWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBidsRecommendations_3WithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_3'][0]) + public function generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $request = $this->getBidsRecommendations_3Request($business_id, $get_bids_recommendations_request, $contentType); + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -15688,196 +11140,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15891,44 +11192,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15936,7 +11214,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15944,7 +11222,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15952,15 +11230,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15968,7 +11238,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15976,27 +11246,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsRecommendations_3Async + * Operation generateShelfsStatisticsReportAsync * - * Рекомендованные ставки для заданных товаров + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_3Async($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_3'][0]) + public function generateShelfsStatisticsReportAsync($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - return $this->getBidsRecommendations_3AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) + return $this->generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16005,21 +11277,21 @@ class ExpressApi } /** - * Operation getBidsRecommendations_3AsyncWithHttpInfo + * Operation generateShelfsStatisticsReportAsyncWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_3AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_3'][0]) + public function generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - $request = $this->getBidsRecommendations_3Request($business_id, $get_bids_recommendations_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16058,53 +11330,45 @@ class ExpressApi } /** - * Create request for operation 'getBidsRecommendations_3' + * Create request for operation 'generateShelfsStatisticsReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBidsRecommendations_3Request($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_3'][0]) + public function generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsRecommendations_3' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBidsRecommendations_3, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_bids_recommendations_request' is set - if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { + // verify the required parameter 'generate_shelfs_statistics_request' is set + if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations_3' + 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport' ); } - $resourcePath = '/businesses/{businessId}/bids/recommendations'; + + $resourcePath = '/v2/reports/shelf-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -16114,12 +11378,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_bids_recommendations_request)) { + if (isset($generate_shelfs_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); } else { - $httpBody = $get_bids_recommendations_request; + $httpBody = $generate_shelfs_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -16177,44 +11441,40 @@ class ExpressApi } /** - * Operation getBusinessQuarantineOffers_3 + * Operation generateShowsBoostReport * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessQuarantineOffers_3($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_3'][0]) + public function generateShowsBoostReport($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - list($response) = $this->getBusinessQuarantineOffers_3WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format, $contentType); return $response; } /** - * Operation getBusinessQuarantineOffers_3WithHttpInfo + * Operation generateShowsBoostReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessQuarantineOffers_3WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_3'][0]) + public function generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $request = $this->getBusinessQuarantineOffers_3Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16241,195 +11501,44 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( @@ -16444,44 +11553,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16489,7 +11575,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16497,7 +11583,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16505,15 +11591,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16521,7 +11599,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16529,29 +11607,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessQuarantineOffers_3Async + * Operation generateShowsBoostReportAsync * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_3Async($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_3'][0]) + public function generateShowsBoostReportAsync($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - return $this->getBusinessQuarantineOffers_3AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16560,23 +11638,21 @@ class ExpressApi } /** - * Operation getBusinessQuarantineOffers_3AsyncWithHttpInfo + * Operation generateShowsBoostReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_3AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_3'][0]) + public function generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getBusinessQuarantineOffers_3Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16615,41 +11691,28 @@ class ExpressApi } /** - * Create request for operation 'getBusinessQuarantineOffers_3' + * Create request for operation 'generateShowsBoostReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessQuarantineOffers_3Request($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_3'][0]) + public function generateShowsBoostReportRequest($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers_3' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBusinessQuarantineOffers_3, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_shows_boost_request' is set + if ($generate_shows_boost_request === null || (is_array($generate_shows_boost_request) && count($generate_shows_boost_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers_3' + 'Missing the required parameter $generate_shows_boost_request when calling generateShowsBoostReport' ); } - - $resourcePath = '/businesses/{businessId}/price-quarantine'; + $resourcePath = '/v2/reports/shows-boost/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16658,32 +11721,15 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -16693,12 +11739,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_shows_boost_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_boost_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_shows_boost_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -16756,38 +11802,40 @@ class ExpressApi } /** - * Operation getBusinessSettings_3 + * Operation generateShowsSalesReport * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessSettings_3($business_id, string $contentType = self::contentTypes['getBusinessSettings_3'][0]) + public function generateShowsSalesReport($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - list($response) = $this->getBusinessSettings_3WithHttpInfo($business_id, $contentType); + list($response) = $this->generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format, $contentType); return $response; } /** - * Operation getBusinessSettings_3WithHttpInfo + * Operation generateShowsSalesReportWithHttpInfo * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessSettings_3WithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_3'][0]) + public function generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $request = $this->getBusinessSettings_3Request($business_id, $contentType); + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16814,196 +11862,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17017,44 +11920,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17062,7 +11942,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17070,7 +11950,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17078,7 +11958,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17086,7 +11966,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17094,7 +11974,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17102,26 +11982,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessSettings_3Async + * Operation generateShowsSalesReportAsync * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_3Async($business_id, string $contentType = self::contentTypes['getBusinessSettings_3'][0]) + public function generateShowsSalesReportAsync($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - return $this->getBusinessSettings_3AsyncWithHttpInfo($business_id, $contentType) + return $this->generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -17130,20 +12013,21 @@ class ExpressApi } /** - * Operation getBusinessSettings_3AsyncWithHttpInfo + * Operation generateShowsSalesReportAsyncWithHttpInfo * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_3AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_3'][0]) + public function generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - $request = $this->getBusinessSettings_3Request($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17182,45 +12066,45 @@ class ExpressApi } /** - * Create request for operation 'getBusinessSettings_3' + * Create request for operation 'generateShowsSalesReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessSettings_3Request($business_id, string $contentType = self::contentTypes['getBusinessSettings_3'][0]) + public function generateShowsSalesReportRequest($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_shows_sales_report_request' is set + if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessSettings_3' + 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBusinessSettings_3, must be bigger than or equal to 1.'); - } - - $resourcePath = '/businesses/{businessId}/settings'; + + + $resourcePath = '/v2/reports/shows-sales/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -17230,7 +12114,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_shows_sales_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + } else { + $httpBody = $generate_shows_sales_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17286,38 +12177,40 @@ class ExpressApi } /** - * Operation getCampaignLogins_1 + * Operation generateStocksOnWarehousesReport * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignLogins_1($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_1'][0]) + public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - list($response) = $this->getCampaignLogins_1WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); return $response; } /** - * Operation getCampaignLogins_1WithHttpInfo + * Operation generateStocksOnWarehousesReportWithHttpInfo * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignLogins_1WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_1'][0]) + public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $request = $this->getCampaignLogins_1Request($campaign_id, $contentType); + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -17344,196 +12237,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignLoginsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17547,44 +12295,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignLoginsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17592,7 +12317,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17600,7 +12325,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17608,7 +12333,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17616,7 +12341,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17624,7 +12349,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17632,26 +12357,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignLogins_1Async + * Operation generateStocksOnWarehousesReportAsync * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_1Async($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_1'][0]) + public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - return $this->getCampaignLogins_1AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -17660,20 +12388,21 @@ class ExpressApi } /** - * Operation getCampaignLogins_1AsyncWithHttpInfo + * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_1AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_1'][0]) + public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - $request = $this->getCampaignLogins_1Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17712,45 +12441,45 @@ class ExpressApi } /** - * Create request for operation 'getCampaignLogins_1' + * Create request for operation 'generateStocksOnWarehousesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignLogins_1Request($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_1'][0]) + public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set + if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignLogins_1' + 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignLogins_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/logins'; + + + $resourcePath = '/v2/reports/stocks-on-warehouses/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -17760,7 +12489,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_stocks_on_warehouses_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + } else { + $httpBody = $generate_stocks_on_warehouses_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17808,7 +12544,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17816,44 +12552,42 @@ class ExpressApi } /** - * Operation getCampaignOffers_3 + * Operation generateUnitedMarketplaceServicesReport * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignOffers_3($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_3'][0]) + public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - list($response) = $this->getCampaignOffers_3WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignOffers_3WithHttpInfo + * Operation generateUnitedMarketplaceServicesReportWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignOffers_3WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_3'][0]) + public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $request = $this->getCampaignOffers_3Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -17880,196 +12614,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18083,44 +12672,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18128,7 +12694,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18136,7 +12702,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18144,7 +12710,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18152,7 +12718,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18160,7 +12726,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18168,29 +12734,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignOffers_3Async + * Operation generateUnitedMarketplaceServicesReportAsync * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_3Async($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_3'][0]) + public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - return $this->getCampaignOffers_3AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) + return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -18199,23 +12766,22 @@ class ExpressApi } /** - * Operation getCampaignOffers_3AsyncWithHttpInfo + * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_3AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_3'][0]) + public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - $request = $this->getCampaignOffers_3Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18254,41 +12820,30 @@ class ExpressApi } /** - * Create request for operation 'getCampaignOffers_3' + * Create request for operation 'generateUnitedMarketplaceServicesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignOffers_3Request($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_3'][0]) + public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignOffers_3' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignOffers_3, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_campaign_offers_request' is set - if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + // verify the required parameter 'generate_united_marketplace_services_report_request' is set + if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers_3' + 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' ); } - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/reports/united-marketplace-services/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18297,32 +12852,24 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -18332,12 +12879,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_campaign_offers_request)) { + if (isset($generate_united_marketplace_services_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); } else { - $httpBody = $get_campaign_offers_request; + $httpBody = $generate_united_marketplace_services_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -18395,44 +12942,42 @@ class ExpressApi } /** - * Operation getCampaignQuarantineOffers_3 + * Operation generateUnitedNettingReport * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignQuarantineOffers_3($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_3'][0]) + public function generateUnitedNettingReport($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - list($response) = $this->getCampaignQuarantineOffers_3WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignQuarantineOffers_3WithHttpInfo + * Operation generateUnitedNettingReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignQuarantineOffers_3WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_3'][0]) + public function generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $request = $this->getCampaignQuarantineOffers_3Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -18459,196 +13004,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18662,44 +13062,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18707,7 +13084,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18715,7 +13092,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18723,7 +13100,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18731,7 +13108,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18739,7 +13116,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18747,29 +13124,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignQuarantineOffers_3Async + * Operation generateUnitedNettingReportAsync * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_3Async($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_3'][0]) + public function generateUnitedNettingReportAsync($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - return $this->getCampaignQuarantineOffers_3AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -18778,23 +13156,22 @@ class ExpressApi } /** - * Operation getCampaignQuarantineOffers_3AsyncWithHttpInfo + * Operation generateUnitedNettingReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_3AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_3'][0]) + public function generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getCampaignQuarantineOffers_3Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18833,41 +13210,30 @@ class ExpressApi } /** - * Create request for operation 'getCampaignQuarantineOffers_3' + * Create request for operation 'generateUnitedNettingReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignQuarantineOffers_3Request($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_3'][0]) + public function generateUnitedNettingReportRequest($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers_3' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignQuarantineOffers_3, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_united_netting_report_request' is set + if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers_3' + 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine'; + $resourcePath = '/v2/reports/united-netting/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18876,32 +13242,24 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -18911,12 +13269,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_united_netting_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_united_netting_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -18974,40 +13332,42 @@ class ExpressApi } /** - * Operation getCampaignRegion_3 + * Operation generateUnitedOrdersReport * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignRegion_3($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_3'][0]) + public function generateUnitedOrdersReport($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - list($response) = $this->getCampaignRegion_3WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignRegion_3WithHttpInfo + * Operation generateUnitedOrdersReportWithHttpInfo * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRegion_3WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_3'][0]) + public function generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $request = $this->getCampaignRegion_3Request($campaign_id, $contentType); + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -19034,196 +13394,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignRegionResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19237,44 +13452,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignRegionResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19282,7 +13474,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19290,7 +13482,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19298,7 +13490,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19306,7 +13498,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19314,7 +13506,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19322,27 +13514,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignRegion_3Async + * Operation generateUnitedOrdersReportAsync * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_3Async($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_3'][0]) + public function generateUnitedOrdersReportAsync($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - return $this->getCampaignRegion_3AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -19351,21 +13546,22 @@ class ExpressApi } /** - * Operation getCampaignRegion_3AsyncWithHttpInfo + * Operation generateUnitedOrdersReportAsyncWithHttpInfo * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_3AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_3'][0]) + public function generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - $request = $this->getCampaignRegion_3Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19404,46 +13600,56 @@ class ExpressApi } /** - * Create request for operation 'getCampaignRegion_3' + * Create request for operation 'generateUnitedOrdersReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getCampaignRegion_3Request($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_3'][0]) + public function generateUnitedOrdersReportRequest($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_orders_request' is set + if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignRegion_3' + 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignRegion_3, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/region'; + + + + $resourcePath = '/v2/reports/united-orders/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19453,7 +13659,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_orders_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + } else { + $httpBody = $generate_united_orders_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -19501,7 +13714,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19509,38 +13722,40 @@ class ExpressApi } /** - * Operation getCampaignSettings_2 + * Operation generateUnitedReturnsReport * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignSettings_2($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_2'][0]) + public function generateUnitedReturnsReport($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - list($response) = $this->getCampaignSettings_2WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format, $contentType); return $response; } /** - * Operation getCampaignSettings_2WithHttpInfo + * Operation generateUnitedReturnsReportWithHttpInfo * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignSettings_2WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_2'][0]) + public function generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $request = $this->getCampaignSettings_2Request($campaign_id, $contentType); + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -19567,196 +13782,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19770,44 +13834,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19815,7 +13856,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19823,7 +13864,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19831,15 +13872,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19847,7 +13880,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19855,26 +13888,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignSettings_2Async + * Operation generateUnitedReturnsReportAsync * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_2Async($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_2'][0]) + public function generateUnitedReturnsReportAsync($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - return $this->getCampaignSettings_2AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -19883,20 +13919,21 @@ class ExpressApi } /** - * Operation getCampaignSettings_2AsyncWithHttpInfo + * Operation generateUnitedReturnsReportAsyncWithHttpInfo * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_2AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_2'][0]) + public function generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - $request = $this->getCampaignSettings_2Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19935,45 +13972,45 @@ class ExpressApi } /** - * Create request for operation 'getCampaignSettings_2' + * Create request for operation 'generateUnitedReturnsReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignSettings_2Request($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_2'][0]) + public function generateUnitedReturnsReportRequest($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_returns_request' is set + if ($generate_united_returns_request === null || (is_array($generate_united_returns_request) && count($generate_united_returns_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignSettings_2' + 'Missing the required parameter $generate_united_returns_request when calling generateUnitedReturnsReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignSettings_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/settings'; + + + $resourcePath = '/v2/reports/united-returns/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19983,7 +14020,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_returns_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_returns_request)); + } else { + $httpBody = $generate_united_returns_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -20031,7 +14075,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -20039,38 +14083,36 @@ class ExpressApi } /** - * Operation getCampaign_1 + * Operation getAuthTokenInfo * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaign_1($campaign_id, string $contentType = self::contentTypes['getCampaign_1'][0]) + public function getAuthTokenInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - list($response) = $this->getCampaign_1WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getAuthTokenInfoWithHttpInfo($contentType); return $response; } /** - * Operation getCampaign_1WithHttpInfo + * Operation getAuthTokenInfoWithHttpInfo * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaign_1WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_1'][0]) + public function getAuthTokenInfoWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $request = $this->getCampaign_1Request($campaign_id, $contentType); + $request = $this->getAuthTokenInfoRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -20097,196 +14139,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20300,44 +14191,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignResponse', + '\OpenAPI\Client\Model\GetTokenInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20345,7 +14213,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20353,7 +14221,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20361,15 +14229,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20377,7 +14237,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20385,26 +14245,27 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaign_1Async + * Operation getAuthTokenInfoAsync * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_1Async($campaign_id, string $contentType = self::contentTypes['getCampaign_1'][0]) + public function getAuthTokenInfoAsync(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - return $this->getCampaign_1AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getAuthTokenInfoAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -20413,20 +14274,19 @@ class ExpressApi } /** - * Operation getCampaign_1AsyncWithHttpInfo + * Operation getAuthTokenInfoAsyncWithHttpInfo * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_1AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_1'][0]) + public function getAuthTokenInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - $request = $this->getCampaign_1Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetTokenInfoResponse'; + $request = $this->getAuthTokenInfoRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20465,29 +14325,18 @@ class ExpressApi } /** - * Create request for operation 'getCampaign_1' + * Create request for operation 'getAuthTokenInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaign_1Request($campaign_id, string $contentType = self::contentTypes['getCampaign_1'][0]) + public function getAuthTokenInfoRequest(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaign_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaign_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}'; + $resourcePath = '/v2/auth/token'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20496,14 +14345,6 @@ class ExpressApi - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -20561,7 +14402,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -20569,42 +14410,44 @@ class ExpressApi } /** - * Operation getCampaignsByLogin_1 + * Operation getBidsInfoForBusiness * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignsByLogin_1($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_1'][0]) + public function getBidsInfoForBusiness($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - list($response) = $this->getCampaignsByLogin_1WithHttpInfo($login, $page, $page_size, $contentType); + list($response) = $this->getBidsInfoForBusinessWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $response; } /** - * Operation getCampaignsByLogin_1WithHttpInfo + * Operation getBidsInfoForBusinessWithHttpInfo * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignsByLogin_1WithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_1'][0]) + public function getBidsInfoForBusinessWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $request = $this->getCampaignsByLogin_1Request($login, $page, $page_size, $contentType); + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -20631,196 +14474,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20834,44 +14532,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetBidsInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20879,7 +14554,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20887,7 +14562,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20895,7 +14570,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20903,7 +14578,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20911,7 +14586,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20919,28 +14594,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignsByLogin_1Async + * Operation getBidsInfoForBusinessAsync * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_1Async($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_1'][0]) + public function getBidsInfoForBusinessAsync($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - return $this->getCampaignsByLogin_1AsyncWithHttpInfo($login, $page, $page_size, $contentType) + return $this->getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) ->then( function ($response) { return $response[0]; @@ -20949,22 +14627,23 @@ class ExpressApi } /** - * Operation getCampaignsByLogin_1AsyncWithHttpInfo + * Operation getBidsInfoForBusinessAsyncWithHttpInfo * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_1AsyncWithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_1'][0]) + public function getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaignsByLogin_1Request($login, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21003,33 +14682,38 @@ class ExpressApi } /** - * Create request for operation 'getCampaignsByLogin_1' + * Create request for operation 'getBidsInfoForBusiness' * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignsByLogin_1Request($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_1'][0]) + public function getBidsInfoForBusinessRequest($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - // verify the required parameter 'login' is set - if ($login === null || (is_array($login) && count($login) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $login when calling getCampaignsByLogin_1' + 'Missing the required parameter $business_id when calling getBidsInfoForBusiness' ); } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); + } + - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getCampaignsByLogin_1, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/by_login/{login}'; + $resourcePath = '/v2/businesses/{businessId}/bids/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21038,17 +14722,17 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -21057,10 +14741,10 @@ class ExpressApi // path params - if ($login !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'login' . '}', - ObjectSerializer::toPathValue($login), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -21073,7 +14757,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_bids_info_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + } else { + $httpBody = $get_bids_info_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -21121,7 +14812,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -21129,40 +14820,40 @@ class ExpressApi } /** - * Operation getCampaigns_1 + * Operation getBidsRecommendations * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaigns_1($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_1'][0]) + public function getBidsRecommendations($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - list($response) = $this->getCampaigns_1WithHttpInfo($page, $page_size, $contentType); + list($response) = $this->getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); return $response; } /** - * Operation getCampaigns_1WithHttpInfo + * Operation getBidsRecommendationsWithHttpInfo * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaigns_1WithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_1'][0]) + public function getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $request = $this->getCampaigns_1Request($page, $page_size, $contentType); + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -21189,196 +14880,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21392,44 +14938,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21437,7 +14960,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21445,7 +14968,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21453,7 +14976,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21461,7 +14984,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21469,7 +14992,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21477,27 +15000,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaigns_1Async + * Operation getBidsRecommendationsAsync * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_1Async($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_1'][0]) + public function getBidsRecommendationsAsync($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - return $this->getCampaigns_1AsyncWithHttpInfo($page, $page_size, $contentType) + return $this->getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) ->then( function ($response) { return $response[0]; @@ -21506,21 +15031,21 @@ class ExpressApi } /** - * Operation getCampaigns_1AsyncWithHttpInfo + * Operation getBidsRecommendationsAsyncWithHttpInfo * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_1AsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_1'][0]) + public function getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaigns_1Request($page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21559,51 +15084,53 @@ class ExpressApi } /** - * Create request for operation 'getCampaigns_1' + * Create request for operation 'getBidsRecommendations' * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaigns_1Request($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_1'][0]) + public function getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getCampaigns_1, must be smaller than or equal to 10000.'); + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBidsRecommendations' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBidsRecommendations, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_bids_recommendations_request' is set + if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations' + ); + } - $resourcePath = '/campaigns'; + $resourcePath = '/v2/businesses/{businessId}/bids/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -21613,7 +15140,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_bids_recommendations_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); + } else { + $httpBody = $get_bids_recommendations_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -21661,7 +15195,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -21669,38 +15203,44 @@ class ExpressApi } /** - * Operation getCategoriesMaxSaleQuantum_3 + * Operation getBusinessOrders * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesMaxSaleQuantum_3($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_3'][0]) + public function getBusinessOrders($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - list($response) = $this->getCategoriesMaxSaleQuantum_3WithHttpInfo($get_categories_max_sale_quantum_request, $contentType); + list($response) = $this->getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoriesMaxSaleQuantum_3WithHttpInfo + * Operation getBusinessOrdersWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesMaxSaleQuantum_3WithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_3'][0]) + public function getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $request = $this->getCategoriesMaxSaleQuantum_3Request($get_categories_max_sale_quantum_request, $contentType); + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -21727,196 +15267,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21930,44 +15325,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21975,7 +15347,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21983,7 +15355,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21991,7 +15363,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21999,7 +15371,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22007,7 +15379,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22015,26 +15387,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesMaxSaleQuantum_3Async + * Operation getBusinessOrdersAsync * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_3Async($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_3'][0]) + public function getBusinessOrdersAsync($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - return $this->getCategoriesMaxSaleQuantum_3AsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) + return $this->getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -22043,20 +15420,23 @@ class ExpressApi } /** - * Operation getCategoriesMaxSaleQuantum_3AsyncWithHttpInfo + * Operation getBusinessOrdersAsyncWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_3AsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_3'][0]) + public function getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - $request = $this->getCategoriesMaxSaleQuantum_3Request($get_categories_max_sale_quantum_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessOrdersResponse'; + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22095,34 +15475,78 @@ class ExpressApi } /** - * Create request for operation 'getCategoriesMaxSaleQuantum_3' + * Create request for operation 'getBusinessOrders' * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesMaxSaleQuantum_3Request($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_3'][0]) + public function getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - // verify the required parameter 'get_categories_max_sale_quantum_request' is set - if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessOrders' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_business_orders_request' is set + if ($get_business_orders_request === null || (is_array($get_business_orders_request) && count($get_business_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum_3' + 'Missing the required parameter $get_business_orders_request when calling getBusinessOrders' ); } - $resourcePath = '/categories/max-sale-quantum'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -22132,12 +15556,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_categories_max_sale_quantum_request)) { + if (isset($get_business_orders_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_business_orders_request)); } else { - $httpBody = $get_categories_max_sale_quantum_request; + $httpBody = $get_business_orders_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -22195,38 +15619,44 @@ class ExpressApi } /** - * Operation getCategoriesTree_3 + * Operation getBusinessQuarantineOffers * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesTree_3($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_3'][0]) + public function getBusinessQuarantineOffers($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - list($response) = $this->getCategoriesTree_3WithHttpInfo($get_categories_request, $contentType); + list($response) = $this->getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoriesTree_3WithHttpInfo + * Operation getBusinessQuarantineOffersWithHttpInfo * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesTree_3WithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_3'][0]) + public function getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $request = $this->getCategoriesTree_3Request($get_categories_request, $contentType); + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -22253,196 +15683,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22456,44 +15741,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22501,7 +15763,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22509,7 +15771,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22517,7 +15779,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22525,7 +15787,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22533,7 +15795,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22541,26 +15803,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesTree_3Async + * Operation getBusinessQuarantineOffersAsync * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_3Async($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_3'][0]) + public function getBusinessQuarantineOffersAsync($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - return $this->getCategoriesTree_3AsyncWithHttpInfo($get_categories_request, $contentType) + return $this->getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -22569,20 +15836,23 @@ class ExpressApi } /** - * Operation getCategoriesTree_3AsyncWithHttpInfo + * Operation getBusinessQuarantineOffersAsyncWithHttpInfo * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_3AsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_3'][0]) + public function getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - $request = $this->getCategoriesTree_3Request($get_categories_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22621,28 +15891,78 @@ class ExpressApi } /** - * Create request for operation 'getCategoriesTree_3' + * Create request for operation 'getBusinessQuarantineOffers' * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesTree_3Request($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_3'][0]) + public function getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers' + ); + } - $resourcePath = '/categories/tree'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -22652,12 +15972,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_categories_request)) { + if (isset($get_quarantine_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); } else { - $httpBody = $get_categories_request; + $httpBody = $get_quarantine_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -22715,38 +16035,38 @@ class ExpressApi } /** - * Operation getCategoryContentParameters_3 + * Operation getBusinessSettings * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoryContentParameters_3($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_3'][0]) + public function getBusinessSettings($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - list($response) = $this->getCategoryContentParameters_3WithHttpInfo($category_id, $contentType); + list($response) = $this->getBusinessSettingsWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getCategoryContentParameters_3WithHttpInfo + * Operation getBusinessSettingsWithHttpInfo * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoryContentParameters_3WithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_3'][0]) + public function getBusinessSettingsWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $request = $this->getCategoryContentParameters_3Request($category_id, $contentType); + $request = $this->getBusinessSettingsRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -22773,196 +16093,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22976,44 +16151,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23021,7 +16173,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23029,7 +16181,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23037,7 +16189,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23045,7 +16197,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23053,7 +16205,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23061,26 +16213,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoryContentParameters_3Async + * Operation getBusinessSettingsAsync * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_3Async($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_3'][0]) + public function getBusinessSettingsAsync($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - return $this->getCategoryContentParameters_3AsyncWithHttpInfo($category_id, $contentType) + return $this->getBusinessSettingsAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -23089,20 +16243,20 @@ class ExpressApi } /** - * Operation getCategoryContentParameters_3AsyncWithHttpInfo + * Operation getBusinessSettingsAsyncWithHttpInfo * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_3AsyncWithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_3'][0]) + public function getBusinessSettingsAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - $request = $this->getCategoryContentParameters_3Request($category_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; + $request = $this->getBusinessSettingsRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23141,29 +16295,29 @@ class ExpressApi } /** - * Create request for operation 'getCategoryContentParameters_3' + * Create request for operation 'getBusinessSettings' * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoryContentParameters_3Request($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_3'][0]) + public function getBusinessSettingsRequest($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - // verify the required parameter 'category_id' is set - if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $category_id when calling getCategoryContentParameters_3' + 'Missing the required parameter $business_id when calling getBusinessSettings' ); } - if ($category_id < 1) { - throw new \InvalidArgumentException('invalid value for "$category_id" when calling ExpressApi.getCategoryContentParameters_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getBusinessSettings, must be bigger than or equal to 1.'); } - $resourcePath = '/category/{categoryId}/parameters'; + $resourcePath = '/v2/businesses/{businessId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23173,10 +16327,10 @@ class ExpressApi // path params - if ($category_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'categoryId' . '}', - ObjectSerializer::toPathValue($category_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -23245,46 +16399,38 @@ class ExpressApi } /** - * Operation getChatHistory_3 + * Operation getCampaign * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChatHistory_3($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_3'][0]) + public function getCampaign($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - list($response) = $this->getChatHistory_3WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + list($response) = $this->getCampaignWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getChatHistory_3WithHttpInfo + * Operation getCampaignWithHttpInfo * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChatHistory_3WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_3'][0]) + public function getCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $request = $this->getChatHistory_3Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $request = $this->getCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -23311,196 +16457,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatHistoryResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23514,44 +16515,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatHistoryResponse', + '\OpenAPI\Client\Model\GetCampaignResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23559,7 +16537,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23567,7 +16545,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23575,7 +16553,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23583,7 +16561,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23591,7 +16569,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23599,30 +16577,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChatHistory_3Async + * Operation getCampaignAsync * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_3Async($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_3'][0]) + public function getCampaignAsync($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - return $this->getChatHistory_3AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) + return $this->getCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -23631,24 +16607,20 @@ class ExpressApi } /** - * Operation getChatHistory_3AsyncWithHttpInfo + * Operation getCampaignAsyncWithHttpInfo * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_3AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_3'][0]) + public function getCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - $request = $this->getChatHistory_3Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; + $request = $this->getCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23687,92 +16659,42 @@ class ExpressApi } /** - * Create request for operation 'getChatHistory_3' + * Create request for operation 'getCampaign' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChatHistory_3Request($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_3'][0]) + public function getCampaignRequest($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChatHistory_3' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getChatHistory_3, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling getChatHistory_3' + 'Missing the required parameter $campaign_id when calling getCampaign' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.getChatHistory_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaign, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chat_history_request' is set - if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chat_history_request when calling getChatHistory_3' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats/history'; + $resourcePath = '/v2/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -23785,14 +16707,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_chat_history_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); - } else { - $httpBody = $get_chat_history_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -23840,7 +16755,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -23848,44 +16763,44 @@ class ExpressApi } /** - * Operation getChats_3 + * Operation getCampaignOffers * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChats_3($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_3'][0]) + public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - list($response) = $this->getChats_3WithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); + list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getChats_3WithHttpInfo + * Operation getCampaignOffersWithHttpInfo * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChats_3WithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_3'][0]) + public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $request = $this->getChats_3Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -23912,196 +16827,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24115,44 +16885,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatsResponse', + '\OpenAPI\Client\Model\GetCampaignOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24160,7 +16907,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24168,7 +16915,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24176,7 +16923,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24184,7 +16931,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24192,7 +16939,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24200,29 +16947,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChats_3Async + * Operation getCampaignOffersAsync * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_3Async($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_3'][0]) + public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - return $this->getChats_3AsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) + return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -24231,23 +16980,23 @@ class ExpressApi } /** - * Operation getChats_3AsyncWithHttpInfo + * Operation getCampaignOffersAsyncWithHttpInfo * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_3AsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_3'][0]) + public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - $request = $this->getChats_3Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24286,41 +17035,44 @@ class ExpressApi } /** - * Create request for operation 'getChats_3' + * Create request for operation 'getCampaignOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChats_3Request($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_3'][0]) + public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChats_3' + 'Missing the required parameter $campaign_id when calling getCampaignOffers' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getChats_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chats_request' is set - if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { + // verify the required parameter 'get_campaign_offers_request' is set + if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_chats_request when calling getChats_3' + 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/chats'; + $resourcePath = '/v2/campaigns/{campaignId}/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24348,10 +17100,10 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -24364,12 +17116,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_chats_request)) { + if (isset($get_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); } else { - $httpBody = $get_chats_request; + $httpBody = $get_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -24427,36 +17179,44 @@ class ExpressApi } /** - * Operation getDeliveryServices_2 + * Operation getCampaignQuarantineOffers * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getDeliveryServices_2(string $contentType = self::contentTypes['getDeliveryServices_2'][0]) + public function getCampaignQuarantineOffers($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - list($response) = $this->getDeliveryServices_2WithHttpInfo($contentType); + list($response) = $this->getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getDeliveryServices_2WithHttpInfo + * Operation getCampaignQuarantineOffersWithHttpInfo * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getDeliveryServices_2WithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices_2'][0]) + public function getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $request = $this->getDeliveryServices_2Request($contentType); + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -24483,196 +17243,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetDeliveryServicesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24686,44 +17301,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24731,7 +17323,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24739,7 +17331,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24747,7 +17339,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24755,7 +17347,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24763,7 +17355,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24771,25 +17363,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getDeliveryServices_2Async + * Operation getCampaignQuarantineOffersAsync * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryServices_2Async(string $contentType = self::contentTypes['getDeliveryServices_2'][0]) + public function getCampaignQuarantineOffersAsync($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - return $this->getDeliveryServices_2AsyncWithHttpInfo($contentType) + return $this->getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -24798,19 +17396,23 @@ class ExpressApi } /** - * Operation getDeliveryServices_2AsyncWithHttpInfo + * Operation getCampaignQuarantineOffersAsyncWithHttpInfo * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryServices_2AsyncWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices_2'][0]) + public function getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - $request = $this->getDeliveryServices_2Request($contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24849,26 +17451,78 @@ class ExpressApi } /** - * Create request for operation 'getDeliveryServices_2' + * Create request for operation 'getCampaignQuarantineOffers' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeliveryServices_2Request(string $contentType = self::contentTypes['getDeliveryServices_2'][0]) + public function getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + - $resourcePath = '/delivery/services'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -24878,7 +17532,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_quarantine_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + } else { + $httpBody = $get_quarantine_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -24926,7 +17587,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -24934,50 +17595,38 @@ class ExpressApi } /** - * Operation getFeedIndexLogs_2 + * Operation getCampaignSettings * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeedIndexLogs_2($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_2'][0]) + public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - list($response) = $this->getFeedIndexLogs_2WithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getFeedIndexLogs_2WithHttpInfo + * Operation getCampaignSettingsWithHttpInfo * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedIndexLogs_2WithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_2'][0]) + public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $request = $this->getFeedIndexLogs_2Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -25004,196 +17653,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25207,44 +17711,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25252,7 +17733,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25260,7 +17741,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25268,7 +17749,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25276,7 +17757,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25284,7 +17765,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25292,32 +17773,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedIndexLogs_2Async + * Operation getCampaignSettingsAsync * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_2Async($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_2'][0]) + public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - return $this->getFeedIndexLogs_2AsyncWithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType) + return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -25326,26 +17803,20 @@ class ExpressApi } /** - * Operation getFeedIndexLogs_2AsyncWithHttpInfo + * Operation getCampaignSettingsAsyncWithHttpInfo * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_2AsyncWithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_2'][0]) + public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - $request = $this->getFeedIndexLogs_2Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25384,88 +17855,35 @@ class ExpressApi } /** - * Create request for operation 'getFeedIndexLogs_2' + * Create request for operation 'getCampaignSettings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeedIndexLogs_2Request($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_2'][0]) + public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedIndexLogs_2' + 'Missing the required parameter $campaign_id when calling getCampaignSettings' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getFeedIndexLogs_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getCampaignSettings, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeedIndexLogs_2' - ); - } - - - - - - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/index-logs'; + $resourcePath = '/v2/campaigns/{campaignId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_from, - 'published_time_from', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_to, - 'published_time_to', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'FeedIndexLogsStatusType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -25476,14 +17894,6 @@ class ExpressApi $resourcePath ); } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -25549,42 +17959,40 @@ class ExpressApi } /** - * Operation getFeed_2 + * Operation getCampaigns * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_2'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeed_2($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_2'][0]) + public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - list($response) = $this->getFeed_2WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); return $response; } /** - * Operation getFeed_2WithHttpInfo + * Operation getCampaignsWithHttpInfo * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_2'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeed_2WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_2'][0]) + public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $request = $this->getFeed_2Request($campaign_id, $feed_id, $contentType); + $request = $this->getCampaignsRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -25611,196 +18019,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25814,44 +18077,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedResponse', + '\OpenAPI\Client\Model\GetCampaignsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25859,7 +18099,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25867,7 +18107,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25875,7 +18115,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25883,7 +18123,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25891,7 +18131,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25899,28 +18139,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeed_2Async + * Operation getCampaignsAsync * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_2'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_2Async($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_2'][0]) + public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - return $this->getFeed_2AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -25929,22 +18170,21 @@ class ExpressApi } /** - * Operation getFeed_2AsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_2'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_2AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_2'][0]) + public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - $request = $this->getFeed_2Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; + $request = $this->getCampaignsRequest($page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25983,62 +18223,51 @@ class ExpressApi } /** - * Create request for operation 'getFeed_2' + * Create request for operation 'getCampaigns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_2'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeed_2Request($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_2'][0]) + public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeed_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getFeed_2, must be bigger than or equal to 1.'); + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getCampaigns, must be smaller than or equal to 10000.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeed_2' - ); - } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}'; + $resourcePath = '/v2/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -26104,46 +18333,40 @@ class ExpressApi } /** - * Operation getFeedbackAndCommentUpdates_3 + * Operation getCategoriesMaxSaleQuantum * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getFeedbackAndCommentUpdates_3($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_3'][0]) + public function getCategoriesMaxSaleQuantum($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - list($response) = $this->getFeedbackAndCommentUpdates_3WithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType); + list($response) = $this->getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, $contentType); return $response; } /** - * Operation getFeedbackAndCommentUpdates_3WithHttpInfo + * Operation getCategoriesMaxSaleQuantumWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getFeedbackAndCommentUpdates_3WithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_3'][0]) + public function getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $request = $this->getFeedbackAndCommentUpdates_3Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -26170,196 +18393,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedbackListResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26373,44 +18451,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedbackListResponse', + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26418,7 +18473,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26426,7 +18481,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26434,7 +18489,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26442,7 +18497,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26450,7 +18505,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26458,30 +18513,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedbackAndCommentUpdates_3Async + * Operation getCategoriesMaxSaleQuantumAsync * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getFeedbackAndCommentUpdates_3Async($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_3'][0]) + public function getCategoriesMaxSaleQuantumAsync($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - return $this->getFeedbackAndCommentUpdates_3AsyncWithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType) + return $this->getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) ->then( function ($response) { return $response[0]; @@ -26490,24 +18544,21 @@ class ExpressApi } /** - * Operation getFeedbackAndCommentUpdates_3AsyncWithHttpInfo + * Operation getCategoriesMaxSaleQuantumAsyncWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getFeedbackAndCommentUpdates_3AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_3'][0]) + public function getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - $request = $this->getFeedbackAndCommentUpdates_3Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26546,79 +18597,35 @@ class ExpressApi } /** - * Create request for operation 'getFeedbackAndCommentUpdates_3' + * Create request for operation 'getCategoriesMaxSaleQuantum' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getFeedbackAndCommentUpdates_3Request($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_3'][0]) + public function getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'get_categories_max_sale_quantum_request' is set + if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedbackAndCommentUpdates_3' + 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getFeedbackAndCommentUpdates_3, must be bigger than or equal to 1.'); - } - - - - $resourcePath = '/campaigns/{campaignId}/feedback/updates'; + $resourcePath = '/v2/categories/max-sale-quantum'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'from_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -26628,7 +18635,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_categories_max_sale_quantum_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + } else { + $httpBody = $get_categories_max_sale_quantum_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -26676,7 +18690,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -26684,40 +18698,38 @@ class ExpressApi } /** - * Operation getFeeds_2 + * Operation getCategoriesTree * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeeds_2($campaign_id, string $contentType = self::contentTypes['getFeeds_2'][0]) + public function getCategoriesTree($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - list($response) = $this->getFeeds_2WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getCategoriesTreeWithHttpInfo($get_categories_request, $contentType); return $response; } /** - * Operation getFeeds_2WithHttpInfo + * Operation getCategoriesTreeWithHttpInfo * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeeds_2WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_2'][0]) + public function getCategoriesTreeWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $request = $this->getFeeds_2Request($campaign_id, $contentType); + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -26744,196 +18756,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26947,44 +18814,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedsResponse', + '\OpenAPI\Client\Model\GetCategoriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26992,7 +18836,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27000,7 +18844,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27008,7 +18852,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27016,7 +18860,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27024,7 +18868,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27032,27 +18876,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeeds_2Async + * Operation getCategoriesTreeAsync * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeeds_2Async($campaign_id, string $contentType = self::contentTypes['getFeeds_2'][0]) + public function getCategoriesTreeAsync($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - return $this->getFeeds_2AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getCategoriesTreeAsyncWithHttpInfo($get_categories_request, $contentType) ->then( function ($response) { return $response[0]; @@ -27061,21 +18906,20 @@ class ExpressApi } /** - * Operation getFeeds_2AsyncWithHttpInfo + * Operation getCategoriesTreeAsyncWithHttpInfo * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeeds_2AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_2'][0]) + public function getCategoriesTreeAsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - $request = $this->getFeeds_2Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27114,30 +18958,20 @@ class ExpressApi } /** - * Create request for operation 'getFeeds_2' + * Create request for operation 'getCategoriesTree' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeeds_2Request($campaign_id, string $contentType = self::contentTypes['getFeeds_2'][0]) + public function getCategoriesTreeRequest($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeeds_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getFeeds_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/feeds'; + + $resourcePath = '/v2/categories/tree'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27146,14 +18980,6 @@ class ExpressApi - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -27163,7 +18989,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_categories_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + } else { + $httpBody = $get_categories_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -27211,7 +19044,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -27219,44 +19052,40 @@ class ExpressApi } /** - * Operation getGoodsFeedbackComments_3 + * Operation getCategoryContentParameters * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_3'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbackComments_3($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_3'][0]) + public function getCategoryContentParameters($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - list($response) = $this->getGoodsFeedbackComments_3WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $business_id, $contentType); return $response; } /** - * Operation getGoodsFeedbackComments_3WithHttpInfo + * Operation getCategoryContentParametersWithHttpInfo * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_3'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbackComments_3WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_3'][0]) + public function getCategoryContentParametersWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $request = $this->getGoodsFeedbackComments_3Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27283,196 +19112,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -27486,44 +19170,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27531,7 +19192,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27539,7 +19200,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27547,7 +19208,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27555,7 +19216,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27563,7 +19224,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27571,29 +19232,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbackComments_3Async + * Operation getCategoryContentParametersAsync * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_3'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_3Async($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_3'][0]) + public function getCategoryContentParametersAsync($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - return $this->getGoodsFeedbackComments_3AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) + return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -27602,23 +19263,21 @@ class ExpressApi } /** - * Operation getGoodsFeedbackComments_3AsyncWithHttpInfo + * Operation getCategoryContentParametersAsyncWithHttpInfo * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_3'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_3AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_3'][0]) + public function getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - $request = $this->getGoodsFeedbackComments_3Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27657,41 +19316,34 @@ class ExpressApi } /** - * Create request for operation 'getGoodsFeedbackComments_3' + * Create request for operation 'getCategoryContentParameters' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_3'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbackComments_3Request($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_3'][0]) + public function getCategoryContentParametersRequest($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'category_id' is set + if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbackComments_3' + 'Missing the required parameter $category_id when calling getCategoryContentParameters' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getGoodsFeedbackComments_3, must be bigger than or equal to 1.'); + if ($category_id <= 0) { + throw new \InvalidArgumentException('invalid value for "$category_id" when calling ExpressApi.getCategoryContentParameters, must be bigger than 0.'); } - // verify the required parameter 'get_goods_feedback_comments_request' is set - if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments_3' - ); + if ($business_id !== null && $business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getCategoryContentParameters, must be bigger than or equal to 1.'); } + - - - - $resourcePath = '/businesses/{businessId}/goods-feedback/comments'; + $resourcePath = '/v2/category/{categoryId}/parameters'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27700,17 +19352,8 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $business_id, + 'businessId', // param base name 'integer', // openApiType '', // style false, // explode @@ -27719,10 +19362,10 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($category_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'categoryId' . '}', + ObjectSerializer::toPathValue($category_id), $resourcePath ); } @@ -27735,14 +19378,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_goods_feedback_comments_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); - } else { - $httpBody = $get_goods_feedback_comments_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -27798,44 +19434,40 @@ class ExpressApi } /** - * Operation getGoodsFeedbacks_3 + * Operation getChat * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbacks_3($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_3'][0]) + public function getChat($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - list($response) = $this->getGoodsFeedbacks_3WithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + list($response) = $this->getChatWithHttpInfo($business_id, $chat_id, $contentType); return $response; } /** - * Operation getGoodsFeedbacks_3WithHttpInfo + * Operation getChatWithHttpInfo * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbacks_3WithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_3'][0]) + public function getChatWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $request = $this->getGoodsFeedbacks_3Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $request = $this->getChatRequest($business_id, $chat_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27862,196 +19494,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -28065,44 +19552,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + '\OpenAPI\Client\Model\GetChatResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28110,7 +19574,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28118,7 +19582,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28126,7 +19590,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28134,7 +19598,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28142,7 +19606,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28150,29 +19614,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbacks_3Async + * Operation getChatAsync * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_3Async($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_3'][0]) + public function getChatAsync($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - return $this->getGoodsFeedbacks_3AsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) + return $this->getChatAsyncWithHttpInfo($business_id, $chat_id, $contentType) ->then( function ($response) { return $response[0]; @@ -28181,23 +19645,21 @@ class ExpressApi } /** - * Operation getGoodsFeedbacks_3AsyncWithHttpInfo + * Operation getChatAsyncWithHttpInfo * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_3AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_3'][0]) + public function getChatAsyncWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - $request = $this->getGoodsFeedbacks_3Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatResponse'; + $request = $this->getChatRequest($business_id, $chat_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28236,35 +19698,40 @@ class ExpressApi } /** - * Create request for operation 'getGoodsFeedbacks_3' + * Create request for operation 'getChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbacks_3Request($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_3'][0]) + public function getChatRequest($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbacks_3' + 'Missing the required parameter $business_id when calling getChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getGoodsFeedbacks_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.getChat, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/businesses/{businessId}/goods-feedback'; + $resourcePath = '/v2/businesses/{businessId}/chat'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28273,21 +19740,12 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); @@ -28308,14 +19766,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_goods_feedback_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); - } else { - $httpBody = $get_goods_feedback_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -28363,7 +19814,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -28371,40 +19822,46 @@ class ExpressApi } /** - * Operation getGoodsStats_2 + * Operation getChatHistory * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsStats_2($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_2'][0]) + public function getChatHistory($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - list($response) = $this->getGoodsStats_2WithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); + list($response) = $this->getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getGoodsStats_2WithHttpInfo + * Operation getChatHistoryWithHttpInfo * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsStats_2WithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_2'][0]) + public function getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $request = $this->getGoodsStats_2Request($campaign_id, $get_goods_stats_request, $contentType); + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -28431,196 +19888,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -28634,44 +19946,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsStatsResponse', + '\OpenAPI\Client\Model\GetChatHistoryResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28679,7 +19968,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28687,7 +19976,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28695,7 +19984,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28703,7 +19992,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28711,7 +20000,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28719,27 +20008,32 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsStats_2Async + * Operation getChatHistoryAsync * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_2Async($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_2'][0]) + public function getChatHistoryAsync($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - return $this->getGoodsStats_2AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) + return $this->getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -28748,21 +20042,24 @@ class ExpressApi } /** - * Operation getGoodsStats_2AsyncWithHttpInfo + * Operation getChatHistoryAsyncWithHttpInfo * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_2AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_2'][0]) + public function getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - $request = $this->getGoodsStats_2Request($campaign_id, $get_goods_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28801,50 +20098,95 @@ class ExpressApi } /** - * Create request for operation 'getGoodsStats_2' + * Create request for operation 'getChatHistory' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsStats_2Request($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_2'][0]) + public function getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getGoodsStats_2' + 'Missing the required parameter $business_id when calling getChatHistory' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getGoodsStats_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getChatHistory, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_goods_stats_request' is set - if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatHistory' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.getChatHistory, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_chat_history_request' is set + if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats_2' + 'Missing the required parameter $get_chat_history_request when calling getChatHistory' ); } - $resourcePath = '/campaigns/{campaignId}/stats/skus'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getChatHistory, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/chats/history'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -28857,12 +20199,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_goods_stats_request)) { + if (isset($get_chat_history_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); } else { - $httpBody = $get_goods_stats_request; + $httpBody = $get_chat_history_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -28920,50 +20262,42 @@ class ExpressApi } /** - * Operation getHiddenOffers_3 + * Operation getChatMessage * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getHiddenOffers_3($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_3'][0]) + public function getChatMessage($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - list($response) = $this->getHiddenOffers_3WithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + list($response) = $this->getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, $contentType); return $response; } /** - * Operation getHiddenOffers_3WithHttpInfo + * Operation getChatMessageWithHttpInfo * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getHiddenOffers_3WithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_3'][0]) + public function getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $request = $this->getHiddenOffers_3Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -28990,169 +20324,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetHiddenOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29166,44 +20382,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetHiddenOffersResponse', + '\OpenAPI\Client\Model\GetChatMessageResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29211,7 +20404,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29219,7 +20412,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29227,7 +20420,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29235,7 +20436,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29243,32 +20444,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getHiddenOffers_3Async + * Operation getChatMessageAsync * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_3Async($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_3'][0]) + public function getChatMessageAsync($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - return $this->getHiddenOffers_3AsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType) + return $this->getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, $contentType) ->then( function ($response) { return $response[0]; @@ -29277,26 +20476,22 @@ class ExpressApi } /** - * Operation getHiddenOffers_3AsyncWithHttpInfo + * Operation getChatMessageAsyncWithHttpInfo * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_3AsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_3'][0]) + public function getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - $request = $this->getHiddenOffers_3Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatMessageResponse'; + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29335,44 +20530,51 @@ class ExpressApi } /** - * Create request for operation 'getHiddenOffers_3' + * Create request for operation 'getChatMessage' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getHiddenOffers_3Request($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_3'][0]) + public function getChatMessageRequest($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getHiddenOffers_3' + 'Missing the required parameter $business_id when calling getChatMessage' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getHiddenOffers_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getChatMessage, must be bigger than or equal to 1.'); } - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getHiddenOffers_3, must be smaller than or equal to 10000.'); + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatMessage' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'message_id' is set + if ($message_id === null || (is_array($message_id) && count($message_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $message_id when calling getChatMessage' + ); + } + if ($message_id < 1) { + throw new \InvalidArgumentException('invalid value for "$message_id" when calling ExpressApi.getChatMessage, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -29381,65 +20583,29 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $message_id, + 'messageId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -29508,44 +20674,44 @@ class ExpressApi } /** - * Operation getOfferCardsContentStatus_3 + * Operation getChats * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferCardsContentStatus_3($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_3'][0]) + public function getChats($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - list($response) = $this->getOfferCardsContentStatus_3WithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + list($response) = $this->getChatsWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferCardsContentStatus_3WithHttpInfo + * Operation getChatsWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferCardsContentStatus_3WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_3'][0]) + public function getChatsWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $request = $this->getOfferCardsContentStatus_3Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -29572,196 +20738,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29775,44 +20796,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + '\OpenAPI\Client\Model\GetChatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29820,7 +20818,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29828,7 +20826,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29836,7 +20834,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29844,7 +20842,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29852,7 +20850,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29860,29 +20858,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferCardsContentStatus_3Async + * Operation getChatsAsync * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_3Async($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_3'][0]) + public function getChatsAsync($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - return $this->getOfferCardsContentStatus_3AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) + return $this->getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -29891,23 +20891,23 @@ class ExpressApi } /** - * Operation getOfferCardsContentStatus_3AsyncWithHttpInfo + * Operation getChatsAsyncWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_3AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_3'][0]) + public function getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - $request = $this->getOfferCardsContentStatus_3Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29946,35 +20946,44 @@ class ExpressApi } /** - * Create request for operation 'getOfferCardsContentStatus_3' + * Create request for operation 'getChats' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferCardsContentStatus_3Request($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_3'][0]) + public function getChatsRequest($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferCardsContentStatus_3' + 'Missing the required parameter $business_id when calling getChats' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getOfferCardsContentStatus_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getChats, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_chats_request' is set + if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chats_request when calling getChats' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getChats, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offer-cards'; + $resourcePath = '/v2/businesses/{businessId}/chats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -30018,12 +21027,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_offer_cards_content_status_request)) { + if (isset($get_chats_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); } else { - $httpBody = $get_offer_cards_content_status_request; + $httpBody = $get_chats_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -30081,58 +21090,44 @@ class ExpressApi } /** - * Operation getOfferMappingEntries_2 + * Operation getDefaultPrices * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappingEntries_2($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_2'][0]) + public function getDefaultPrices($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - list($response) = $this->getOfferMappingEntries_2WithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + list($response) = $this->getDefaultPricesWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $response; } /** - * Operation getOfferMappingEntries_2WithHttpInfo + * Operation getDefaultPricesWithHttpInfo * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappingEntries_2WithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_2'][0]) + public function getDefaultPricesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $request = $this->getOfferMappingEntries_2Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -30159,196 +21154,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30362,44 +21212,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetDefaultPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30407,7 +21234,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30415,7 +21242,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30423,7 +21250,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30431,7 +21258,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30439,7 +21266,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30447,36 +21274,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappingEntries_2Async + * Operation getDefaultPricesAsync * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_2Async($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_2'][0]) + public function getDefaultPricesAsync($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - return $this->getOfferMappingEntries_2AsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) + return $this->getDefaultPricesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -30485,30 +21307,23 @@ class ExpressApi } /** - * Operation getOfferMappingEntries_2AsyncWithHttpInfo + * Operation getDefaultPricesAsyncWithHttpInfo * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_2AsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_2'][0]) + public function getDefaultPricesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - $request = $this->getOfferMappingEntries_2Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDefaultPricesResponse'; + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30547,117 +21362,44 @@ class ExpressApi } /** - * Create request for operation 'getOfferMappingEntries_2' + * Create request for operation 'getDefaultPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOfferMappingEntries_2Request($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_2'][0]) + public function getDefaultPricesRequest($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOfferMappingEntries_2' + 'Missing the required parameter $business_id when calling getDefaultPrices' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOfferMappingEntries_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getDefaultPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + - - - - - - - - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_sku, - 'shop_sku', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $mapping_kind, - 'mapping_kind', // param base name - 'OfferMappingKindType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $availability, - 'availability', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $category_id, - 'category_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $vendor, - 'vendor', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, @@ -30679,10 +21421,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -30695,7 +21437,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_default_prices_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_default_prices_request)); + } else { + $httpBody = $get_default_prices_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -30743,7 +21492,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30751,44 +21500,36 @@ class ExpressApi } /** - * Operation getOfferMappings_3 + * Operation getDeliveryServices * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappings_3($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_3'][0]) + public function getDeliveryServices(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - list($response) = $this->getOfferMappings_3WithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + list($response) = $this->getDeliveryServicesWithHttpInfo($contentType); return $response; } /** - * Operation getOfferMappings_3WithHttpInfo + * Operation getDeliveryServicesWithHttpInfo * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappings_3WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_3'][0]) + public function getDeliveryServicesWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - $request = $this->getOfferMappings_3Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $request = $this->getDeliveryServicesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -30815,196 +21556,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -31018,44 +21614,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingsResponse', + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31063,7 +21636,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31071,7 +21644,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31079,7 +21652,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31087,7 +21660,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31095,7 +21668,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31103,29 +21676,27 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappings_3Async + * Operation getDeliveryServicesAsync * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_3Async($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_3'][0]) + public function getDeliveryServicesAsync(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - return $this->getOfferMappings_3AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType) + return $this->getDeliveryServicesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -31134,23 +21705,19 @@ class ExpressApi } /** - * Operation getOfferMappings_3AsyncWithHttpInfo + * Operation getDeliveryServicesAsyncWithHttpInfo * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_3AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_3'][0]) + public function getDeliveryServicesAsyncWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - $request = $this->getOfferMappings_3Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; + $request = $this->getDeliveryServicesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31189,69 +21756,26 @@ class ExpressApi } /** - * Create request for operation 'getOfferMappings_3' + * Create request for operation 'getDeliveryServices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferMappings_3Request($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_3'][0]) + public function getDeliveryServicesRequest(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferMappings_3' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getOfferMappings_3, must be bigger than or equal to 1.'); - } - - - - - $resourcePath = '/businesses/{businessId}/offer-mappings'; + $resourcePath = '/v2/delivery/services'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -31261,14 +21785,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_offer_mappings_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); - } else { - $httpBody = $get_offer_mappings_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -31316,7 +21833,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31324,44 +21841,44 @@ class ExpressApi } /** - * Operation getOfferRecommendations_3 + * Operation getGoodsFeedbackComments * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferRecommendations_3($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_3'][0]) + public function getGoodsFeedbackComments($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - list($response) = $this->getOfferRecommendations_3WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + list($response) = $this->getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferRecommendations_3WithHttpInfo + * Operation getGoodsFeedbackCommentsWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferRecommendations_3WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_3'][0]) + public function getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $request = $this->getOfferRecommendations_3Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -31388,196 +21905,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -31591,44 +21963,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31636,7 +21985,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31644,7 +21993,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31652,7 +22001,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31660,7 +22009,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31668,7 +22017,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31676,29 +22025,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferRecommendations_3Async + * Operation getGoodsFeedbackCommentsAsync * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_3Async($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_3'][0]) + public function getGoodsFeedbackCommentsAsync($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - return $this->getOfferRecommendations_3AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) + return $this->getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -31707,23 +22058,23 @@ class ExpressApi } /** - * Operation getOfferRecommendations_3AsyncWithHttpInfo + * Operation getGoodsFeedbackCommentsAsyncWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_3AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_3'][0]) + public function getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - $request = $this->getOfferRecommendations_3Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31762,41 +22113,44 @@ class ExpressApi } /** - * Create request for operation 'getOfferRecommendations_3' + * Create request for operation 'getGoodsFeedbackComments' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferRecommendations_3Request($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_3'][0]) + public function getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferRecommendations_3' + 'Missing the required parameter $business_id when calling getGoodsFeedbackComments' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getOfferRecommendations_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_offer_recommendations_request' is set - if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { + // verify the required parameter 'get_goods_feedback_comments_request' is set + if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations_3' + 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offers/recommendations'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31840,12 +22194,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_offer_recommendations_request)) { + if (isset($get_goods_feedback_comments_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); } else { - $httpBody = $get_offer_recommendations_request; + $httpBody = $get_goods_feedback_comments_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -31903,54 +22257,44 @@ class ExpressApi } /** - * Operation getOffers_2 + * Operation getGoodsFeedbacks * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOffers_2($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_2'][0]) + public function getGoodsFeedbacks($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - list($response) = $this->getOffers_2WithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + list($response) = $this->getGoodsFeedbacksWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $response; } /** - * Operation getOffers_2WithHttpInfo + * Operation getGoodsFeedbacksWithHttpInfo * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOffers_2WithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_2'][0]) + public function getGoodsFeedbacksWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $request = $this->getOffers_2Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -31977,196 +22321,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32180,44 +22379,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOffersResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32225,7 +22401,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32233,7 +22409,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32241,7 +22417,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32249,7 +22425,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32257,7 +22433,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32265,34 +22441,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOffers_2Async + * Operation getGoodsFeedbacksAsync * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_2Async($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_2'][0]) + public function getGoodsFeedbacksAsync($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - return $this->getOffers_2AsyncWithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType) + return $this->getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) ->then( function ($response) { return $response[0]; @@ -32301,28 +22474,23 @@ class ExpressApi } /** - * Operation getOffers_2AsyncWithHttpInfo + * Operation getGoodsFeedbacksAsyncWithHttpInfo * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_2AsyncWithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_2'][0]) + public function getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - $request = $this->getOffers_2Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32361,47 +22529,38 @@ class ExpressApi } /** - * Create request for operation 'getOffers_2' + * Create request for operation 'getGoodsFeedbacks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOffers_2Request($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_2'][0]) + public function getGoodsFeedbacksRequest($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOffers_2' + 'Missing the required parameter $business_id when calling getGoodsFeedbacks' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOffers_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getOffers_2, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32410,26 +22569,8 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_category_id, - 'shopCategoryId', // param base name + $page_token, + 'page_token', // param base name 'string', // openApiType '', // style false, // explode @@ -32437,35 +22578,8 @@ class ExpressApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $matched, - 'matched', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -32474,10 +22588,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -32490,7 +22604,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); + } else { + $httpBody = $get_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -32538,7 +22659,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -32546,40 +22667,44 @@ class ExpressApi } /** - * Operation getOrderBusinessBuyerInfo_3 + * Operation getGoodsQuestionAnswers * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessBuyerInfo_3($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_3'][0]) + public function getGoodsQuestionAnswers($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - list($response) = $this->getOrderBusinessBuyerInfo_3WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrderBusinessBuyerInfo_3WithHttpInfo + * Operation getGoodsQuestionAnswersWithHttpInfo * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessBuyerInfo_3WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_3'][0]) + public function getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $request = $this->getOrderBusinessBuyerInfo_3Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -32606,196 +22731,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32809,44 +22789,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + '\OpenAPI\Client\Model\GetAnswersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32854,7 +22811,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32862,7 +22819,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32870,7 +22827,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32878,7 +22835,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32886,7 +22843,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32894,27 +22851,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessBuyerInfo_3Async + * Operation getGoodsQuestionAnswersAsync * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_3Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_3'][0]) + public function getGoodsQuestionAnswersAsync($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - return $this->getOrderBusinessBuyerInfo_3AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -32923,21 +22884,23 @@ class ExpressApi } /** - * Operation getOrderBusinessBuyerInfo_3AsyncWithHttpInfo + * Operation getGoodsQuestionAnswersAsyncWithHttpInfo * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_3AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_3'][0]) + public function getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - $request = $this->getOrderBusinessBuyerInfo_3Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetAnswersResponse'; + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32976,58 +22939,75 @@ class ExpressApi } /** - * Create request for operation 'getOrderBusinessBuyerInfo_3' + * Create request for operation 'getGoodsQuestionAnswers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessBuyerInfo_3Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_3'][0]) + public function getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo_3' + 'Missing the required parameter $business_id when calling getGoodsQuestionAnswers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderBusinessBuyerInfo_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_answers_request' is set + if ($get_answers_request === null || (is_array($get_answers_request) && count($get_answers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo_3' + 'Missing the required parameter $get_answers_request when calling getGoodsQuestionAnswers' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/goods-questions/answers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -33040,7 +23020,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_answers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_answers_request)); + } else { + $httpBody = $get_answers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -33096,40 +23083,44 @@ class ExpressApi } /** - * Operation getOrderBusinessDocumentsInfo_3 + * Operation getGoodsQuestions * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessDocumentsInfo_3($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_3'][0]) + public function getGoodsQuestions($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - list($response) = $this->getOrderBusinessDocumentsInfo_3WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsQuestionsWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType); return $response; } /** - * Operation getOrderBusinessDocumentsInfo_3WithHttpInfo + * Operation getGoodsQuestionsWithHttpInfo * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessDocumentsInfo_3WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_3'][0]) + public function getGoodsQuestionsWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $request = $this->getOrderBusinessDocumentsInfo_3Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -33156,196 +23147,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33359,44 +23205,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + '\OpenAPI\Client\Model\GetQuestionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33404,7 +23227,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33412,7 +23235,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33420,7 +23243,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33428,7 +23251,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33436,7 +23259,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33444,27 +23267,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessDocumentsInfo_3Async + * Operation getGoodsQuestionsAsync * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_3Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_3'][0]) + public function getGoodsQuestionsAsync($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - return $this->getOrderBusinessDocumentsInfo_3AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType) ->then( function ($response) { return $response[0]; @@ -33473,21 +23300,23 @@ class ExpressApi } /** - * Operation getOrderBusinessDocumentsInfo_3AsyncWithHttpInfo + * Operation getGoodsQuestionsAsyncWithHttpInfo * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_3AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_3'][0]) + public function getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - $request = $this->getOrderBusinessDocumentsInfo_3Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuestionsResponse'; + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33526,58 +23355,69 @@ class ExpressApi } /** - * Create request for operation 'getOrderBusinessDocumentsInfo_3' + * Create request for operation 'getGoodsQuestions' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessDocumentsInfo_3Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_3'][0]) + public function getGoodsQuestionsRequest($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo_3' + 'Missing the required parameter $business_id when calling getGoodsQuestions' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderBusinessDocumentsInfo_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getGoodsQuestions, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo_3' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getGoodsQuestions, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/documents'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -33590,7 +23430,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_questions_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_questions_request)); + } else { + $httpBody = $get_questions_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -33646,40 +23493,40 @@ class ExpressApi } /** - * Operation getOrderLabelsData_2 + * Operation getGoodsStats * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderLabelsData_2($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_2'][0]) + public function getGoodsStats($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - list($response) = $this->getOrderLabelsData_2WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); return $response; } /** - * Operation getOrderLabelsData_2WithHttpInfo + * Operation getGoodsStatsWithHttpInfo * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderLabelsData_2WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_2'][0]) + public function getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $request = $this->getOrderLabelsData_2Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -33706,196 +23553,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33909,44 +23611,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + '\OpenAPI\Client\Model\GetGoodsStatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33954,7 +23633,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33962,7 +23641,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33970,7 +23649,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33978,7 +23657,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33986,7 +23665,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33994,27 +23673,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderLabelsData_2Async + * Operation getGoodsStatsAsync * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderLabelsData_2Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_2'][0]) + public function getGoodsStatsAsync($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - return $this->getOrderLabelsData_2AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) ->then( function ($response) { return $response[0]; @@ -34023,21 +23704,21 @@ class ExpressApi } /** - * Operation getOrderLabelsData_2AsyncWithHttpInfo + * Operation getGoodsStatsAsyncWithHttpInfo * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderLabelsData_2AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_2'][0]) + public function getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - $request = $this->getOrderLabelsData_2Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34076,37 +23757,37 @@ class ExpressApi } /** - * Create request for operation 'getOrderLabelsData_2' + * Create request for operation 'getGoodsStats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderLabelsData_2Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_2'][0]) + public function getGoodsStatsRequest($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderLabelsData_2' + 'Missing the required parameter $campaign_id when calling getGoodsStats' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderLabelsData_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getGoodsStats, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_goods_stats_request' is set + if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderLabelsData_2' + 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/skus'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34123,14 +23804,6 @@ class ExpressApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -34140,7 +23813,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); + } else { + $httpBody = $get_goods_stats_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -34188,7 +23868,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -34196,40 +23876,44 @@ class ExpressApi } /** - * Operation getOrder_3 + * Operation getHiddenOffers * - * Информация об одном заказе + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrder_3($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_3'][0]) + public function getHiddenOffers($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - list($response) = $this->getOrder_3WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getHiddenOffersWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrder_3WithHttpInfo + * Operation getHiddenOffersWithHttpInfo * - * Информация об одном заказе + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrder_3WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_3'][0]) + public function getHiddenOffersWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $request = $this->getOrder_3Request($campaign_id, $order_id, $contentType); + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -34256,196 +23940,5202 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { + throw $e; + } + } + + /** + * Operation getHiddenOffersAsync + * + * Информация о скрытых вами товарах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getHiddenOffersAsync($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + { + return $this->getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getHiddenOffersAsyncWithHttpInfo + * + * Информация о скрытых вами товарах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } + if ($returnType !== 'string') { + $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getHiddenOffers' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getHiddenOffersRequest($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getHiddenOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getHiddenOffers, must be bigger than or equal to 1.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getHiddenOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offer_id, + 'offer_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferCardsContentStatus + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOfferCardsContentStatus($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + list($response) = $this->getOfferCardsContentStatusWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + return $response; + } + + /** + * Operation getOfferCardsContentStatusWithHttpInfo + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfferCardsContentStatusWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOfferCardsContentStatusAsync + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferCardsContentStatusAsync($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + return $this->getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfferCardsContentStatusAsyncWithHttpInfo + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfferCardsContentStatus' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOfferCardsContentStatusRequest($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getOfferCardsContentStatus' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/businesses/{businessId}/offer-cards'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_offer_cards_content_status_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); + } else { + $httpBody = $get_offer_cards_content_status_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferMappingEntries + * + * Список товаров в каталоге + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOfferMappingEntries($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) + { + list($response) = $this->getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOfferMappingEntriesWithHttpInfo + * + * Список товаров в каталоге + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) + { + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOfferMappingEntriesAsync + * + * Список товаров в каталоге + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOfferMappingEntriesAsync($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) + { + return $this->getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfferMappingEntriesAsyncWithHttpInfo + * + * Список товаров в каталоге + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfferMappingEntries' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOfferMappingEntriesRequest($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOfferMappingEntries' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOfferMappingEntries, must be bigger than or equal to 1.'); + } + + + + + + + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getOfferMappingEntries, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offer_id, + 'offer_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shop_sku, + 'shop_sku', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $mapping_kind, + 'mapping_kind', // param base name + 'OfferMappingKindType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $availability, + 'availability', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $category_id, + 'category_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $vendor, + 'vendor', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferMappings + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOfferMappings($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + return $response; + } + + /** + * Operation getOfferMappingsWithHttpInfo + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOfferMappingsAsync + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfferMappingsAsyncWithHttpInfo + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfferMappings' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getOfferMappings' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getOfferMappings, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getOfferMappings, must be bigger than or equal to 1.'); + } + + + + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_offer_mappings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); + } else { + $httpBody = $get_offer_mappings_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferRecommendations + * + * Рекомендации Маркета, касающиеся цен + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOfferRecommendations($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) + { + list($response) = $this->getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOfferRecommendationsWithHttpInfo + * + * Рекомендации Маркета, касающиеся цен + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) + { + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOfferRecommendationsAsync + * + * Рекомендации Маркета, касающиеся цен + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferRecommendationsAsync($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) + { + return $this->getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfferRecommendationsAsyncWithHttpInfo + * + * Рекомендации Маркета, касающиеся цен + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfferRecommendations' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getOfferRecommendations' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getOfferRecommendations, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_offer_recommendations_request' is set + if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getOfferRecommendations, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/offers/recommendations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_offer_recommendations_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + } else { + $httpBody = $get_offer_recommendations_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrder + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderWithHttpInfo + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderAsync + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderAsyncWithHttpInfo + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrder' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrder' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrder, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrder' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderBusinessBuyerInfo + * + * Информация о покупателе — юридическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderBusinessBuyerInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) + { + list($response) = $this->getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderBusinessBuyerInfoWithHttpInfo + * + * Информация о покупателе — юридическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) + { + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderBusinessBuyerInfoAsync + * + * Информация о покупателе — юридическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBusinessBuyerInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) + { + return $this->getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderBusinessBuyerInfoAsyncWithHttpInfo + * + * Информация о покупателе — юридическом лице + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderBusinessBuyerInfo' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderBusinessBuyerInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderBusinessDocumentsInfo + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderBusinessDocumentsInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + list($response) = $this->getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderBusinessDocumentsInfoWithHttpInfo + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderBusinessDocumentsInfoAsync + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBusinessDocumentsInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + return $this->getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderBusinessDocumentsInfoAsyncWithHttpInfo + * + * Информация о документах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderBusinessDocumentsInfo' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderBusinessDocumentsInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderIdentifiersStatus + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderIdentifiersStatus($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + list($response) = $this->getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderIdentifiersStatusWithHttpInfo + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderIdentifiersStatusAsync + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderIdentifiersStatusAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + return $this->getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderIdentifiersStatusAsyncWithHttpInfo + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse'; + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderIdentifiersStatus' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderIdentifiersStatusRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderIdentifiersStatus' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderIdentifiersStatus, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderIdentifiersStatus' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderLabelsData + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderLabelsData($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + list($response) = $this->getOrderLabelsDataWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderLabelsDataWithHttpInfo + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderLabelsDataWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + $request = $this->getOrderLabelsDataRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderLabelsDataAsync + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderLabelsDataAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + return $this->getOrderLabelsDataAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderLabelsDataAsyncWithHttpInfo + * + * Данные для самостоятельного изготовления ярлыков + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderLabelsDataAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; + $request = $this->getOrderLabelsDataRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderLabelsData' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderLabelsDataRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderLabelsData' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrderLabelsData, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderLabelsData' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrders + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOrdersWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersAsync + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersAsyncWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrders' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrders' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrders, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling ExpressApi.getOrders, number of items must be less than or equal to 50.'); + } + if ($order_ids !== null && count($order_ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling ExpressApi.getOrders, number of items must be greater than or equal to 1.'); + } + + + + + + + + + + + + + + + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getOrders, must be smaller than or equal to 10000.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $substatus, + 'substatus', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_from, + 'supplierShipmentDateFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_to, + 'supplierShipmentDateTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_from, + 'updatedAtFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_to, + 'updatedAtTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dispatch_type, + 'dispatchType', // param base name + 'OrderDeliveryDispatchType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fake, + 'fake', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_cis, + 'hasCis', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_waiting_for_cancellation_approve, + 'onlyWaitingForCancellationApprove', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_estimated_delivery, + 'onlyEstimatedDelivery', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_type, + 'buyerType', // param base name + 'OrderBuyerType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrdersStats + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrdersStats($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + list($response) = $this->getOrdersStatsWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + return $response; + } + + /** + * Operation getOrdersStatsWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrdersStatsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersStatsAsync + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsync($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + return $this->getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersStatsAsyncWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrdersStats' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrdersStatsRequest($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrdersStats' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrdersStats, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getOrdersStats, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/stats/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_orders_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); + } else { + $httpBody = $get_orders_stats_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPagedWarehouses + * + * Список складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPagedWarehouses($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + list($response) = $this->getPagedWarehousesWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); + return $response; + } + + /** + * Operation getPagedWarehousesWithHttpInfo + * + * Список складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPagedWarehousesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -34459,44 +29149,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderResponse', + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34504,7 +29171,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34512,7 +29179,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34520,15 +29187,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34536,7 +29195,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34544,27 +29203,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrder_3Async + * Operation getPagedWarehousesAsync * - * Информация об одном заказе + * Список складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_3Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_3'][0]) + public function getPagedWarehousesAsync($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - return $this->getOrder_3AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType) ->then( function ($response) { return $response[0]; @@ -34573,21 +29236,23 @@ class ExpressApi } /** - * Operation getOrder_3AsyncWithHttpInfo + * Operation getPagedWarehousesAsyncWithHttpInfo * - * Информация об одном заказе + * Список складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_3AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_3'][0]) + public function getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - $request = $this->getOrder_3Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPagedWarehousesResponse'; + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34626,58 +29291,69 @@ class ExpressApi } /** - * Create request for operation 'getOrder_3' + * Create request for operation 'getPagedWarehouses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrder_3Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_3'][0]) + public function getPagedWarehousesRequest($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrder_3' + 'Missing the required parameter $business_id when calling getPagedWarehouses' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrder_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getPagedWarehouses, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrder_3' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getPagedWarehouses, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}'; + $resourcePath = '/v2/businesses/{businessId}/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -34690,7 +29366,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_paged_warehouses_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_paged_warehouses_request)); + } else { + $httpBody = $get_paged_warehouses_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -34738,7 +29421,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -34746,44 +29429,46 @@ class ExpressApi } /** - * Operation getOrdersStats_3 + * Operation getPrices * - * Детальная информация по заказам + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getOrdersStats_3($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_3'][0]) + public function getPrices($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - list($response) = $this->getOrdersStats_3WithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + list($response) = $this->getPricesWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); return $response; } /** - * Operation getOrdersStats_3WithHttpInfo + * Operation getPricesWithHttpInfo * - * Детальная информация по заказам + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getOrdersStats_3WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_3'][0]) + public function getPricesWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - $request = $this->getOrdersStats_3Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); try { $options = $this->createHttpClientOption(); @@ -34810,196 +29495,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35013,44 +29553,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersStatsResponse', + '\OpenAPI\Client\Model\GetPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35058,7 +29575,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35066,7 +29583,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35074,7 +29591,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35082,7 +29599,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35090,7 +29607,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35098,29 +29615,32 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrdersStats_3Async + * Operation getPricesAsync * - * Детальная информация по заказам + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrdersStats_3Async($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_3'][0]) + public function getPricesAsync($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - return $this->getOrdersStats_3AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + return $this->getPricesAsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) ->then( function ($response) { return $response[0]; @@ -35129,23 +29649,24 @@ class ExpressApi } /** - * Operation getOrdersStats_3AsyncWithHttpInfo + * Operation getPricesAsyncWithHttpInfo * - * Детальная информация по заказам + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrdersStats_3AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_3'][0]) + public function getPricesAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - $request = $this->getOrdersStats_3Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35184,35 +29705,39 @@ class ExpressApi } /** - * Create request for operation 'getOrdersStats_3' + * Create request for operation 'getPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getOrdersStats_3Request($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_3'][0]) + public function getPricesRequest($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrdersStats_3' + 'Missing the required parameter $campaign_id when calling getPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrdersStats_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getPrices, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/stats/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35237,6 +29762,15 @@ class ExpressApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $archived, + 'archived', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -35256,14 +29790,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_orders_stats_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); - } else { - $httpBody = $get_orders_stats_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -35311,7 +29838,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -35319,76 +29846,44 @@ class ExpressApi } /** - * Operation getOrders_3 + * Operation getPricesByOfferIds * - * Информация о нескольких заказах + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrders_3($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_3'][0]) + public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - list($response) = $this->getOrders_3WithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); return $response; } /** - * Operation getOrders_3WithHttpInfo - * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_3'] to see the possible values for this operation + * Operation getPricesByOfferIdsWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrders_3WithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_3'][0]) + public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - $request = $this->getOrders_3Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -35415,196 +29910,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35618,44 +29968,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersResponse', + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35663,7 +29990,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35671,7 +29998,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35679,7 +30006,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35687,7 +30014,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35695,7 +30022,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35703,45 +30030,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrders_3Async + * Operation getPricesByOfferIdsAsync * - * Информация о нескольких заказах + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrders_3Async($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_3'][0]) + public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - return $this->getOrders_3AsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -35750,39 +30063,23 @@ class ExpressApi } /** - * Operation getOrders_3AsyncWithHttpInfo + * Operation getPricesByOfferIdsAsyncWithHttpInfo * - * Информация о нескольких заказах + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrders_3AsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_3'][0]) + public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - $request = $this->getOrders_3Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35821,229 +30118,44 @@ class ExpressApi } /** - * Create request for operation 'getOrders_3' + * Create request for operation 'getPricesByOfferIds' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrders_3Request($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_3'][0]) + public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrders_3' + 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getOrders_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getPricesByOfferIds, must be bigger than or equal to 1.'); } - - - - - - - - - - - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.getOrders_3, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getPricesByOfferIds, must be bigger than or equal to 1.'); } - - - $resourcePath = '/campaigns/{campaignId}/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $substatus, - 'substatus', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_from, - 'supplierShipmentDateFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_to, - 'supplierShipmentDateTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_from, - 'updatedAtFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_to, - 'updatedAtTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $dispatch_type, - 'dispatchType', // param base name - 'OrderDeliveryDispatchType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fake, - 'fake', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $has_cis, - 'hasCis', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_waiting_for_cancellation_approve, - 'onlyWaitingForCancellationApprove', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_estimated_delivery, - 'onlyEstimatedDelivery', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $buyer_type, - 'buyerType', // param base name - 'OrderBuyerType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, @@ -36081,7 +30193,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_prices_by_offer_ids_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + } else { + $httpBody = $get_prices_by_offer_ids_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -36129,7 +30248,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36137,44 +30256,44 @@ class ExpressApi } /** - * Operation getPricesByOfferIds_3 + * Operation getPromoOffers * - * Просмотр цен на указанные товары в магазине + * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPricesByOfferIds_3($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_3'][0]) + public function getPromoOffers($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - list($response) = $this->getPricesByOfferIds_3WithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + list($response) = $this->getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getPricesByOfferIds_3WithHttpInfo + * Operation getPromoOffersWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPricesByOfferIds_3WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_3'][0]) + public function getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - $request = $this->getPricesByOfferIds_3Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -36201,196 +30320,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36404,44 +30378,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + '\OpenAPI\Client\Model\GetPromoOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36449,7 +30400,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36457,7 +30408,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36465,7 +30416,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36473,7 +30424,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36481,7 +30432,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36489,29 +30440,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPricesByOfferIds_3Async + * Operation getPromoOffersAsync * - * Просмотр цен на указанные товары в магазине + * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPricesByOfferIds_3Async($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_3'][0]) + public function getPromoOffersAsync($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - return $this->getPricesByOfferIds_3AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + return $this->getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -36520,23 +30473,23 @@ class ExpressApi } /** - * Operation getPricesByOfferIds_3AsyncWithHttpInfo + * Operation getPromoOffersAsyncWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPricesByOfferIds_3AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_3'][0]) + public function getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - $request = $this->getPricesByOfferIds_3Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36575,35 +30528,44 @@ class ExpressApi } /** - * Create request for operation 'getPricesByOfferIds_3' + * Create request for operation 'getPromoOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPricesByOfferIds_3Request($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_3'][0]) + public function getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPricesByOfferIds_3' + 'Missing the required parameter $business_id when calling getPromoOffers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getPricesByOfferIds_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getPromoOffers, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_promo_offers_request' is set + if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getPromoOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36631,10 +30593,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -36647,12 +30609,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_prices_by_offer_ids_request)) { + if (isset($get_promo_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promo_offers_request)); } else { - $httpBody = $get_prices_by_offer_ids_request; + $httpBody = $get_promo_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -36710,46 +30672,40 @@ class ExpressApi } /** - * Operation getPrices_3 + * Operation getPromos * - * Список цен + * Получение списка акций * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPrices_3($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_3'][0]) + public function getPromos($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - list($response) = $this->getPrices_3WithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + list($response) = $this->getPromosWithHttpInfo($business_id, $get_promos_request, $contentType); return $response; } /** - * Operation getPrices_3WithHttpInfo + * Operation getPromosWithHttpInfo * - * Список цен + * Получение списка акций * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPrices_3WithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_3'][0]) + public function getPromosWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - $request = $this->getPrices_3Request($campaign_id, $page_token, $limit, $archived, $contentType); + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -36776,196 +30732,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36979,44 +30790,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesResponse', + '\OpenAPI\Client\Model\GetPromosResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37024,7 +30812,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37032,7 +30820,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37040,7 +30828,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37048,7 +30836,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37056,7 +30844,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37064,30 +30852,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPrices_3Async + * Operation getPromosAsync * - * Список цен + * Получение списка акций * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPrices_3Async($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_3'][0]) + public function getPromosAsync($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - return $this->getPrices_3AsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + return $this->getPromosAsyncWithHttpInfo($business_id, $get_promos_request, $contentType) ->then( function ($response) { return $response[0]; @@ -37096,24 +30883,21 @@ class ExpressApi } /** - * Operation getPrices_3AsyncWithHttpInfo + * Operation getPromosAsyncWithHttpInfo * - * Список цен + * Получение списка акций * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPrices_3AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_3'][0]) + public function getPromosAsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - $request = $this->getPrices_3Request($campaign_id, $page_token, $limit, $archived, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37152,76 +30936,44 @@ class ExpressApi } /** - * Create request for operation 'getPrices_3' + * Create request for operation 'getPromos' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getPrices_3Request($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_3'][0]) + public function getPromosRequest($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPrices_3' + 'Missing the required parameter $business_id when calling getPromos' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getPrices_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getPromos, must be bigger than or equal to 1.'); } - - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/businesses/{businessId}/promos'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $archived, - 'archived', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -37234,7 +30986,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_promos_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promos_request)); + } else { + $httpBody = $get_promos_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -37282,7 +31041,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37290,44 +31049,38 @@ class ExpressApi } /** - * Operation getPromoOffers_3 + * Operation getQualityRatingDetails * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Заказы, которые повлияли на индекс качества * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromoOffers_3($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_3'][0]) + public function getQualityRatingDetails($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - list($response) = $this->getPromoOffers_3WithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + list($response) = $this->getQualityRatingDetailsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getPromoOffers_3WithHttpInfo + * Operation getQualityRatingDetailsWithHttpInfo * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Заказы, которые повлияли на индекс качества * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromoOffers_3WithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_3'][0]) + public function getQualityRatingDetailsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - $request = $this->getPromoOffers_3Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $request = $this->getQualityRatingDetailsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -37354,196 +31107,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -37557,44 +31165,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPromoOffersResponse', + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37602,7 +31187,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37610,7 +31195,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37618,7 +31203,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37626,7 +31211,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37634,7 +31219,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37642,29 +31227,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromoOffers_3Async + * Operation getQualityRatingDetailsAsync * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Заказы, которые повлияли на индекс качества * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromoOffers_3Async($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_3'][0]) + public function getQualityRatingDetailsAsync($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - return $this->getPromoOffers_3AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) + return $this->getQualityRatingDetailsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -37673,23 +31257,20 @@ class ExpressApi } /** - * Operation getPromoOffers_3AsyncWithHttpInfo + * Operation getQualityRatingDetailsAsyncWithHttpInfo * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Заказы, которые повлияли на индекс качества * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromoOffers_3AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_3'][0]) + public function getQualityRatingDetailsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - $request = $this->getPromoOffers_3Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; + $request = $this->getQualityRatingDetailsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37728,72 +31309,42 @@ class ExpressApi } /** - * Create request for operation 'getPromoOffers_3' + * Create request for operation 'getQualityRatingDetails' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromoOffers_3Request($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_3'][0]) + public function getQualityRatingDetailsRequest($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromoOffers_3' + 'Missing the required parameter $campaign_id when calling getQualityRatingDetails' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getPromoOffers_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getQualityRatingDetails, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_promo_offers_request' is set - if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers_3' - ); - } - - - - $resourcePath = '/businesses/{businessId}/promos/offers'; + $resourcePath = '/v2/campaigns/{campaignId}/ratings/quality/details'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -37806,14 +31357,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_promo_offers_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promo_offers_request)); - } else { - $httpBody = $get_promo_offers_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -37869,40 +31413,40 @@ class ExpressApi } /** - * Operation getPromos_3 + * Operation getQualityRatings * - * Получение списка акций + * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromos_3($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_3'][0]) + public function getQualityRatings($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - list($response) = $this->getPromos_3WithHttpInfo($business_id, $get_promos_request, $contentType); + list($response) = $this->getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, $contentType); return $response; } /** - * Operation getPromos_3WithHttpInfo + * Operation getQualityRatingsWithHttpInfo * - * Получение списка акций + * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromos_3WithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_3'][0]) + public function getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - $request = $this->getPromos_3Request($business_id, $get_promos_request, $contentType); + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -37929,196 +31473,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromosResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromosResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromosResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38132,44 +31531,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPromosResponse', + '\OpenAPI\Client\Model\GetQualityRatingResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38177,7 +31553,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38185,7 +31561,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38193,7 +31569,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38201,7 +31577,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38209,7 +31585,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38217,27 +31593,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromos_3Async + * Operation getQualityRatingsAsync * - * Получение списка акций + * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_3Async($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_3'][0]) + public function getQualityRatingsAsync($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - return $this->getPromos_3AsyncWithHttpInfo($business_id, $get_promos_request, $contentType) + return $this->getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) ->then( function ($response) { return $response[0]; @@ -38246,21 +31624,21 @@ class ExpressApi } /** - * Operation getPromos_3AsyncWithHttpInfo + * Operation getQualityRatingsAsyncWithHttpInfo * - * Получение списка акций + * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_3AsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_3'][0]) + public function getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - $request = $this->getPromos_3Request($business_id, $get_promos_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38299,31 +31677,37 @@ class ExpressApi } /** - * Create request for operation 'getPromos_3' + * Create request for operation 'getQualityRatings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromos_3Request($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_3'][0]) + public function getQualityRatingsRequest($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromos_3' + 'Missing the required parameter $business_id when calling getQualityRatings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getPromos_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getQualityRatings, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_quality_rating_request' is set + if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings' + ); + } - $resourcePath = '/businesses/{businessId}/promos'; + $resourcePath = '/v2/businesses/{businessId}/ratings/quality'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38349,12 +31733,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_promos_request)) { + if (isset($get_quality_rating_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promos_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quality_rating_request)); } else { - $httpBody = $get_promos_request; + $httpBody = $get_quality_rating_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -38412,38 +31796,36 @@ class ExpressApi } /** - * Operation getQualityRatingDetails_2 + * Operation getRegionsCodes * - * Заказы, которые повлияли на индекс качества + * Список допустимых кодов стран * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getQualityRatingDetails_2($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_2'][0]) + public function getRegionsCodes(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - list($response) = $this->getQualityRatingDetails_2WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getRegionsCodesWithHttpInfo($contentType); return $response; } /** - * Operation getQualityRatingDetails_2WithHttpInfo + * Operation getRegionsCodesWithHttpInfo * - * Заказы, которые повлияли на индекс качества + * Список допустимых кодов стран * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getQualityRatingDetails_2WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_2'][0]) + public function getRegionsCodesWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - $request = $this->getQualityRatingDetails_2Request($campaign_id, $contentType); + $request = $this->getRegionsCodesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -38470,196 +31852,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38673,52 +31904,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + '\OpenAPI\Client\Model\GetRegionsCodesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38726,7 +31926,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38734,7 +31934,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38742,7 +31942,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38750,7 +31950,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38758,26 +31958,27 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatingDetails_2Async + * Operation getRegionsCodesAsync * - * Заказы, которые повлияли на индекс качества + * Список допустимых кодов стран * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatingDetails_2Async($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_2'][0]) + public function getRegionsCodesAsync(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - return $this->getQualityRatingDetails_2AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getRegionsCodesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -38786,20 +31987,19 @@ class ExpressApi } /** - * Operation getQualityRatingDetails_2AsyncWithHttpInfo + * Operation getRegionsCodesAsyncWithHttpInfo * - * Заказы, которые повлияли на индекс качества + * Список допустимых кодов стран * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatingDetails_2AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_2'][0]) + public function getRegionsCodesAsyncWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - $request = $this->getQualityRatingDetails_2Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsCodesResponse'; + $request = $this->getRegionsCodesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38838,29 +32038,18 @@ class ExpressApi } /** - * Create request for operation 'getQualityRatingDetails_2' + * Create request for operation 'getRegionsCodes' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getQualityRatingDetails_2Request($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_2'][0]) + public function getRegionsCodesRequest(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getQualityRatingDetails_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getQualityRatingDetails_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/ratings/quality/details'; + $resourcePath = '/v2/regions/countries'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38869,14 +32058,6 @@ class ExpressApi - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -38942,40 +32123,38 @@ class ExpressApi } /** - * Operation getQualityRatings_3 + * Operation getReportInfo * - * Индекс качества магазинов + * Получение заданного отчета или документа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_3'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getQualityRatings_3($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_3'][0]) + public function getReportInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - list($response) = $this->getQualityRatings_3WithHttpInfo($business_id, $get_quality_rating_request, $contentType); + list($response) = $this->getReportInfoWithHttpInfo($report_id, $contentType); return $response; } /** - * Operation getQualityRatings_3WithHttpInfo + * Operation getReportInfoWithHttpInfo * - * Индекс качества магазинов + * Получение заданного отчета или документа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_3'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getQualityRatings_3WithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_3'][0]) + public function getReportInfoWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - $request = $this->getQualityRatings_3Request($business_id, $get_quality_rating_request, $contentType); + $request = $this->getReportInfoRequest($report_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -39002,196 +32181,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39205,44 +32239,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQualityRatingResponse', + '\OpenAPI\Client\Model\GetReportInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39250,7 +32261,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39258,7 +32269,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39266,7 +32277,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39274,7 +32285,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39282,7 +32293,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39290,27 +32301,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatings_3Async + * Operation getReportInfoAsync * - * Индекс качества магазинов + * Получение заданного отчета или документа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_3'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatings_3Async($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_3'][0]) + public function getReportInfoAsync($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - return $this->getQualityRatings_3AsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) + return $this->getReportInfoAsyncWithHttpInfo($report_id, $contentType) ->then( function ($response) { return $response[0]; @@ -39319,21 +32331,20 @@ class ExpressApi } /** - * Operation getQualityRatings_3AsyncWithHttpInfo + * Operation getReportInfoAsyncWithHttpInfo * - * Индекс качества магазинов + * Получение заданного отчета или документа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_3'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatings_3AsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_3'][0]) + public function getReportInfoAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - $request = $this->getQualityRatings_3Request($business_id, $get_quality_rating_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; + $request = $this->getReportInfoRequest($report_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39372,37 +32383,32 @@ class ExpressApi } /** - * Create request for operation 'getQualityRatings_3' + * Create request for operation 'getReportInfo' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_3'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getQualityRatings_3Request($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_3'][0]) + public function getReportInfoRequest($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getQualityRatings_3' + 'Missing the required parameter $report_id when calling getReportInfo' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getQualityRatings_3, must be bigger than or equal to 1.'); + if (strlen($report_id) > 255) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling ExpressApi.getReportInfo, must be smaller than or equal to 255.'); } - - // verify the required parameter 'get_quality_rating_request' is set - if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings_3' - ); + if (strlen($report_id) < 1) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling ExpressApi.getReportInfo, must be bigger than or equal to 1.'); } + - - $resourcePath = '/businesses/{businessId}/ratings/quality'; + $resourcePath = '/v2/reports/info/{reportId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39412,10 +32418,10 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($report_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'reportId' . '}', + ObjectSerializer::toPathValue($report_id), $resourcePath ); } @@ -39428,14 +32434,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_quality_rating_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quality_rating_request)); - } else { - $httpBody = $get_quality_rating_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -39483,7 +32482,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -39491,38 +32490,42 @@ class ExpressApi } /** - * Operation getReportInfo_3 + * Operation getReturn * - * Получение заданного отчета + * Информация о невыкупе или возврате * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReportInfo_3($report_id, string $contentType = self::contentTypes['getReportInfo_3'][0]) + public function getReturn($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - list($response) = $this->getReportInfo_3WithHttpInfo($report_id, $contentType); + list($response) = $this->getReturnWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); return $response; } /** - * Operation getReportInfo_3WithHttpInfo + * Operation getReturnWithHttpInfo * - * Получение заданного отчета + * Информация о невыкупе или возврате * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReportInfo_3WithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_3'][0]) + public function getReturnWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - $request = $this->getReportInfo_3Request($report_id, $contentType); + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -39549,196 +32552,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReportInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReportInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReportInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39752,44 +32610,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReportInfoResponse', + '\OpenAPI\Client\Model\GetReturnResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39797,7 +32632,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39805,7 +32640,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39813,7 +32648,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39821,7 +32656,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39829,7 +32664,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39837,26 +32672,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReportInfo_3Async + * Operation getReturnAsync * - * Получение заданного отчета + * Информация о невыкупе или возврате * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_3Async($report_id, string $contentType = self::contentTypes['getReportInfo_3'][0]) + public function getReturnAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - return $this->getReportInfo_3AsyncWithHttpInfo($report_id, $contentType) + return $this->getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) ->then( function ($response) { return $response[0]; @@ -39865,20 +32704,22 @@ class ExpressApi } /** - * Operation getReportInfo_3AsyncWithHttpInfo + * Operation getReturnAsyncWithHttpInfo * - * Получение заданного отчета + * Информация о невыкупе или возврате * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_3AsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_3'][0]) + public function getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - $request = $this->getReportInfo_3Request($report_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39917,26 +32758,45 @@ class ExpressApi } /** - * Create request for operation 'getReportInfo_3' + * Create request for operation 'getReturn' * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReportInfo_3Request($report_id, string $contentType = self::contentTypes['getReportInfo_3'][0]) + public function getReturnRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - // verify the required parameter 'report_id' is set - if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getReturn' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturn, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $report_id when calling getReportInfo_3' + 'Missing the required parameter $order_id when calling getReturn' ); } + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $return_id when calling getReturn' + ); + } - $resourcePath = '/reports/info/{reportId}'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39946,10 +32806,26 @@ class ExpressApi // path params - if ($report_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'reportId' . '}', - ObjectSerializer::toPathValue($report_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), $resourcePath ); } @@ -40018,42 +32894,42 @@ class ExpressApi } /** - * Operation getReturnApplication_2 + * Operation getReturnApplication * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_2'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnApplication_2($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_2'][0]) + public function getReturnApplication($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - list($response) = $this->getReturnApplication_2WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); return $response; } /** - * Operation getReturnApplication_2WithHttpInfo + * Operation getReturnApplicationWithHttpInfo * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_2'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnApplication_2WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_2'][0]) + public function getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - $request = $this->getReturnApplication_2Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -40080,196 +32956,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40283,34 +33014,11 @@ class ExpressApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -40320,7 +33028,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40328,7 +33036,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40336,7 +33044,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40344,7 +33052,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40352,7 +33060,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40360,7 +33068,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40368,28 +33076,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnApplication_2Async + * Operation getReturnApplicationAsync * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_2'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnApplication_2Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_2'][0]) + public function getReturnApplicationAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - return $this->getReturnApplication_2AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) ->then( function ($response) { return $response[0]; @@ -40398,22 +33108,22 @@ class ExpressApi } /** - * Operation getReturnApplication_2AsyncWithHttpInfo + * Operation getReturnApplicationAsyncWithHttpInfo * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_2'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnApplication_2AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_2'][0]) + public function getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { $returnType = '\SplFileObject'; - $request = $this->getReturnApplication_2Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40452,45 +33162,45 @@ class ExpressApi } /** - * Create request for operation 'getReturnApplication_2' + * Create request for operation 'getReturnApplication' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_2'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnApplication_2Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_2'][0]) + public function getReturnApplicationRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnApplication_2' + 'Missing the required parameter $campaign_id when calling getReturnApplication' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturnApplication_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturnApplication, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnApplication_2' + 'Missing the required parameter $order_id when calling getReturnApplication' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnApplication_2' + 'Missing the required parameter $return_id when calling getReturnApplication' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; $formParams = []; $queryParams = []; $headerParams = []; @@ -40588,46 +33298,46 @@ class ExpressApi } /** - * Operation getReturnPhoto_2 + * Operation getReturnPhoto * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnPhoto_2($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_2'][0]) + public function getReturnPhoto($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - list($response) = $this->getReturnPhoto_2WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + list($response) = $this->getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); return $response; } /** - * Operation getReturnPhoto_2WithHttpInfo + * Operation getReturnPhotoWithHttpInfo * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnPhoto_2WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_2'][0]) + public function getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - $request = $this->getReturnPhoto_2Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); try { $options = $this->createHttpClientOption(); @@ -40654,196 +33364,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40857,34 +33422,11 @@ class ExpressApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -40894,7 +33436,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40902,7 +33444,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40910,7 +33452,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40918,7 +33460,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40926,7 +33468,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40934,7 +33476,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40942,30 +33484,32 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnPhoto_2Async + * Operation getReturnPhotoAsync * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_2Async($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_2'][0]) + public function getReturnPhotoAsync($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - return $this->getReturnPhoto_2AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) + return $this->getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) ->then( function ($response) { return $response[0]; @@ -40974,24 +33518,24 @@ class ExpressApi } /** - * Operation getReturnPhoto_2AsyncWithHttpInfo + * Operation getReturnPhotoAsyncWithHttpInfo * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_2AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_2'][0]) + public function getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { $returnType = '\SplFileObject'; - $request = $this->getReturnPhoto_2Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41030,61 +33574,61 @@ class ExpressApi } /** - * Create request for operation 'getReturnPhoto_2' + * Create request for operation 'getReturnPhoto' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnPhoto_2Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_2'][0]) + public function getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnPhoto_2' + 'Missing the required parameter $campaign_id when calling getReturnPhoto' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturnPhoto_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturnPhoto, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnPhoto_2' + 'Missing the required parameter $order_id when calling getReturnPhoto' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnPhoto_2' + 'Missing the required parameter $return_id when calling getReturnPhoto' ); } // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $item_id when calling getReturnPhoto_2' + 'Missing the required parameter $item_id when calling getReturnPhoto' ); } // verify the required parameter 'image_hash' is set if ($image_hash === null || (is_array($image_hash) && count($image_hash) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $image_hash when calling getReturnPhoto_2' + 'Missing the required parameter $image_hash when calling getReturnPhoto' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41198,42 +33742,58 @@ class ExpressApi } /** - * Operation getReturn_2 + * Operation getReturns * - * Информация о невыкупе или возврате + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturn_2($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_2'][0]) + public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - list($response) = $this->getReturn_2WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $response; } /** - * Operation getReturn_2WithHttpInfo + * Operation getReturnsWithHttpInfo * - * Информация о невыкупе или возврате + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturn_2WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_2'][0]) + public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $request = $this->getReturn_2Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); try { $options = $this->createHttpClientOption(); @@ -41260,196 +33820,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41463,44 +33878,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnResponse', + '\OpenAPI\Client\Model\GetReturnsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41508,7 +33900,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41516,7 +33908,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41524,7 +33916,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41532,7 +33924,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41540,7 +33932,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41548,28 +33940,38 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturn_2Async + * Operation getReturnsAsync * - * Информация о невыкупе или возврате + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_2Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_2'][0]) + public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - return $this->getReturn_2AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) ->then( function ($response) { return $response[0]; @@ -41578,22 +33980,30 @@ class ExpressApi } /** - * Operation getReturn_2AsyncWithHttpInfo + * Operation getReturnsAsyncWithHttpInfo * - * Информация о невыкупе или возврате + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_2AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_2'][0]) + public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - $request = $this->getReturn_2Request($campaign_id, $order_id, $return_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41632,51 +34042,151 @@ class ExpressApi } /** - * Create request for operation 'getReturn_2' + * Create request for operation 'getReturns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturn_2Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_2'][0]) + public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturn_2' + 'Missing the required parameter $campaign_id when calling getReturns' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturn_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturns, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturn_2' - ); - } - // verify the required parameter 'return_id' is set - if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturn_2' - ); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getReturns, must be bigger than or equal to 1.'); } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling ExpressApi.getReturns, number of items must be less than or equal to 50.'); + } + + + + + + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + + $resourcePath = '/v2/campaigns/{campaignId}/returns'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $statuses, + 'statuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shipment_statuses, + 'shipmentStatuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'ReturnType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date2, + 'from_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date2, + 'to_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -41687,22 +34197,6 @@ class ExpressApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($return_id !== null) { - $resourcePath = str_replace( - '{' . 'returnId' . '}', - ObjectSerializer::toPathValue($return_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -41768,56 +34262,44 @@ class ExpressApi } /** - * Operation getReturns_2 + * Operation getStocks * - * Список невыкупов и возвратов + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturns_2($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_2'][0]) + public function getStocks($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - list($response) = $this->getReturns_2WithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + list($response) = $this->getStocksWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $response; } /** - * Operation getReturns_2WithHttpInfo + * Operation getStocksWithHttpInfo * - * Список невыкупов и возвратов + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturns_2WithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_2'][0]) + public function getStocksWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - $request = $this->getReturns_2Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -41844,196 +34326,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -42047,44 +34378,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnsResponse', + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42092,7 +34400,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42100,7 +34408,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42108,15 +34416,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42124,7 +34424,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42132,35 +34432,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturns_2Async + * Operation getStocksAsync * - * Список невыкупов и возвратов + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturns_2Async($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_2'][0]) + public function getStocksAsync($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - return $this->getReturns_2AsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + return $this->getStocksAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -42169,29 +34465,23 @@ class ExpressApi } /** - * Operation getReturns_2AsyncWithHttpInfo + * Operation getStocksAsyncWithHttpInfo * - * Список невыкупов и возвратов + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturns_2AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_2'][0]) + public function getStocksAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - $request = $this->getReturns_2Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42230,50 +34520,38 @@ class ExpressApi } /** - * Create request for operation 'getReturns_2' + * Create request for operation 'getStocks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturns_2Request($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_2'][0]) + public function getStocksRequest($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturns_2' + 'Missing the required parameter $campaign_id when calling getStocks' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getReturns_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getStocks, must be bigger than or equal to 1.'); } - - if ($order_ids !== null && count($order_ids) > 50) { - throw new \InvalidArgumentException('invalid value for "$order_ids" when calling ExpressApi.getReturns_2, number of items must be less than or equal to 50.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.getStocks, must be bigger than or equal to 1.'); } - - - - - - $resourcePath = '/campaigns/{campaignId}/returns'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42298,69 +34576,6 @@ class ExpressApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $statuses, - 'statuses', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $type, - 'type', // param base name - 'ReturnType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date2, - 'from_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date2, - 'to_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -42380,7 +34595,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_warehouse_stocks_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); + } else { + $httpBody = $get_warehouse_stocks_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -42428,7 +34650,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -42436,44 +34658,42 @@ class ExpressApi } /** - * Operation getStocks_3 + * Operation getSuggestedOfferMappingEntries * - * Информация об остатках и оборачиваемости + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getStocks_3($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_3'][0]) + public function getSuggestedOfferMappingEntries($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - list($response) = $this->getStocks_3WithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + list($response) = $this->getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $response; } /** - * Operation getStocks_3WithHttpInfo + * Operation getSuggestedOfferMappingEntriesWithHttpInfo * - * Информация об остатках и оборачиваемости + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getStocks_3WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_3'][0]) + public function getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $request = $this->getStocks_3Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -42500,169 +34720,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehouseStocksResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -42676,44 +34778,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42721,7 +34800,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42729,7 +34808,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42737,7 +34816,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42745,7 +34832,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42753,29 +34840,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getStocks_3Async + * Operation getSuggestedOfferMappingEntriesAsync * - * Информация об остатках и оборачиваемости + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getStocks_3Async($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_3'][0]) + public function getSuggestedOfferMappingEntriesAsync($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - return $this->getStocks_3AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) + return $this->getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) ->then( function ($response) { return $response[0]; @@ -42784,23 +34872,22 @@ class ExpressApi } /** - * Operation getStocks_3AsyncWithHttpInfo + * Operation getSuggestedOfferMappingEntriesAsyncWithHttpInfo * - * Информация об остатках и оборачиваемости + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getStocks_3AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_3'][0]) + public function getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - $request = $this->getStocks_3Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42839,59 +34926,44 @@ class ExpressApi } /** - * Create request for operation 'getStocks_3' + * Create request for operation 'getSuggestedOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getStocks_3Request($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_3'][0]) + public function getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getStocks_3' + 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getStocks_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getSuggestedOfferMappingEntries, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set + if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries' + ); + } - - - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -42911,12 +34983,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_warehouse_stocks_request)) { + if (isset($get_suggested_offer_mapping_entries_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mapping_entries_request)); } else { - $httpBody = $get_warehouse_stocks_request; + $httpBody = $get_suggested_offer_mapping_entries_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -42974,42 +35046,42 @@ class ExpressApi } /** - * Operation getSuggestedOfferMappingEntries_2 + * Operation getSuggestedOfferMappings * - * Рекомендованные карточки для товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getSuggestedOfferMappingEntries_2($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_2'][0]) + public function getSuggestedOfferMappings($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - list($response) = $this->getSuggestedOfferMappingEntries_2WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + list($response) = $this->getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); return $response; } /** - * Operation getSuggestedOfferMappingEntries_2WithHttpInfo + * Operation getSuggestedOfferMappingsWithHttpInfo * - * Рекомендованные карточки для товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getSuggestedOfferMappingEntries_2WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_2'][0]) + public function getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $request = $this->getSuggestedOfferMappingEntries_2Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -43036,196 +35108,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43239,44 +35166,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43284,7 +35188,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43292,7 +35196,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43300,7 +35204,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43308,7 +35212,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43316,7 +35220,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43324,28 +35228,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappingEntries_2Async + * Operation getSuggestedOfferMappingsAsync * - * Рекомендованные карточки для товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedOfferMappingEntries_2Async($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_2'][0]) + public function getSuggestedOfferMappingsAsync($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - return $this->getSuggestedOfferMappingEntries_2AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) + return $this->getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -43354,22 +35260,22 @@ class ExpressApi } /** - * Operation getSuggestedOfferMappingEntries_2AsyncWithHttpInfo + * Operation getSuggestedOfferMappingsAsyncWithHttpInfo * - * Рекомендованные карточки для товаров + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedOfferMappingEntries_2AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_2'][0]) + public function getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - $request = $this->getSuggestedOfferMappingEntries_2Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43408,38 +35314,32 @@ class ExpressApi } /** - * Create request for operation 'getSuggestedOfferMappingEntries_2' + * Create request for operation 'getSuggestedOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getSuggestedOfferMappingEntries_2Request($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_2'][0]) + public function getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries_2' + 'Missing the required parameter $business_id when calling getSuggestedOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getSuggestedOfferMappingEntries_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getSuggestedOfferMappings, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set - if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries_2' - ); - } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/suggestions'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43449,10 +35349,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -43465,12 +35365,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_suggested_offer_mapping_entries_request)) { + if (isset($get_suggested_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mapping_entries_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mappings_request)); } else { - $httpBody = $get_suggested_offer_mapping_entries_request; + $httpBody = $get_suggested_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -43528,40 +35428,40 @@ class ExpressApi } /** - * Operation getSuggestedOfferMappings_3 + * Operation getWarehouses * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getSuggestedOfferMappings_3($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_3'][0]) + public function getWarehouses($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - list($response) = $this->getSuggestedOfferMappings_3WithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); + list($response) = $this->getWarehousesWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getSuggestedOfferMappings_3WithHttpInfo + * Operation getWarehousesWithHttpInfo * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getSuggestedOfferMappings_3WithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_3'][0]) + public function getWarehousesWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - $request = $this->getSuggestedOfferMappings_3Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $request = $this->getWarehousesRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -43588,196 +35488,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43791,44 +35546,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + '\OpenAPI\Client\Model\GetWarehousesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43836,7 +35568,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43844,7 +35576,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43852,7 +35584,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43860,7 +35592,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43868,7 +35600,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43876,27 +35608,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappings_3Async + * Operation getWarehousesAsync * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getSuggestedOfferMappings_3Async($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_3'][0]) + public function getWarehousesAsync($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - return $this->getSuggestedOfferMappings_3AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) + return $this->getWarehousesAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -43905,21 +35639,21 @@ class ExpressApi } /** - * Operation getSuggestedOfferMappings_3AsyncWithHttpInfo + * Operation getWarehousesAsyncWithHttpInfo * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Список складов и групп складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getSuggestedOfferMappings_3AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_3'][0]) + public function getWarehousesAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - $request = $this->getSuggestedOfferMappings_3Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; + $request = $this->getWarehousesRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43958,31 +35692,30 @@ class ExpressApi } /** - * Create request for operation 'getSuggestedOfferMappings_3' + * Create request for operation 'getWarehouses' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getSuggestedOfferMappings_3Request($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_3'][0]) + public function getWarehousesRequest($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getSuggestedOfferMappings_3' + 'Missing the required parameter $business_id when calling getWarehouses' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getSuggestedOfferMappings_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getWarehouses, must be bigger than or equal to 1.'); } - - $resourcePath = '/businesses/{businessId}/offer-mappings/suggestions'; + $resourcePath = '/v2/businesses/{businessId}/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -44008,14 +35741,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($get_suggested_offer_mappings_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mappings_request)); - } else { - $httpBody = $get_suggested_offer_mappings_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -44063,7 +35789,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -44071,42 +35797,42 @@ class ExpressApi } /** - * Operation getSuggestedPrices_2 + * Operation provideOrderItemIdentifiers * - * Цены для продвижения товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getSuggestedPrices_2($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_2'][0]) + public function provideOrderItemIdentifiers($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - list($response) = $this->getSuggestedPrices_2WithHttpInfo($campaign_id, $suggest_prices_request, $contentType); + list($response) = $this->provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $response; } /** - * Operation getSuggestedPrices_2WithHttpInfo + * Operation provideOrderItemIdentifiersWithHttpInfo * - * Цены для продвижения товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getSuggestedPrices_2WithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_2'][0]) + public function provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $request = $this->getSuggestedPrices_2Request($campaign_id, $suggest_prices_request, $contentType); + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -44133,196 +35859,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SuggestPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SuggestPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuggestPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44336,44 +35917,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SuggestPricesResponse', + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44381,7 +35939,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44389,7 +35947,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44397,7 +35955,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44405,7 +35963,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44413,7 +35971,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44421,28 +35979,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedPrices_2Async + * Operation provideOrderItemIdentifiersAsync * - * Цены для продвижения товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedPrices_2Async($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_2'][0]) + public function provideOrderItemIdentifiersAsync($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - return $this->getSuggestedPrices_2AsyncWithHttpInfo($campaign_id, $suggest_prices_request, $contentType) + return $this->provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -44451,22 +36011,22 @@ class ExpressApi } /** - * Operation getSuggestedPrices_2AsyncWithHttpInfo + * Operation provideOrderItemIdentifiersAsyncWithHttpInfo * - * Цены для продвижения товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedPrices_2AsyncWithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_2'][0]) + public function provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - $request = $this->getSuggestedPrices_2Request($campaign_id, $suggest_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44505,38 +36065,45 @@ class ExpressApi } /** - * Create request for operation 'getSuggestedPrices_2' + * Create request for operation 'provideOrderItemIdentifiers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getSuggestedPrices_2Request($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_2'][0]) + public function provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedPrices_2' + 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.getSuggestedPrices_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.provideOrderItemIdentifiers, must be bigger than or equal to 1.'); } - // verify the required parameter 'suggest_prices_request' is set - if ($suggest_prices_request === null || (is_array($suggest_prices_request) && count($suggest_prices_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $suggest_prices_request when calling getSuggestedPrices_2' + 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers' + ); + } + + // verify the required parameter 'provide_order_item_identifiers_request' is set + if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers' ); } - $resourcePath = '/campaigns/{campaignId}/offer-prices/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -44553,6 +36120,14 @@ class ExpressApi $resourcePath ); } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -44562,12 +36137,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($suggest_prices_request)) { + if (isset($provide_order_item_identifiers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($suggest_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_item_identifiers_request)); } else { - $httpBody = $suggest_prices_request; + $httpBody = $provide_order_item_identifiers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -44617,7 +36192,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -44625,38 +36200,40 @@ class ExpressApi } /** - * Operation getWarehouses_2 + * Operation putBidsForBusiness * - * Список складов и групп складов + * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getWarehouses_2($business_id, string $contentType = self::contentTypes['getWarehouses_2'][0]) + public function putBidsForBusiness($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - list($response) = $this->getWarehouses_2WithHttpInfo($business_id, $contentType); + list($response) = $this->putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation getWarehouses_2WithHttpInfo + * Operation putBidsForBusinessWithHttpInfo * - * Список складов и групп складов + * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getWarehouses_2WithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses_2'][0]) + public function putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - $request = $this->getWarehouses_2Request($business_id, $contentType); + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -44683,196 +36260,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehousesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehousesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehousesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44886,44 +36318,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetWarehousesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44931,7 +36340,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44939,7 +36348,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44947,7 +36356,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44955,7 +36364,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44963,7 +36372,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44971,26 +36380,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getWarehouses_2Async + * Operation putBidsForBusinessAsync * - * Список складов и групп складов + * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWarehouses_2Async($business_id, string $contentType = self::contentTypes['getWarehouses_2'][0]) + public function putBidsForBusinessAsync($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - return $this->getWarehouses_2AsyncWithHttpInfo($business_id, $contentType) + return $this->putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -44999,20 +36411,21 @@ class ExpressApi } /** - * Operation getWarehouses_2AsyncWithHttpInfo + * Operation putBidsForBusinessAsyncWithHttpInfo * - * Список складов и групп складов + * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWarehouses_2AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses_2'][0]) + public function putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - $request = $this->getWarehouses_2Request($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45051,29 +36464,37 @@ class ExpressApi } /** - * Create request for operation 'getWarehouses_2' + * Create request for operation 'putBidsForBusiness' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getWarehouses_2Request($business_id, string $contentType = self::contentTypes['getWarehouses_2'][0]) + public function putBidsForBusinessRequest($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getWarehouses_2' + 'Missing the required parameter $business_id when calling putBidsForBusiness' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.getWarehouses_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.putBidsForBusiness, must be bigger than or equal to 1.'); } + // verify the required parameter 'put_sku_bids_request' is set + if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness' + ); + } + - $resourcePath = '/businesses/{businessId}/warehouses'; + $resourcePath = '/v2/businesses/{businessId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45099,7 +36520,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($put_sku_bids_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_sku_bids_request)); + } else { + $httpBody = $put_sku_bids_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -45147,7 +36575,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -45155,42 +36583,40 @@ class ExpressApi } /** - * Operation provideOrderItemIdentifiers_2 + * Operation putBidsForCampaign * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function provideOrderItemIdentifiers_2($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_2'][0]) + public function putBidsForCampaign($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - list($response) = $this->provideOrderItemIdentifiers_2WithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + list($response) = $this->putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation provideOrderItemIdentifiers_2WithHttpInfo + * Operation putBidsForCampaignWithHttpInfo * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function provideOrderItemIdentifiers_2WithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_2'][0]) + public function putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - $request = $this->provideOrderItemIdentifiers_2Request($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -45217,196 +36643,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45420,44 +36701,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45465,7 +36723,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45473,7 +36731,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45481,7 +36739,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45489,7 +36747,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45497,7 +36755,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45505,28 +36763,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation provideOrderItemIdentifiers_2Async + * Operation putBidsForCampaignAsync * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiers_2Async($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_2'][0]) + public function putBidsForCampaignAsync($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - return $this->provideOrderItemIdentifiers_2AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) + return $this->putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -45535,22 +36794,21 @@ class ExpressApi } /** - * Operation provideOrderItemIdentifiers_2AsyncWithHttpInfo + * Operation putBidsForCampaignAsyncWithHttpInfo * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiers_2AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_2'][0]) + public function putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - $request = $this->provideOrderItemIdentifiers_2Request($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45589,45 +36847,37 @@ class ExpressApi } /** - * Create request for operation 'provideOrderItemIdentifiers_2' + * Create request for operation 'putBidsForCampaign' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function provideOrderItemIdentifiers_2Request($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_2'][0]) + public function putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers_2' + 'Missing the required parameter $campaign_id when calling putBidsForCampaign' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.provideOrderItemIdentifiers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.putBidsForCampaign, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers_2' - ); - } - - // verify the required parameter 'provide_order_item_identifiers_request' is set - if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { + // verify the required parameter 'put_sku_bids_request' is set + if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers_2' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/identifiers'; + $resourcePath = '/v2/campaigns/{campaignId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45644,14 +36894,6 @@ class ExpressApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -45661,12 +36903,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($provide_order_item_identifiers_request)) { + if (isset($put_sku_bids_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_item_identifiers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_sku_bids_request)); } else { - $httpBody = $provide_order_item_identifiers_request; + $httpBody = $put_sku_bids_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -45724,40 +36966,42 @@ class ExpressApi } /** - * Operation putBidsForBusiness_3 + * Operation searchRegionChildren * - * Включение буста продаж и установка ставок + * Информация о дочерних регионах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForBusiness_3($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_3'][0]) + public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - list($response) = $this->putBidsForBusiness_3WithHttpInfo($business_id, $put_sku_bids_request, $contentType); + list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); return $response; } /** - * Operation putBidsForBusiness_3WithHttpInfo + * Operation searchRegionChildrenWithHttpInfo * - * Включение буста продаж и установка ставок + * Информация о дочерних регионах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForBusiness_3WithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_3'][0]) + public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $request = $this->putBidsForBusiness_3Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -45784,196 +37028,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45987,44 +37086,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46032,7 +37108,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46040,7 +37116,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46048,7 +37124,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46056,7 +37132,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46064,7 +37140,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46072,27 +37148,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForBusiness_3Async + * Operation searchRegionChildrenAsync * - * Включение буста продаж и установка ставок + * Информация о дочерних регионах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_3Async($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_3'][0]) + public function searchRegionChildrenAsync($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - return $this->putBidsForBusiness_3AsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) + return $this->searchRegionChildrenAsyncWithHttpInfo($region_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -46101,21 +37180,22 @@ class ExpressApi } /** - * Operation putBidsForBusiness_3AsyncWithHttpInfo + * Operation searchRegionChildrenAsyncWithHttpInfo * - * Включение буста продаж и установка ставок + * Информация о дочерних регионах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_3AsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_3'][0]) + public function searchRegionChildrenAsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForBusiness_3Request($business_id, $put_sku_bids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46154,50 +37234,64 @@ class ExpressApi } /** - * Create request for operation 'putBidsForBusiness_3' + * Create request for operation 'searchRegionChildren' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForBusiness_3Request($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_3'][0]) + public function searchRegionChildrenRequest($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling putBidsForBusiness_3' + 'Missing the required parameter $region_id when calling searchRegionChildren' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.putBidsForBusiness_3, must be bigger than or equal to 1.'); + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.searchRegionChildren, must be smaller than or equal to 10000.'); } - // verify the required parameter 'put_sku_bids_request' is set - if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness_3' - ); - } - $resourcePath = '/businesses/{businessId}/bids'; + $resourcePath = '/v2/regions/{regionId}/children'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($business_id !== null) { + if ($region_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), $resourcePath ); } @@ -46210,14 +37304,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($put_sku_bids_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_sku_bids_request)); - } else { - $httpBody = $put_sku_bids_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -46265,7 +37352,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -46273,40 +37360,38 @@ class ExpressApi } /** - * Operation putBidsForCampaign_2 + * Operation searchRegionsById * - * Включение буста продаж и установка ставок для магазина + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_2'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForCampaign_2($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_2'][0]) + public function searchRegionsById($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - list($response) = $this->putBidsForCampaign_2WithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); + list($response) = $this->searchRegionsByIdWithHttpInfo($region_id, $contentType); return $response; } /** - * Operation putBidsForCampaign_2WithHttpInfo + * Operation searchRegionsByIdWithHttpInfo * - * Включение буста продаж и установка ставок для магазина + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_2'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForCampaign_2WithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_2'][0]) + public function searchRegionsByIdWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $request = $this->putBidsForCampaign_2Request($campaign_id, $put_sku_bids_request, $contentType); + $request = $this->searchRegionsByIdRequest($region_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -46333,196 +37418,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -46536,52 +37470,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46589,7 +37492,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46597,7 +37500,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46605,7 +37508,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46613,7 +37516,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46621,27 +37524,28 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForCampaign_2Async + * Operation searchRegionsByIdAsync * - * Включение буста продаж и установка ставок для магазина + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_2'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_2Async($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_2'][0]) + public function searchRegionsByIdAsync($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - return $this->putBidsForCampaign_2AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) + return $this->searchRegionsByIdAsyncWithHttpInfo($region_id, $contentType) ->then( function ($response) { return $response[0]; @@ -46650,21 +37554,20 @@ class ExpressApi } /** - * Operation putBidsForCampaign_2AsyncWithHttpInfo + * Operation searchRegionsByIdAsyncWithHttpInfo * - * Включение буста продаж и установка ставок для магазина + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_2'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_2AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_2'][0]) + public function searchRegionsByIdAsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForCampaign_2Request($campaign_id, $put_sku_bids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByIdRequest($region_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46703,37 +37606,26 @@ class ExpressApi } /** - * Create request for operation 'putBidsForCampaign_2' + * Create request for operation 'searchRegionsById' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_2'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForCampaign_2Request($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_2'][0]) + public function searchRegionsByIdRequest($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling putBidsForCampaign_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.putBidsForCampaign_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'put_sku_bids_request' is set - if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign_2' + 'Missing the required parameter $region_id when calling searchRegionsById' ); } - $resourcePath = '/campaigns/{campaignId}/bids'; + $resourcePath = '/v2/regions/{regionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -46743,10 +37635,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($region_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), $resourcePath ); } @@ -46759,14 +37651,7 @@ class ExpressApi ); // for model (json/xml) - if (isset($put_sku_bids_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_sku_bids_request)); - } else { - $httpBody = $put_sku_bids_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -46814,7 +37699,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -46822,42 +37707,42 @@ class ExpressApi } /** - * Operation refreshFeed_2 + * Operation searchRegionsByName * - * Сообщить, что прайс-лист обновился + * Поиск регионов по их имени * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function refreshFeed_2($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_2'][0]) + public function searchRegionsByName($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - list($response) = $this->refreshFeed_2WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->searchRegionsByNameWithHttpInfo($name, $page_token, $limit, $contentType); return $response; } /** - * Operation refreshFeed_2WithHttpInfo + * Operation searchRegionsByNameWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Поиск регионов по их имени * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function refreshFeed_2WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_2'][0]) + public function searchRegionsByNameWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $request = $this->refreshFeed_2Request($campaign_id, $feed_id, $contentType); + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -46884,196 +37769,39 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47087,52 +37815,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47140,7 +37837,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47148,15 +37845,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47164,7 +37853,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47172,28 +37861,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation refreshFeed_2Async + * Operation searchRegionsByNameAsync * - * Сообщить, что прайс-лист обновился + * Поиск регионов по их имени * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_2Async($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_2'][0]) + public function searchRegionsByNameAsync($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - return $this->refreshFeed_2AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->searchRegionsByNameAsyncWithHttpInfo($name, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -47202,22 +37893,22 @@ class ExpressApi } /** - * Operation refreshFeed_2AsyncWithHttpInfo + * Operation searchRegionsByNameAsyncWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Поиск регионов по их имени * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_2AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_2'][0]) + public function searchRegionsByNameAsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->refreshFeed_2Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47256,62 +37947,68 @@ class ExpressApi } /** - * Create request for operation 'refreshFeed_2' + * Create request for operation 'searchRegionsByName' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_2'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function refreshFeed_2Request($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_2'][0]) + public function searchRegionsByNameRequest($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling refreshFeed_2' + 'Missing the required parameter $name when calling searchRegionsByName' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.refreshFeed_2, must be bigger than or equal to 1.'); + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ExpressApi.searchRegionsByName, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling refreshFeed_2' - ); - } - - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/refresh'; + $resourcePath = '/v2/regions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $name, + 'name', // param base name + 'string', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -47369,7 +38066,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -47377,42 +38074,42 @@ class ExpressApi } /** - * Operation searchRegionChildren_3 + * Operation sendFileToChat * - * Информация о дочерних регионах + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionChildren_3($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_3'][0]) + public function sendFileToChat($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - list($response) = $this->searchRegionChildren_3WithHttpInfo($region_id, $page, $page_size, $contentType); + list($response) = $this->sendFileToChatWithHttpInfo($business_id, $chat_id, $file, $contentType); return $response; } /** - * Operation searchRegionChildren_3WithHttpInfo + * Operation sendFileToChatWithHttpInfo * - * Информация о дочерних регионах + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionChildren_3WithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_3'][0]) + public function sendFileToChatWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $request = $this->searchRegionChildren_3Request($region_id, $page, $page_size, $contentType); + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); try { $options = $this->createHttpClientOption(); @@ -47439,196 +38136,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47642,44 +38194,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47687,7 +38216,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47695,7 +38224,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47703,7 +38232,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47711,7 +38240,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47719,7 +38248,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47727,28 +38256,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionChildren_3Async + * Operation sendFileToChatAsync * - * Информация о дочерних регионах + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_3Async($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_3'][0]) + public function sendFileToChatAsync($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - return $this->searchRegionChildren_3AsyncWithHttpInfo($region_id, $page, $page_size, $contentType) + return $this->sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) ->then( function ($response) { return $response[0]; @@ -47757,22 +38288,22 @@ class ExpressApi } /** - * Operation searchRegionChildren_3AsyncWithHttpInfo + * Operation sendFileToChatAsyncWithHttpInfo * - * Информация о дочерних регионах + * Отправка файла в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_3AsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_3'][0]) + public function sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - $request = $this->searchRegionChildren_3Request($region_id, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47811,33 +38342,48 @@ class ExpressApi } /** - * Create request for operation 'searchRegionChildren_3' + * Create request for operation 'sendFileToChat' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionChildren_3Request($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_3'][0]) + public function sendFileToChatRequest($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionChildren_3' + 'Missing the required parameter $business_id when calling sendFileToChat' ); } - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling ExpressApi.searchRegionChildren_3, must be smaller than or equal to 10000.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.sendFileToChat, must be bigger than or equal to 1.'); } + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling sendFileToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling sendFileToChat' + ); + } - $resourcePath = '/regions/{regionId}/children'; + $resourcePath = '/v2/businesses/{businessId}/chats/file/send'; $formParams = []; $queryParams = []; $headerParams = []; @@ -47846,34 +38392,35 @@ class ExpressApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // path params - if ($region_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } + // form params + $formDataProcessor = new FormDataProcessor(); + + $formData = $formDataProcessor->prepare([ + 'file' => $file, + ]); + $formParams = $formDataProcessor->flatten($formData); + $multipart = $formDataProcessor->has_file; + + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -47929,7 +38476,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -47937,38 +38484,42 @@ class ExpressApi } /** - * Operation searchRegionsById_3 + * Operation sendMessageToChat * - * Информация о регионе + * Отправка сообщения в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsById_3($region_id, string $contentType = self::contentTypes['searchRegionsById_3'][0]) + public function sendMessageToChat($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - list($response) = $this->searchRegionsById_3WithHttpInfo($region_id, $contentType); + list($response) = $this->sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $response; } /** - * Operation searchRegionsById_3WithHttpInfo + * Operation sendMessageToChatWithHttpInfo * - * Информация о регионе + * Отправка сообщения в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsById_3WithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_3'][0]) + public function sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $request = $this->searchRegionsById_3Request($region_id, $contentType); + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -47995,169 +38546,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48171,44 +38604,29 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48216,7 +38634,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48224,7 +38642,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48232,7 +38650,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48240,7 +38658,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48248,26 +38666,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsById_3Async + * Operation sendMessageToChatAsync * - * Информация о регионе + * Отправка сообщения в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_3Async($region_id, string $contentType = self::contentTypes['searchRegionsById_3'][0]) + public function sendMessageToChatAsync($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - return $this->searchRegionsById_3AsyncWithHttpInfo($region_id, $contentType) + return $this->sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -48276,20 +38698,22 @@ class ExpressApi } /** - * Operation searchRegionsById_3AsyncWithHttpInfo + * Operation sendMessageToChatAsyncWithHttpInfo * - * Информация о регионе + * Отправка сообщения в чат * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_3AsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_3'][0]) + public function sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsById_3Request($region_id, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48328,39 +38752,70 @@ class ExpressApi } /** - * Create request for operation 'searchRegionsById_3' + * Create request for operation 'sendMessageToChat' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsById_3Request($region_id, string $contentType = self::contentTypes['searchRegionsById_3'][0]) + public function sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionsById_3' + 'Missing the required parameter $business_id when calling sendMessageToChat' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.sendMessageToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling sendMessageToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.sendMessageToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'send_message_to_chat_request' is set + if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat' ); } - $resourcePath = '/regions/{regionId}'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); // path params - if ($region_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -48373,7 +38828,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($send_message_to_chat_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + } else { + $httpBody = $send_message_to_chat_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -48421,7 +38883,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -48429,42 +38891,42 @@ class ExpressApi } /** - * Operation searchRegionsByName_3 + * Operation setOrderBoxLayout * - * Поиск регионов по их имени + * Подготовка заказа * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsByName_3($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_3'][0]) + public function setOrderBoxLayout($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - list($response) = $this->searchRegionsByName_3WithHttpInfo($name, $page_token, $limit, $contentType); + list($response) = $this->setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $response; } /** - * Operation searchRegionsByName_3WithHttpInfo + * Operation setOrderBoxLayoutWithHttpInfo * - * Поиск регионов по их имени + * Подготовка заказа * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsByName_3WithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_3'][0]) + public function setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $request = $this->searchRegionsByName_3Request($name, $page_token, $limit, $contentType); + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -48491,142 +38953,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48640,44 +39011,29 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48685,7 +39041,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48693,7 +39049,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48701,7 +39065,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48709,28 +39073,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsByName_3Async + * Operation setOrderBoxLayoutAsync * - * Поиск регионов по их имени + * Подготовка заказа * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_3Async($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_3'][0]) + public function setOrderBoxLayoutAsync($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - return $this->searchRegionsByName_3AsyncWithHttpInfo($name, $page_token, $limit, $contentType) + return $this->setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) ->then( function ($response) { return $response[0]; @@ -48739,22 +39105,22 @@ class ExpressApi } /** - * Operation searchRegionsByName_3AsyncWithHttpInfo + * Operation setOrderBoxLayoutAsyncWithHttpInfo * - * Поиск регионов по их имени + * Подготовка заказа * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только Ð´Ð»Ñ автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_3AsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_3'][0]) + public function setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsByName_3Request($name, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48793,65 +39159,69 @@ class ExpressApi } /** - * Create request for operation 'searchRegionsByName_3' + * Create request for operation 'setOrderBoxLayout' * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsByName_3Request($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_3'][0]) + public function setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling searchRegionsByName_3' + 'Missing the required parameter $campaign_id when calling setOrderBoxLayout' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.setOrderBoxLayout, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling setOrderBoxLayout' ); } + // verify the required parameter 'set_order_box_layout_request' is set + if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout' + ); + } - - $resourcePath = '/regions'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $name, - 'name', // param base name - 'string', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -48861,7 +39231,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($set_order_box_layout_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + } else { + $httpBody = $set_order_box_layout_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -48909,7 +39286,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -48917,42 +39294,46 @@ class ExpressApi } /** - * Operation sendFileToChat_3 + * Operation setOrderShipmentBoxes * - * Отправка файла в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function sendFileToChat_3($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_3'][0]) + public function setOrderShipmentBoxes($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - list($response) = $this->sendFileToChat_3WithHttpInfo($business_id, $chat_id, $file, $contentType); + list($response) = $this->setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $response; } /** - * Operation sendFileToChat_3WithHttpInfo + * Operation setOrderShipmentBoxesWithHttpInfo * - * Отправка файла в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function sendFileToChat_3WithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_3'][0]) + public function setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $request = $this->sendFileToChat_3Request($business_id, $chat_id, $file, $contentType); + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -48979,196 +39360,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49182,44 +39418,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49227,7 +39440,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49235,7 +39448,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49243,7 +39456,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49251,7 +39464,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49259,7 +39472,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49267,28 +39480,32 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendFileToChat_3Async + * Operation setOrderShipmentBoxesAsync * - * Отправка файла в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function sendFileToChat_3Async($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_3'][0]) + public function setOrderShipmentBoxesAsync($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - return $this->sendFileToChat_3AsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) + return $this->setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -49297,22 +39514,24 @@ class ExpressApi } /** - * Operation sendFileToChat_3AsyncWithHttpInfo + * Operation setOrderShipmentBoxesAsyncWithHttpInfo * - * Отправка файла в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function sendFileToChat_3AsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_3'][0]) + public function setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendFileToChat_3Request($business_id, $chat_id, $file, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49351,86 +39570,87 @@ class ExpressApi } /** - * Create request for operation 'sendFileToChat_3' + * Create request for operation 'setOrderShipmentBoxes' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function sendFileToChat_3Request($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_3'][0]) + public function setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendFileToChat_3' + 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.sendFileToChat_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.setOrderShipmentBoxes, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendFileToChat_3' + 'Missing the required parameter $order_id when calling setOrderShipmentBoxes' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.sendFileToChat_3, must be bigger than or equal to 1.'); + + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes' + ); } - - // verify the required parameter 'file' is set - if ($file === null || (is_array($file) && count($file) === 0)) { + + // verify the required parameter 'set_order_shipment_boxes_request' is set + if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file when calling sendFileToChat_3' + 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes' ); } - $resourcePath = '/businesses/{businessId}/chats/file/send'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } - - // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = []; - $paramFiles = is_array($file) ? $file : [$file]; - foreach ($paramFiles as $paramFile) { - $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( ['application/json', ], @@ -49439,7 +39659,14 @@ class ExpressApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($set_order_shipment_boxes_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); + } else { + $httpBody = $set_order_shipment_boxes_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -49487,7 +39714,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -49495,42 +39722,40 @@ class ExpressApi } /** - * Operation sendMessageToChat_3 + * Operation skipGoodsFeedbacksReaction * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function sendMessageToChat_3($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_3'][0]) + public function skipGoodsFeedbacksReaction($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - list($response) = $this->sendMessageToChat_3WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); + list($response) = $this->skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); return $response; } /** - * Operation sendMessageToChat_3WithHttpInfo + * Operation skipGoodsFeedbacksReactionWithHttpInfo * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendMessageToChat_3WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_3'][0]) + public function skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - $request = $this->sendMessageToChat_3Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -49557,196 +39782,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49760,34 +39840,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -49797,7 +39854,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49805,7 +39862,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49813,7 +39870,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49821,7 +39878,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49829,7 +39886,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49837,7 +39894,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49845,28 +39902,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendMessageToChat_3Async + * Operation skipGoodsFeedbacksReactionAsync * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMessageToChat_3Async($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_3'][0]) + public function skipGoodsFeedbacksReactionAsync($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - return $this->sendMessageToChat_3AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) + return $this->skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) ->then( function ($response) { return $response[0]; @@ -49875,22 +39933,21 @@ class ExpressApi } /** - * Operation sendMessageToChat_3AsyncWithHttpInfo + * Operation skipGoodsFeedbacksReactionAsyncWithHttpInfo * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMessageToChat_3AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_3'][0]) + public function skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendMessageToChat_3Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49929,63 +39986,43 @@ class ExpressApi } /** - * Create request for operation 'sendMessageToChat_3' + * Create request for operation 'skipGoodsFeedbacksReaction' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendMessageToChat_3Request($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_3'][0]) + public function skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendMessageToChat_3' + 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.sendMessageToChat_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.skipGoodsFeedbacksReaction, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendMessageToChat_3' - ); - } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling ExpressApi.sendMessageToChat_3, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'send_message_to_chat_request' is set - if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + // verify the required parameter 'skip_goods_feedback_reaction_request' is set + if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat_3' + 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction' ); } - $resourcePath = '/businesses/{businessId}/chats/message'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/skip-reaction'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params @@ -50005,12 +40042,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($send_message_to_chat_request)) { + if (isset($skip_goods_feedback_reaction_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); } else { - $httpBody = $send_message_to_chat_request; + $httpBody = $skip_goods_feedback_reaction_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -50068,44 +40105,44 @@ class ExpressApi } /** - * Operation setFeedParams_2 + * Operation submitReturnDecision * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setFeedParams_2($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_2'][0]) + public function submitReturnDecision($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - list($response) = $this->setFeedParams_2WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType); + list($response) = $this->submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $response; } /** - * Operation setFeedParams_2WithHttpInfo + * Operation submitReturnDecisionWithHttpInfo * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setFeedParams_2WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_2'][0]) + public function submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $request = $this->setFeedParams_2Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -50132,223 +40169,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50362,34 +40227,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -50399,7 +40241,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50407,7 +40249,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50415,7 +40257,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50423,7 +40265,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50431,7 +40273,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50439,15 +40281,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50455,29 +40289,31 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setFeedParams_2Async + * Operation submitReturnDecisionAsync * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_2Async($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_2'][0]) + public function submitReturnDecisionAsync($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - return $this->setFeedParams_2AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType) + return $this->submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType) ->then( function ($response) { return $response[0]; @@ -50486,23 +40322,23 @@ class ExpressApi } /** - * Operation setFeedParams_2AsyncWithHttpInfo + * Operation submitReturnDecisionAsyncWithHttpInfo * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_2AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_2'][0]) + public function submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setFeedParams_2Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -50541,46 +40377,47 @@ class ExpressApi } /** - * Create request for operation 'setFeedParams_2' + * Create request for operation 'submitReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function setFeedParams_2Request($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_2'][0]) + public function submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setFeedParams_2' + 'Missing the required parameter $campaign_id when calling submitReturnDecision' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.setFeedParams_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.submitReturnDecision, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling setFeedParams_2' + 'Missing the required parameter $order_id when calling submitReturnDecision' ); } - // verify the required parameter 'set_feed_params_request' is set - if ($set_feed_params_request === null || (is_array($set_feed_params_request) && count($set_feed_params_request) === 0)) { + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_feed_params_request when calling setFeedParams_2' + 'Missing the required parameter $return_id when calling submitReturnDecision' ); } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/params'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50598,10 +40435,18 @@ class ExpressApi ); } // path params - if ($feed_id !== null) { + if ($order_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), $resourcePath ); } @@ -50614,12 +40459,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($set_feed_params_request)) { + if (isset($submit_return_decision_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_feed_params_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($submit_return_decision_request)); } else { - $httpBody = $set_feed_params_request; + $httpBody = $submit_return_decision_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -50677,42 +40522,40 @@ class ExpressApi } /** - * Operation setOrderBoxLayout_1 + * Operation updateBusinessPrices * - * Подготовка заказа + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderBoxLayout_1($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_1'][0]) + public function updateBusinessPrices($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - list($response) = $this->setOrderBoxLayout_1WithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + list($response) = $this->updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, $contentType); return $response; } /** - * Operation setOrderBoxLayout_1WithHttpInfo + * Operation updateBusinessPricesWithHttpInfo * - * Подготовка заказа + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderBoxLayout_1WithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_1'][0]) + public function updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - $request = $this->setOrderBoxLayout_1Request($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -50739,196 +40582,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50942,44 +40646,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50987,7 +40668,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50995,7 +40676,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51003,7 +40684,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51011,7 +40692,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51019,7 +40700,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51027,28 +40716,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderBoxLayout_1Async + * Operation updateBusinessPricesAsync * - * Подготовка заказа + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderBoxLayout_1Async($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_1'][0]) + public function updateBusinessPricesAsync($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - return $this->setOrderBoxLayout_1AsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) + return $this->updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -51057,22 +40747,21 @@ class ExpressApi } /** - * Operation setOrderBoxLayout_1AsyncWithHttpInfo + * Operation updateBusinessPricesAsyncWithHttpInfo * - * Подготовка заказа + * Установка цен на товары для всех магазинов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderBoxLayout_1AsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_1'][0]) + public function updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - $request = $this->setOrderBoxLayout_1Request($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51111,45 +40800,37 @@ class ExpressApi } /** - * Create request for operation 'setOrderBoxLayout_1' + * Create request for operation 'updateBusinessPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderBoxLayout_1Request($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_1'][0]) + public function updateBusinessPricesRequest($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderBoxLayout_1' + 'Missing the required parameter $business_id when calling updateBusinessPrices' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.setOrderBoxLayout_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateBusinessPrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderBoxLayout_1' - ); - } - - // verify the required parameter 'set_order_box_layout_request' is set - if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { + // verify the required parameter 'update_business_prices_request' is set + if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout_1' + 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/boxes'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -51159,18 +40840,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -51183,12 +40856,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($set_order_box_layout_request)) { + if (isset($update_business_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); } else { - $httpBody = $set_order_box_layout_request; + $httpBody = $update_business_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -51238,7 +40911,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -51246,44 +40919,40 @@ class ExpressApi } /** - * Operation setOrderShipmentBoxes_2 + * Operation updateCampaignOffers * - * Передача количества грузовых мест в заказе + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderShipmentBoxes_2($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_2'][0]) + public function updateCampaignOffers($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - list($response) = $this->setOrderShipmentBoxes_2WithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + list($response) = $this->updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); return $response; } /** - * Operation setOrderShipmentBoxes_2WithHttpInfo + * Operation updateCampaignOffersWithHttpInfo * - * Передача количества грузовых мест в заказе + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderShipmentBoxes_2WithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_2'][0]) + public function updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - $request = $this->setOrderShipmentBoxes_2Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -51310,196 +40979,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -51513,44 +41043,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51558,7 +41065,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51566,7 +41073,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51574,7 +41081,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51582,7 +41089,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51590,7 +41097,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51598,29 +41113,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderShipmentBoxes_2Async + * Operation updateCampaignOffersAsync * - * Передача количества грузовых мест в заказе + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxes_2Async($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_2'][0]) + public function updateCampaignOffersAsync($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - return $this->setOrderShipmentBoxes_2AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) + return $this->updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -51629,23 +41144,21 @@ class ExpressApi } /** - * Operation setOrderShipmentBoxes_2AsyncWithHttpInfo + * Operation updateCampaignOffersAsyncWithHttpInfo * - * Передача количества грузовых мест в заказе + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxes_2AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_2'][0]) + public function updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - $request = $this->setOrderShipmentBoxes_2Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51684,53 +41197,37 @@ class ExpressApi } /** - * Create request for operation 'setOrderShipmentBoxes_2' + * Create request for operation 'updateCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderShipmentBoxes_2Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_2'][0]) + public function updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes_2' + 'Missing the required parameter $campaign_id when calling updateCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.setOrderShipmentBoxes_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderShipmentBoxes_2' - ); - } - - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes_2' - ); - } - - // verify the required parameter 'set_order_shipment_boxes_request' is set - if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { + // verify the required parameter 'update_campaign_offers_request' is set + if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes_2' + 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -51747,22 +41244,6 @@ class ExpressApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($shipment_id !== null) { - $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -51772,12 +41253,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($set_order_shipment_boxes_request)) { + if (isset($update_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); } else { - $httpBody = $set_order_shipment_boxes_request; + $httpBody = $update_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -51827,7 +41308,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -51835,40 +41316,42 @@ class ExpressApi } /** - * Operation skipGoodsFeedbacksReaction_3 + * Operation updateExternalOrderId * - * Отказ от ответа на отзывы + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function skipGoodsFeedbacksReaction_3($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_3'][0]) + public function updateExternalOrderId($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - list($response) = $this->skipGoodsFeedbacksReaction_3WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); + list($response) = $this->updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $response; } /** - * Operation skipGoodsFeedbacksReaction_3WithHttpInfo + * Operation updateExternalOrderIdWithHttpInfo * - * Отказ от ответа на отзывы + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function skipGoodsFeedbacksReaction_3WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_3'][0]) + public function updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - $request = $this->skipGoodsFeedbacksReaction_3Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -51895,196 +41378,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52098,34 +41436,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -52135,7 +41450,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52143,7 +41458,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52151,7 +41466,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52159,7 +41474,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52167,7 +41482,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52175,7 +41490,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52183,27 +41498,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation skipGoodsFeedbacksReaction_3Async + * Operation updateExternalOrderIdAsync * - * Отказ от ответа на отзывы + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_3Async($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_3'][0]) + public function updateExternalOrderIdAsync($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - return $this->skipGoodsFeedbacksReaction_3AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) + return $this->updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType) ->then( function ($response) { return $response[0]; @@ -52212,21 +41530,22 @@ class ExpressApi } /** - * Operation skipGoodsFeedbacksReaction_3AsyncWithHttpInfo + * Operation updateExternalOrderIdAsyncWithHttpInfo * - * Отказ от ответа на отзывы + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_3AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_3'][0]) + public function updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->skipGoodsFeedbacksReaction_3Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -52265,37 +41584,45 @@ class ExpressApi } /** - * Create request for operation 'skipGoodsFeedbacksReaction_3' + * Create request for operation 'updateExternalOrderId' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function skipGoodsFeedbacksReaction_3Request($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_3'][0]) + public function updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction_3' + 'Missing the required parameter $campaign_id when calling updateExternalOrderId' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.skipGoodsFeedbacksReaction_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateExternalOrderId, must be bigger than or equal to 1.'); } - // verify the required parameter 'skip_goods_feedback_reaction_request' is set - if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction_3' + 'Missing the required parameter $order_id when calling updateExternalOrderId' ); } + // verify the required parameter 'update_external_order_id_request' is set + if ($update_external_order_id_request === null || (is_array($update_external_order_id_request) && count($update_external_order_id_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_external_order_id_request when calling updateExternalOrderId' + ); + } - $resourcePath = '/businesses/{businessId}/goods-feedback/skip-reaction'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/external-id'; $formParams = []; $queryParams = []; $headerParams = []; @@ -52305,10 +41632,18 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -52321,12 +41656,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($skip_goods_feedback_reaction_request)) { + if (isset($update_external_order_id_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_external_order_id_request)); } else { - $httpBody = $skip_goods_feedback_reaction_request; + $httpBody = $update_external_order_id_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -52384,40 +41719,40 @@ class ExpressApi } /** - * Operation updateBusinessPrices_3 + * Operation updateGoodsFeedbackComment * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateBusinessPrices_3($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_3'][0]) + public function updateGoodsFeedbackComment($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - list($response) = $this->updateBusinessPrices_3WithHttpInfo($business_id, $update_business_prices_request, $contentType); + list($response) = $this->updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation updateBusinessPrices_3WithHttpInfo + * Operation updateGoodsFeedbackCommentWithHttpInfo * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateBusinessPrices_3WithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_3'][0]) + public function updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $request = $this->updateBusinessPrices_3Request($business_id, $update_business_prices_request, $contentType); + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -52444,223 +41779,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52674,44 +41837,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52719,7 +41859,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52727,7 +41867,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52735,7 +41875,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52743,7 +41883,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52751,15 +41891,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52767,27 +41899,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateBusinessPrices_3Async + * Operation updateGoodsFeedbackCommentAsync * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_3Async($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_3'][0]) + public function updateGoodsFeedbackCommentAsync($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - return $this->updateBusinessPrices_3AsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) + return $this->updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -52796,21 +41930,21 @@ class ExpressApi } /** - * Operation updateBusinessPrices_3AsyncWithHttpInfo + * Operation updateGoodsFeedbackCommentAsyncWithHttpInfo * - * Установка цен на товары во всех магазинах + * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_3AsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_3'][0]) + public function updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateBusinessPrices_3Request($business_id, $update_business_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -52849,37 +41983,37 @@ class ExpressApi } /** - * Create request for operation 'updateBusinessPrices_3' + * Create request for operation 'updateGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateBusinessPrices_3Request($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_3'][0]) + public function updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateBusinessPrices_3' + 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateBusinessPrices_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateGoodsFeedbackComment, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_business_prices_request' is set - if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { + // verify the required parameter 'update_goods_feedback_comment_request' is set + if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices_3' + 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment' ); } - $resourcePath = '/businesses/{businessId}/offer-prices/updates'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -52905,12 +42039,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_business_prices_request)) { + if (isset($update_goods_feedback_comment_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); } else { - $httpBody = $update_business_prices_request; + $httpBody = $update_goods_feedback_comment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -52968,40 +42102,40 @@ class ExpressApi } /** - * Operation updateCampaignOffers_3 + * Operation updateGoodsQuestionTextEntity * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateCampaignOffers_3($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_3'][0]) + public function updateGoodsQuestionTextEntity($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - list($response) = $this->updateCampaignOffers_3WithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); + list($response) = $this->updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType); return $response; } /** - * Operation updateCampaignOffers_3WithHttpInfo + * Operation updateGoodsQuestionTextEntityWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateCampaignOffers_3WithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_3'][0]) + public function updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $request = $this->updateCampaignOffers_3Request($campaign_id, $update_campaign_offers_request, $contentType); + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -53028,223 +42162,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -53258,44 +42220,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53303,7 +42242,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53311,7 +42250,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53319,7 +42258,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53327,7 +42266,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53335,15 +42274,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53351,27 +42282,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateCampaignOffers_3Async + * Operation updateGoodsQuestionTextEntityAsync * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_3Async($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_3'][0]) + public function updateGoodsQuestionTextEntityAsync($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - return $this->updateCampaignOffers_3AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) + return $this->updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType) ->then( function ($response) { return $response[0]; @@ -53380,21 +42313,21 @@ class ExpressApi } /** - * Operation updateCampaignOffers_3AsyncWithHttpInfo + * Operation updateGoodsQuestionTextEntityAsyncWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Создание, изменение и удаление ответа или комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_3AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_3'][0]) + public function updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateCampaignOffers_3Request($campaign_id, $update_campaign_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse'; + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -53433,37 +42366,37 @@ class ExpressApi } /** - * Create request for operation 'updateCampaignOffers_3' + * Create request for operation 'updateGoodsQuestionTextEntity' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCampaignOffers_3Request($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_3'][0]) + public function updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateCampaignOffers_3' + 'Missing the required parameter $business_id when calling updateGoodsQuestionTextEntity' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateCampaignOffers_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateGoodsQuestionTextEntity, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_campaign_offers_request' is set - if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { + // verify the required parameter 'update_goods_question_text_entity_request' is set + if ($update_goods_question_text_entity_request === null || (is_array($update_goods_question_text_entity_request) && count($update_goods_question_text_entity_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers_3' + 'Missing the required parameter $update_goods_question_text_entity_request when calling updateGoodsQuestionTextEntity' ); } - $resourcePath = '/campaigns/{campaignId}/offers/update'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -53473,10 +42406,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -53489,12 +42422,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_campaign_offers_request)) { + if (isset($update_goods_question_text_entity_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_question_text_entity_request)); } else { - $httpBody = $update_campaign_offers_request; + $httpBody = $update_goods_question_text_entity_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -53552,40 +42485,40 @@ class ExpressApi } /** - * Operation updateGoodsFeedbackComment_3 + * Operation updateOfferContent * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateGoodsFeedbackComment_3($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_3'][0]) + public function updateOfferContent($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - list($response) = $this->updateGoodsFeedbackComment_3WithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); + list($response) = $this->updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, $contentType); return $response; } /** - * Operation updateGoodsFeedbackComment_3WithHttpInfo + * Operation updateOfferContentWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateGoodsFeedbackComment_3WithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_3'][0]) + public function updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - $request = $this->updateGoodsFeedbackComment_3Request($business_id, $update_goods_feedback_comment_request, $contentType); + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -53612,196 +42545,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -53815,44 +42609,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + '\OpenAPI\Client\Model\UpdateOfferContentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53860,7 +42631,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53868,7 +42639,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53876,7 +42647,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53884,7 +42655,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53892,7 +42663,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53900,27 +42679,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateGoodsFeedbackComment_3Async + * Operation updateOfferContentAsync * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_3Async($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_3'][0]) + public function updateOfferContentAsync($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - return $this->updateGoodsFeedbackComment_3AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) + return $this->updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) ->then( function ($response) { return $response[0]; @@ -53929,21 +42710,21 @@ class ExpressApi } /** - * Operation updateGoodsFeedbackComment_3AsyncWithHttpInfo + * Operation updateOfferContentAsyncWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_3AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_3'][0]) + public function updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - $request = $this->updateGoodsFeedbackComment_3Request($business_id, $update_goods_feedback_comment_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -53982,37 +42763,37 @@ class ExpressApi } /** - * Create request for operation 'updateGoodsFeedbackComment_3' + * Create request for operation 'updateOfferContent' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGoodsFeedbackComment_3Request($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_3'][0]) + public function updateOfferContentRequest($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment_3' + 'Missing the required parameter $business_id when calling updateOfferContent' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateGoodsFeedbackComment_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateOfferContent, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_goods_feedback_comment_request' is set - if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { + // verify the required parameter 'update_offer_content_request' is set + if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment_3' + 'Missing the required parameter $update_offer_content_request when calling updateOfferContent' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/update'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -54038,12 +42819,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_goods_feedback_comment_request)) { + if (isset($update_offer_content_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_content_request)); } else { - $httpBody = $update_goods_feedback_comment_request; + $httpBody = $update_offer_content_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -54101,40 +42882,42 @@ class ExpressApi } /** - * Operation updateOfferContent_3 + * Operation updateOfferMappingEntries * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function updateOfferContent_3($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_3'][0]) + public function updateOfferMappingEntries($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - list($response) = $this->updateOfferContent_3WithHttpInfo($business_id, $update_offer_content_request, $contentType); + list($response) = $this->updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); return $response; } /** - * Operation updateOfferContent_3WithHttpInfo + * Operation updateOfferMappingEntriesWithHttpInfo * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function updateOfferContent_3WithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_3'][0]) + public function updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - $request = $this->updateOfferContent_3Request($business_id, $update_offer_content_request, $contentType); + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -54161,223 +42944,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferContentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -54391,44 +43008,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOfferContentResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54436,7 +43030,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54444,7 +43038,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54452,7 +43046,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54460,7 +43054,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54468,7 +43062,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54476,7 +43070,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54484,27 +43078,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferContent_3Async + * Operation updateOfferMappingEntriesAsync * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function updateOfferContent_3Async($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_3'][0]) + public function updateOfferMappingEntriesAsync($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - return $this->updateOfferContent_3AsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) + return $this->updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) ->then( function ($response) { return $response[0]; @@ -54513,21 +43110,22 @@ class ExpressApi } /** - * Operation updateOfferContent_3AsyncWithHttpInfo + * Operation updateOfferMappingEntriesAsyncWithHttpInfo * - * Редактирование категорийных характеристик товара + * Добавление и редактирование товаров в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function updateOfferContent_3AsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_3'][0]) + public function updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - $request = $this->updateOfferContent_3Request($business_id, $update_offer_content_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -54566,37 +43164,38 @@ class ExpressApi } /** - * Create request for operation 'updateOfferContent_3' + * Create request for operation 'updateOfferMappingEntries' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function updateOfferContent_3Request($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_3'][0]) + public function updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferContent_3' + 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateOfferContent_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOfferMappingEntries, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_offer_content_request' is set - if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { + // verify the required parameter 'update_offer_mapping_entry_request' is set + if ($update_offer_mapping_entry_request === null || (is_array($update_offer_mapping_entry_request) && count($update_offer_mapping_entry_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_content_request when calling updateOfferContent_3' + 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries' ); } - $resourcePath = '/businesses/{businessId}/offer-cards/update'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -54606,10 +43205,10 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -54622,12 +43221,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_offer_content_request)) { + if (isset($update_offer_mapping_entry_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_content_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mapping_entry_request)); } else { - $httpBody = $update_offer_content_request; + $httpBody = $update_offer_mapping_entry_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -54685,42 +43284,42 @@ class ExpressApi } /** - * Operation updateOfferMappingEntries_2 + * Operation updateOfferMappings * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferMappingEntries_2($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_2'][0]) + public function updateOfferMappings($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - list($response) = $this->updateOfferMappingEntries_2WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); + list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType); return $response; } /** - * Operation updateOfferMappingEntries_2WithHttpInfo + * Operation updateOfferMappingsWithHttpInfo * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappingEntries_2WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_2'][0]) + public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $request = $this->updateOfferMappingEntries_2Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -54747,223 +43346,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -54977,44 +43410,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55022,7 +43432,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55030,7 +43440,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55038,7 +43448,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55046,7 +43456,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55054,7 +43464,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55062,7 +43472,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55070,28 +43480,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappingEntries_2Async + * Operation updateOfferMappingsAsync * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function updateOfferMappingEntries_2Async($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_2'][0]) + public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - return $this->updateOfferMappingEntries_2AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) + return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -55100,22 +43512,22 @@ class ExpressApi } /** - * Operation updateOfferMappingEntries_2AsyncWithHttpInfo + * Operation updateOfferMappingsAsyncWithHttpInfo * - * Добавление и редактирование товаров в каталоге + * Добавление товаров в каталог и изменение информации о них * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function updateOfferMappingEntries_2AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_2'][0]) + public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOfferMappingEntries_2Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -55154,51 +43566,61 @@ class ExpressApi } /** - * Create request for operation 'updateOfferMappingEntries_2' + * Create request for operation 'updateOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function updateOfferMappingEntries_2Request($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_2'][0]) + public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries_2' + 'Missing the required parameter $business_id when calling updateOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOfferMappingEntries_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateOfferMappings, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_offer_mapping_entry_request' is set - if ($update_offer_mapping_entry_request === null || (is_array($update_offer_mapping_entry_request) && count($update_offer_mapping_entry_request) === 0)) { + // verify the required parameter 'update_offer_mappings_request' is set + if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries_2' + 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings' ); } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/updates'; + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/update'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -55211,12 +43633,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_offer_mapping_entry_request)) { + if (isset($update_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mapping_entry_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mappings_request)); } else { - $httpBody = $update_offer_mapping_entry_request; + $httpBody = $update_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -55274,40 +43696,41 @@ class ExpressApi } /** - * Operation updateOfferMappings_3 + * Operation updateOrderItems * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return void */ - public function updateOfferMappings_3($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_3'][0]) + public function updateOrderItems($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - list($response) = $this->updateOfferMappings_3WithHttpInfo($business_id, $update_offer_mappings_request, $contentType); - return $response; + $this->updateOrderItemsWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType); } /** - * Operation updateOfferMappings_3WithHttpInfo + * Operation updateOrderItemsWithHttpInfo * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappings_3WithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_3'][0]) + public function updateOrderItemsWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - $request = $this->updateOfferMappings_3Request($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -55332,276 +43755,9 @@ class ExpressApi $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55609,7 +43765,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55617,7 +43773,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55625,7 +43781,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55633,7 +43789,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55641,15 +43797,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55657,27 +43805,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappings_3Async + * Operation updateOrderItemsAsync * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_3Async($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_3'][0]) + public function updateOrderItemsAsync($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - return $this->updateOfferMappings_3AsyncWithHttpInfo($business_id, $update_offer_mappings_request, $contentType) + return $this->updateOrderItemsAsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType) ->then( function ($response) { return $response[0]; @@ -55686,40 +43837,28 @@ class ExpressApi } /** - * Operation updateOfferMappings_3AsyncWithHttpInfo + * Operation updateOrderItemsAsyncWithHttpInfo * - * Добавление товаров в каталог и изменение информации о них + * Удаление товаров из заказа или уменьшение их числа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_3AsyncWithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_3'][0]) + public function updateOrderItemsAsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - $request = $this->updateOfferMappings_3Request($business_id, $update_offer_mappings_request, $contentType); + $returnType = ''; + $request = $this->updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -55739,37 +43878,45 @@ class ExpressApi } /** - * Create request for operation 'updateOfferMappings_3' + * Create request for operation 'updateOrderItems' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferMappings_3Request($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_3'][0]) + public function updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferMappings_3' + 'Missing the required parameter $campaign_id when calling updateOrderItems' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updateOfferMappings_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOrderItems, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_offer_mappings_request' is set - if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings_3' + 'Missing the required parameter $order_id when calling updateOrderItems' + ); + } + + // verify the required parameter 'update_order_item_request' is set + if ($update_order_item_request === null || (is_array($update_order_item_request) && count($update_order_item_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_order_item_request when calling updateOrderItems' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/update'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -55779,10 +43926,18 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -55795,12 +43950,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_offer_mappings_request)) { + if (isset($update_order_item_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mappings_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_item_request)); } else { - $httpBody = $update_offer_mappings_request; + $httpBody = $update_order_item_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -55850,7 +44005,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -55858,41 +44013,42 @@ class ExpressApi } /** - * Operation updateOrderItems_2 + * Operation updateOrderStatus * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderItems_2($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_2'][0]) + public function updateOrderStatus($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $this->updateOrderItems_2WithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType); + list($response) = $this->updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + return $response; } /** - * Operation updateOrderItems_2WithHttpInfo + * Operation updateOrderStatusWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderItems_2WithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_2'][0]) + public function updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $request = $this->updateOrderItems_2Request($campaign_id, $order_id, $update_order_item_request, $contentType); + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -55917,10 +44073,81 @@ class ExpressApi $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55928,7 +44155,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55936,7 +44163,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55944,7 +44171,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55952,7 +44179,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55960,7 +44187,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55968,28 +44195,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderItems_2Async + * Operation updateOrderStatusAsync * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderItems_2Async($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_2'][0]) + public function updateOrderStatusAsync($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - return $this->updateOrderItems_2AsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType) + return $this->updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -55998,28 +44227,41 @@ class ExpressApi } /** - * Operation updateOrderItems_2AsyncWithHttpInfo + * Operation updateOrderStatusAsyncWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderItems_2AsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_2'][0]) + public function updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $returnType = ''; - $request = $this->updateOrderItems_2Request($campaign_id, $order_id, $update_order_item_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -56039,45 +44281,45 @@ class ExpressApi } /** - * Create request for operation 'updateOrderItems_2' + * Create request for operation 'updateOrderStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderItems_2Request($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_2'][0]) + public function updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderItems_2' + 'Missing the required parameter $campaign_id when calling updateOrderStatus' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOrderItems_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOrderStatus, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderItems_2' + 'Missing the required parameter $order_id when calling updateOrderStatus' ); } - // verify the required parameter 'update_order_item_request' is set - if ($update_order_item_request === null || (is_array($update_order_item_request) && count($update_order_item_request) === 0)) { + // verify the required parameter 'update_order_status_request' is set + if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_item_request when calling updateOrderItems_2' + 'Missing the required parameter $update_order_status_request when calling updateOrderStatus' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/items'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -56111,12 +44353,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_order_item_request)) { + if (isset($update_order_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_item_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); } else { - $httpBody = $update_order_item_request; + $httpBody = $update_order_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -56174,42 +44416,40 @@ class ExpressApi } /** - * Operation updateOrderStatus_2 + * Operation updateOrderStatuses * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStatus_2($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_2'][0]) + public function updateOrderStatuses($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - list($response) = $this->updateOrderStatus_2WithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + list($response) = $this->updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); return $response; } /** - * Operation updateOrderStatus_2WithHttpInfo + * Operation updateOrderStatusesWithHttpInfo * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStatus_2WithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_2'][0]) + public function updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - $request = $this->updateOrderStatus_2Request($campaign_id, $order_id, $update_order_status_request, $contentType); + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -56236,196 +44476,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -56439,44 +44534,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56484,7 +44556,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56492,7 +44564,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56500,7 +44572,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56508,7 +44580,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56516,7 +44588,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56524,28 +44596,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStatus_2Async + * Operation updateOrderStatusesAsync * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatus_2Async($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_2'][0]) + public function updateOrderStatusesAsync($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - return $this->updateOrderStatus_2AsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) + return $this->updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) ->then( function ($response) { return $response[0]; @@ -56554,22 +44627,21 @@ class ExpressApi } /** - * Operation updateOrderStatus_2AsyncWithHttpInfo + * Operation updateOrderStatusesAsyncWithHttpInfo * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatus_2AsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_2'][0]) + public function updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - $request = $this->updateOrderStatus_2Request($campaign_id, $order_id, $update_order_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -56608,45 +44680,37 @@ class ExpressApi } /** - * Create request for operation 'updateOrderStatus_2' + * Create request for operation 'updateOrderStatuses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStatus_2Request($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_2'][0]) + public function updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStatus_2' + 'Missing the required parameter $campaign_id when calling updateOrderStatuses' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOrderStatus_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOrderStatuses, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderStatus_2' - ); - } - - // verify the required parameter 'update_order_status_request' is set - if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { + // verify the required parameter 'update_order_statuses_request' is set + if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_status_request when calling updateOrderStatus_2' + 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/status'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/status-update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -56663,14 +44727,6 @@ class ExpressApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -56680,12 +44736,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_order_status_request)) { + if (isset($update_order_statuses_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); } else { - $httpBody = $update_order_status_request; + $httpBody = $update_order_statuses_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -56735,7 +44791,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -56743,40 +44799,40 @@ class ExpressApi } /** - * Operation updateOrderStatuses_2 + * Operation updatePrices * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStatuses_2($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_2'][0]) + public function updatePrices($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - list($response) = $this->updateOrderStatuses_2WithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); + list($response) = $this->updatePricesWithHttpInfo($campaign_id, $update_prices_request, $contentType); return $response; } /** - * Operation updateOrderStatuses_2WithHttpInfo + * Operation updatePricesWithHttpInfo * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStatuses_2WithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_2'][0]) + public function updatePricesWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - $request = $this->updateOrderStatuses_2Request($campaign_id, $update_order_statuses_request, $contentType); + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -56803,196 +44859,57 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -57006,44 +44923,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57051,7 +44945,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57059,7 +44953,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57067,7 +44961,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57075,7 +44969,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57083,7 +44977,15 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57091,27 +44993,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStatuses_2Async + * Operation updatePricesAsync * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatuses_2Async($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_2'][0]) + public function updatePricesAsync($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - return $this->updateOrderStatuses_2AsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) + return $this->updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -57120,21 +45024,21 @@ class ExpressApi } /** - * Operation updateOrderStatuses_2AsyncWithHttpInfo + * Operation updatePricesAsyncWithHttpInfo * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatuses_2AsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_2'][0]) + public function updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - $request = $this->updateOrderStatuses_2Request($campaign_id, $update_order_statuses_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -57173,37 +45077,37 @@ class ExpressApi } /** - * Create request for operation 'updateOrderStatuses_2' + * Create request for operation 'updatePrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStatuses_2Request($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_2'][0]) + public function updatePricesRequest($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStatuses_2' + 'Missing the required parameter $campaign_id when calling updatePrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateOrderStatuses_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updatePrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_order_statuses_request' is set - if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { + // verify the required parameter 'update_prices_request' is set + if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses_2' + 'Missing the required parameter $update_prices_request when calling updatePrices' ); } - $resourcePath = '/campaigns/{campaignId}/orders/status-update'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -57229,12 +45133,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_order_statuses_request)) { + if (isset($update_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); } else { - $httpBody = $update_order_statuses_request; + $httpBody = $update_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -57292,40 +45196,40 @@ class ExpressApi } /** - * Operation updatePrices_3 + * Operation updatePromoOffers * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePrices_3($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_3'][0]) + public function updatePromoOffers($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - list($response) = $this->updatePrices_3WithHttpInfo($campaign_id, $update_prices_request, $contentType); + list($response) = $this->updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, $contentType); return $response; } /** - * Operation updatePrices_3WithHttpInfo + * Operation updatePromoOffersWithHttpInfo * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePrices_3WithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_3'][0]) + public function updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $request = $this->updatePrices_3Request($campaign_id, $update_prices_request, $contentType); + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -57352,223 +45256,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -57582,44 +45314,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57627,7 +45336,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57635,7 +45344,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57643,7 +45352,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57651,7 +45360,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57659,15 +45368,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57675,27 +45376,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePrices_3Async + * Operation updatePromoOffersAsync * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_3Async($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_3'][0]) + public function updatePromoOffersAsync($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - return $this->updatePrices_3AsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) + return $this->updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -57704,21 +45407,21 @@ class ExpressApi } /** - * Operation updatePrices_3AsyncWithHttpInfo + * Operation updatePromoOffersAsyncWithHttpInfo * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_3AsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_3'][0]) + public function updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updatePrices_3Request($campaign_id, $update_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -57757,37 +45460,37 @@ class ExpressApi } /** - * Create request for operation 'updatePrices_3' + * Create request for operation 'updatePromoOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePrices_3Request($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_3'][0]) + public function updatePromoOffersRequest($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updatePrices_3' + 'Missing the required parameter $business_id when calling updatePromoOffers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updatePrices_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updatePromoOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_prices_request' is set - if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { + // verify the required parameter 'update_promo_offers_request' is set + if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_prices_request when calling updatePrices_3' + 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offer-prices/updates'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -57797,10 +45500,10 @@ class ExpressApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -57813,12 +45516,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_prices_request)) { + if (isset($update_promo_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_promo_offers_request)); } else { - $httpBody = $update_prices_request; + $httpBody = $update_promo_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -57876,40 +45579,40 @@ class ExpressApi } /** - * Operation updatePromoOffers_3 + * Operation updateStocks * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePromoOffers_3($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_3'][0]) + public function updateStocks($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - list($response) = $this->updatePromoOffers_3WithHttpInfo($business_id, $update_promo_offers_request, $contentType); + list($response) = $this->updateStocksWithHttpInfo($campaign_id, $update_stocks_request, $contentType); return $response; } /** - * Operation updatePromoOffers_3WithHttpInfo + * Operation updateStocksWithHttpInfo * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePromoOffers_3WithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_3'][0]) + public function updateStocksWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - $request = $this->updatePromoOffers_3Request($business_id, $update_promo_offers_request, $contentType); + $request = $this->updateStocksRequest($campaign_id, $update_stocks_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -57936,196 +45639,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdatePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -58139,44 +45697,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58184,7 +45719,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58192,7 +45727,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58200,7 +45735,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58208,7 +45743,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58216,7 +45751,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58224,27 +45759,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePromoOffers_3Async + * Operation updateStocksAsync * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_3Async($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_3'][0]) + public function updateStocksAsync($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - return $this->updatePromoOffers_3AsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) + return $this->updateStocksAsyncWithHttpInfo($campaign_id, $update_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -58253,21 +45790,21 @@ class ExpressApi } /** - * Operation updatePromoOffers_3AsyncWithHttpInfo + * Operation updateStocksAsyncWithHttpInfo * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_3AsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_3'][0]) + public function updateStocksAsyncWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - $request = $this->updatePromoOffers_3Request($business_id, $update_promo_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateStocksRequest($campaign_id, $update_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -58306,37 +45843,37 @@ class ExpressApi } /** - * Create request for operation 'updatePromoOffers_3' + * Create request for operation 'updateStocks' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePromoOffers_3Request($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_3'][0]) + public function updateStocksRequest($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updatePromoOffers_3' + 'Missing the required parameter $campaign_id when calling updateStocks' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling ExpressApi.updatePromoOffers_3, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateStocks, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_promo_offers_request' is set - if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { + // verify the required parameter 'update_stocks_request' is set + if ($update_stocks_request === null || (is_array($update_stocks_request) && count($update_stocks_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers_3' + 'Missing the required parameter $update_stocks_request when calling updateStocks' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/update'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -58346,10 +45883,10 @@ class ExpressApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -58362,12 +45899,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_promo_offers_request)) { + if (isset($update_stocks_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_promo_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stocks_request)); } else { - $httpBody = $update_promo_offers_request; + $httpBody = $update_stocks_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -58417,7 +45954,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -58425,40 +45962,40 @@ class ExpressApi } /** - * Operation updateStocks_2 + * Operation updateWarehouseStatus * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateStocks_2($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_2'][0]) + public function updateWarehouseStatus($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - list($response) = $this->updateStocks_2WithHttpInfo($campaign_id, $update_stocks_request, $contentType); + list($response) = $this->updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType); return $response; } /** - * Operation updateStocks_2WithHttpInfo + * Operation updateWarehouseStatusWithHttpInfo * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateStocks_2WithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_2'][0]) + public function updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - $request = $this->updateStocks_2Request($campaign_id, $update_stocks_request, $contentType); + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -58485,196 +46022,45 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -58688,44 +46074,21 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58733,7 +46096,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58741,7 +46104,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58749,15 +46112,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58765,7 +46120,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58773,27 +46128,29 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateStocks_2Async + * Operation updateWarehouseStatusAsync * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStocks_2Async($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_2'][0]) + public function updateWarehouseStatusAsync($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - return $this->updateStocks_2AsyncWithHttpInfo($campaign_id, $update_stocks_request, $contentType) + return $this->updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -58802,21 +46159,21 @@ class ExpressApi } /** - * Operation updateStocks_2AsyncWithHttpInfo + * Operation updateWarehouseStatusAsyncWithHttpInfo * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStocks_2AsyncWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_2'][0]) + public function updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateStocks_2Request($campaign_id, $update_stocks_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse'; + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -58855,37 +46212,37 @@ class ExpressApi } /** - * Create request for operation 'updateStocks_2' + * Create request for operation 'updateWarehouseStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateStocks_2Request($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_2'][0]) + public function updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateStocks_2' + 'Missing the required parameter $campaign_id when calling updateWarehouseStatus' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateStocks_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.updateWarehouseStatus, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_stocks_request' is set - if ($update_stocks_request === null || (is_array($update_stocks_request) && count($update_stocks_request) === 0)) { + // verify the required parameter 'update_warehouse_status_request' is set + if ($update_warehouse_status_request === null || (is_array($update_warehouse_status_request) && count($update_warehouse_status_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_stocks_request when calling updateStocks_2' + 'Missing the required parameter $update_warehouse_status_request when calling updateWarehouseStatus' ); } - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/warehouse/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -58911,12 +46268,12 @@ class ExpressApi ); // for model (json/xml) - if (isset($update_stocks_request)) { + if (isset($update_warehouse_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stocks_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_warehouse_status_request)); } else { - $httpBody = $update_stocks_request; + $httpBody = $update_warehouse_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -58966,7 +46323,7 @@ class ExpressApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -58974,42 +46331,42 @@ class ExpressApi } /** - * Operation verifyOrderEac_0 + * Operation verifyOrderEac * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request verify_order_eac_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VerifyOrderEacResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function verifyOrderEac_0($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac_0'][0]) + public function verifyOrderEac($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac'][0]) { - list($response) = $this->verifyOrderEac_0WithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, $contentType); + list($response) = $this->verifyOrderEacWithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, $contentType); return $response; } /** - * Operation verifyOrderEac_0WithHttpInfo + * Operation verifyOrderEacWithHttpInfo * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VerifyOrderEacResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function verifyOrderEac_0WithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac_0'][0]) + public function verifyOrderEacWithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac'][0]) { - $request = $this->verifyOrderEac_0Request($campaign_id, $order_id, $verify_order_eac_request, $contentType); + $request = $this->verifyOrderEacRequest($campaign_id, $order_id, $verify_order_eac_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -59036,196 +46393,51 @@ class ExpressApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\VerifyOrderEacResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\VerifyOrderEacResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\VerifyOrderEacResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\VerifyOrderEacResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -59239,34 +46451,11 @@ class ExpressApi ); } - $returnType = '\OpenAPI\Client\Model\VerifyOrderEacResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\VerifyOrderEacResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -59276,7 +46465,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59284,7 +46473,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59292,7 +46481,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59300,7 +46489,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59308,7 +46497,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59316,7 +46505,7 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59324,28 +46513,30 @@ class ExpressApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation verifyOrderEac_0Async + * Operation verifyOrderEacAsync * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function verifyOrderEac_0Async($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac_0'][0]) + public function verifyOrderEacAsync($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac'][0]) { - return $this->verifyOrderEac_0AsyncWithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, $contentType) + return $this->verifyOrderEacAsyncWithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, $contentType) ->then( function ($response) { return $response[0]; @@ -59354,22 +46545,22 @@ class ExpressApi } /** - * Operation verifyOrderEac_0AsyncWithHttpInfo + * Operation verifyOrderEacAsyncWithHttpInfo * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function verifyOrderEac_0AsyncWithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac_0'][0]) + public function verifyOrderEacAsyncWithHttpInfo($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac'][0]) { $returnType = '\OpenAPI\Client\Model\VerifyOrderEacResponse'; - $request = $this->verifyOrderEac_0Request($campaign_id, $order_id, $verify_order_eac_request, $contentType); + $request = $this->verifyOrderEacRequest($campaign_id, $order_id, $verify_order_eac_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -59408,45 +46599,45 @@ class ExpressApi } /** - * Create request for operation 'verifyOrderEac_0' + * Create request for operation 'verifyOrderEac' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function verifyOrderEac_0Request($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac_0'][0]) + public function verifyOrderEacRequest($campaign_id, $order_id, $verify_order_eac_request, string $contentType = self::contentTypes['verifyOrderEac'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling verifyOrderEac_0' + 'Missing the required parameter $campaign_id when calling verifyOrderEac' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.verifyOrderEac_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling ExpressApi.verifyOrderEac, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling verifyOrderEac_0' + 'Missing the required parameter $order_id when calling verifyOrderEac' ); } // verify the required parameter 'verify_order_eac_request' is set if ($verify_order_eac_request === null || (is_array($verify_order_eac_request) && count($verify_order_eac_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $verify_order_eac_request when calling verifyOrderEac_0' + 'Missing the required parameter $verify_order_eac_request when calling verifyOrderEac' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/verifyEac'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/verifyEac'; $formParams = []; $queryParams = []; $headerParams = []; @@ -59558,6 +46749,57 @@ class ExpressApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/FbsApi.php b/erp24/lib/yandex_market_api/Api/FbsApi.php index 23ddfa7b..09ed8fcb 100644 --- a/erp24/lib/yandex_market_api/Api/FbsApi.php +++ b/erp24/lib/yandex_market_api/Api/FbsApi.php @@ -1,7 +1,7 @@ [ + 'addHiddenOffers' => [ 'application/json', ], - 'addOffersToArchive_2' => [ + 'addOffersToArchive' => [ 'application/json', ], - 'calculateTariffs_0' => [ + 'calculateTariffs' => [ 'application/json', ], - 'confirmBusinessPrices_2' => [ + 'confirmBusinessPrices' => [ 'application/json', ], - 'confirmCampaignPrices_2' => [ + 'confirmCampaignPrices' => [ 'application/json', ], - 'confirmShipment_0' => [ + 'confirmShipment' => [ 'application/json', ], - 'createChat_1' => [ + 'createChat' => [ 'application/json', ], - 'deleteCampaignOffers_2' => [ + 'deleteCampaignOffers' => [ 'application/json', ], - 'deleteGoodsFeedbackComment_1' => [ + 'deleteGoodsFeedbackComment' => [ 'application/json', ], - 'deleteHiddenOffers_1' => [ + 'deleteHiddenOffers' => [ 'application/json', ], - 'deleteOffersFromArchive_2' => [ + 'deleteOffers' => [ 'application/json', ], - 'deleteOffers_2' => [ + 'deleteOffersFromArchive' => [ 'application/json', ], - 'deletePromoOffers_1' => [ + 'deletePromoOffers' => [ 'application/json', ], - 'downloadShipmentAct_0' => [ + 'downloadShipmentAct' => [ 'application/json', ], - 'downloadShipmentDiscrepancyAct_0' => [ + 'downloadShipmentDiscrepancyAct' => [ 'application/json', ], - 'downloadShipmentInboundAct_0' => [ + 'downloadShipmentInboundAct' => [ 'application/json', ], - 'downloadShipmentPalletLabels_0' => [ + 'downloadShipmentPalletLabels' => [ 'application/json', ], - 'downloadShipmentReceptionTransferAct_0' => [ + 'downloadShipmentReceptionTransferAct' => [ 'application/json', ], - 'downloadShipmentTransportationWaybill_0' => [ + 'downloadShipmentTransportationWaybill' => [ 'application/json', ], - 'generateBoostConsolidatedReport_1' => [ + 'generateBannersStatisticsReport' => [ 'application/json', ], - 'generateCompetitorsPositionReport_2' => [ + 'generateBoostConsolidatedReport' => [ 'application/json', ], - 'generateGoodsFeedbackReport_1' => [ + 'generateClosureDocumentsDetalizationReport' => [ 'application/json', ], - 'generateGoodsRealizationReport_1' => [ + 'generateClosureDocumentsReport' => [ 'application/json', ], - 'generateMassOrderLabelsReport_0' => [ + 'generateCompetitorsPositionReport' => [ 'application/json', ], - 'generateOrderLabel_0' => [ + 'generateGoodsFeedbackReport' => [ 'application/json', ], - 'generateOrderLabels_0' => [ + 'generateGoodsPricesReport' => [ 'application/json', ], - 'generatePricesReport_1' => [ + 'generateGoodsRealizationReport' => [ 'application/json', ], - 'generateShelfsStatisticsReport_1' => [ + 'generateJewelryFiscalReport' => [ 'application/json', ], - 'generateShipmentListDocumentReport_0' => [ + 'generateKeyIndicatorsReport' => [ 'application/json', ], - 'generateShowsSalesReport_2' => [ + 'generateMassOrderLabelsReport' => [ 'application/json', ], - 'generateStocksOnWarehousesReport_1' => [ + 'generateOfferBarcodes' => [ 'application/json', ], - 'generateUnitedMarketplaceServicesReport_2' => [ + 'generateOrderLabel' => [ 'application/json', ], - 'generateUnitedNettingReport_2' => [ + 'generateOrderLabels' => [ 'application/json', ], - 'generateUnitedOrdersReport_1' => [ + 'generatePricesReport' => [ 'application/json', ], - 'getAllOffers_1' => [ + 'generateSalesGeographyReport' => [ 'application/json', ], - 'getBidsInfoForBusiness_1' => [ + 'generateShelfsStatisticsReport' => [ 'application/json', ], - 'getBidsRecommendations_1' => [ + 'generateShipmentListDocumentReport' => [ 'application/json', ], - 'getBusinessQuarantineOffers_2' => [ + 'generateShowsBoostReport' => [ 'application/json', ], - 'getBusinessSettings_1' => [ + 'generateShowsSalesReport' => [ 'application/json', ], - 'getCampaignLogins_2' => [ + 'generateStocksOnWarehousesReport' => [ 'application/json', ], - 'getCampaignOffers_2' => [ + 'generateUnitedMarketplaceServicesReport' => [ 'application/json', ], - 'getCampaignQuarantineOffers_2' => [ + 'generateUnitedNettingReport' => [ 'application/json', ], - 'getCampaignRegion_2' => [ + 'generateUnitedOrdersReport' => [ 'application/json', ], - 'getCampaignSettings_1' => [ + 'generateUnitedReturnsReport' => [ 'application/json', ], - 'getCampaign_2' => [ + 'getAuthTokenInfo' => [ 'application/json', ], - 'getCampaignsByLogin_2' => [ + 'getBidsInfoForBusiness' => [ 'application/json', ], - 'getCampaigns_2' => [ + 'getBidsRecommendations' => [ 'application/json', ], - 'getCategoriesMaxSaleQuantum_1' => [ + 'getBusinessOrders' => [ 'application/json', ], - 'getCategoriesTree_1' => [ + 'getBusinessQuarantineOffers' => [ 'application/json', ], - 'getCategoryContentParameters_2' => [ + 'getBusinessSettings' => [ 'application/json', ], - 'getChatHistory_1' => [ + 'getCampaign' => [ 'application/json', ], - 'getChats_1' => [ + 'getCampaignOffers' => [ 'application/json', ], - 'getDeliveryServices_0' => [ + 'getCampaignQuarantineOffers' => [ 'application/json', ], - 'getFeedIndexLogs_1' => [ + 'getCampaignSettings' => [ 'application/json', ], - 'getFeed_1' => [ + 'getCampaigns' => [ 'application/json', ], - 'getFeedbackAndCommentUpdates_2' => [ + 'getCategoriesMaxSaleQuantum' => [ 'application/json', ], - 'getFeeds_1' => [ + 'getCategoriesTree' => [ 'application/json', ], - 'getGoodsFeedbackComments_1' => [ + 'getCategoryContentParameters' => [ 'application/json', ], - 'getGoodsFeedbacks_1' => [ + 'getChat' => [ 'application/json', ], - 'getGoodsStats_1' => [ + 'getChatHistory' => [ 'application/json', ], - 'getHiddenOffers_1' => [ + 'getChatMessage' => [ 'application/json', ], - 'getOfferCardsContentStatus_2' => [ + 'getChats' => [ 'application/json', ], - 'getOfferMappingEntries_1' => [ + 'getDefaultPrices' => [ 'application/json', ], - 'getOfferMappings_2' => [ + 'getDeliveryServices' => [ 'application/json', ], - 'getOfferRecommendations_2' => [ + 'getGoodsFeedbackComments' => [ 'application/json', ], - 'getOffers_1' => [ + 'getGoodsFeedbacks' => [ 'application/json', ], - 'getOrderBusinessBuyerInfo_0' => [ + 'getGoodsQuestionAnswers' => [ 'application/json', ], - 'getOrderBusinessDocumentsInfo_0' => [ + 'getGoodsQuestions' => [ 'application/json', ], - 'getOrderLabelsData_0' => [ + 'getGoodsStats' => [ 'application/json', ], - 'getOrder_1' => [ + 'getHiddenOffers' => [ 'application/json', ], - 'getOrdersStats_1' => [ + 'getOfferCardsContentStatus' => [ 'application/json', ], - 'getOrders_0' => [ + 'getOfferMappingEntries' => [ 'application/json', ], - 'getPricesByOfferIds_1' => [ + 'getOfferMappings' => [ 'application/json', ], - 'getPrices_1' => [ + 'getOfferRecommendations' => [ 'application/json', ], - 'getPromoOffers_1' => [ + 'getOrder' => [ 'application/json', ], - 'getPromos_1' => [ + 'getOrderBusinessBuyerInfo' => [ 'application/json', ], - 'getQualityRatingDetails_0' => [ + 'getOrderBusinessDocumentsInfo' => [ 'application/json', ], - 'getQualityRatings_1' => [ + 'getOrderIdentifiersStatus' => [ 'application/json', ], - 'getReportInfo_2' => [ + 'getOrderLabelsData' => [ 'application/json', ], - 'getReturnApplication_0' => [ + 'getOrders' => [ 'application/json', ], - 'getReturnPhoto_0' => [ + 'getOrdersStats' => [ 'application/json', ], - 'getReturn_0' => [ + 'getPagedWarehouses' => [ 'application/json', ], - 'getReturns_0' => [ + 'getPrices' => [ 'application/json', ], - 'getShipmentOrdersInfo_0' => [ + 'getPricesByOfferIds' => [ 'application/json', ], - 'getShipment_0' => [ + 'getPromoOffers' => [ 'application/json', ], - 'getStocks_1' => [ + 'getPromos' => [ 'application/json', ], - 'getSuggestedOfferMappingEntries_1' => [ + 'getQualityRatingDetails' => [ 'application/json', ], - 'getSuggestedOfferMappings_2' => [ + 'getQualityRatings' => [ 'application/json', ], - 'getSuggestedPrices_1' => [ + 'getRegionsCodes' => [ 'application/json', ], - 'getWarehouses_0' => [ + 'getReportInfo' => [ 'application/json', ], - 'provideOrderItemIdentifiers_0' => [ + 'getReturn' => [ 'application/json', ], - 'putBidsForBusiness_1' => [ + 'getReturnApplication' => [ 'application/json', ], - 'putBidsForCampaign_1' => [ + 'getReturnPhoto' => [ 'application/json', ], - 'refreshFeed_1' => [ + 'getReturns' => [ 'application/json', ], - 'searchRegionChildren_1' => [ + 'getShipment' => [ 'application/json', ], - 'searchRegionsById_1' => [ + 'getShipmentOrdersInfo' => [ 'application/json', ], - 'searchRegionsByName_1' => [ + 'getStocks' => [ 'application/json', ], - 'searchShipments_0' => [ + 'getSuggestedOfferMappingEntries' => [ 'application/json', ], - 'sendFileToChat_1' => [ + 'getSuggestedOfferMappings' => [ + 'application/json', + ], + 'getWarehouses' => [ + 'application/json', + ], + 'provideOrderItemIdentifiers' => [ + 'application/json', + ], + 'putBidsForBusiness' => [ + 'application/json', + ], + 'putBidsForCampaign' => [ + 'application/json', + ], + 'searchRegionChildren' => [ + 'application/json', + ], + 'searchRegionsById' => [ + 'application/json', + ], + 'searchRegionsByName' => [ + 'application/json', + ], + 'searchShipments' => [ + 'application/json', + ], + 'sendFileToChat' => [ 'multipart/form-data', ], - 'sendMessageToChat_1' => [ + 'sendMessageToChat' => [ + 'application/json', + ], + 'setOrderBoxLayout' => [ 'application/json', ], - 'setFeedParams_1' => [ + 'setOrderShipmentBoxes' => [ 'application/json', ], - 'setOrderBoxLayout_0' => [ + 'setShipmentPalletsCount' => [ 'application/json', ], - 'setOrderShipmentBoxes_0' => [ + 'skipGoodsFeedbacksReaction' => [ 'application/json', ], - 'setShipmentPalletsCount_0' => [ + 'submitReturnDecision' => [ 'application/json', ], - 'skipGoodsFeedbacksReaction_1' => [ + 'transferOrdersFromShipment' => [ 'application/json', ], - 'transferOrdersFromShipment_0' => [ + 'updateBusinessPrices' => [ 'application/json', ], - 'updateBusinessPrices_1' => [ + 'updateCampaignOffers' => [ 'application/json', ], - 'updateCampaignOffers_2' => [ + 'updateExternalOrderId' => [ 'application/json', ], - 'updateGoodsFeedbackComment_1' => [ + 'updateGoodsFeedbackComment' => [ 'application/json', ], - 'updateOfferContent_2' => [ + 'updateGoodsQuestionTextEntity' => [ 'application/json', ], - 'updateOfferMappingEntries_1' => [ + 'updateOfferContent' => [ 'application/json', ], - 'updateOfferMappings_2' => [ + 'updateOfferMappingEntries' => [ 'application/json', ], - 'updateOrderItems_0' => [ + 'updateOfferMappings' => [ 'application/json', ], - 'updateOrderStatus_0' => [ + 'updateOrderItems' => [ 'application/json', ], - 'updateOrderStatuses_0' => [ + 'updateOrderStatus' => [ 'application/json', ], - 'updatePrices_1' => [ + 'updateOrderStatuses' => [ 'application/json', ], - 'updatePromoOffers_1' => [ + 'updatePrices' => [ 'application/json', ], - 'updateStocks_0' => [ + 'updatePromoOffers' => [ + 'application/json', + ], + 'updateStocks' => [ + 'application/json', + ], + 'updateWarehouseStatus' => [ 'application/json', ], ]; @@ -434,10 +473,10 @@ class FbsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -474,40 +513,40 @@ class FbsApi } /** - * Operation addHiddenOffers_1 + * Operation addHiddenOffers * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addHiddenOffers_1($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_1'][0]) + public function addHiddenOffers($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - list($response) = $this->addHiddenOffers_1WithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); + list($response) = $this->addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); return $response; } /** - * Operation addHiddenOffers_1WithHttpInfo + * Operation addHiddenOffersWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addHiddenOffers_1WithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_1'][0]) + public function addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - $request = $this->addHiddenOffers_1Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -534,196 +573,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -737,34 +631,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -774,7 +645,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -782,7 +653,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -790,7 +661,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -798,7 +669,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -806,7 +677,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -814,7 +685,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -822,27 +693,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addHiddenOffers_1Async + * Operation addHiddenOffersAsync * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_1Async($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_1'][0]) + public function addHiddenOffersAsync($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - return $this->addHiddenOffers_1AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) + return $this->addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -851,21 +724,21 @@ class FbsApi } /** - * Operation addHiddenOffers_1AsyncWithHttpInfo + * Operation addHiddenOffersAsyncWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_1AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_1'][0]) + public function addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->addHiddenOffers_1Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -904,37 +777,37 @@ class FbsApi } /** - * Create request for operation 'addHiddenOffers_1' + * Create request for operation 'addHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addHiddenOffers_1Request($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_1'][0]) + public function addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling addHiddenOffers_1' + 'Missing the required parameter $campaign_id when calling addHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.addHiddenOffers_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.addHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'add_hidden_offers_request' is set if ($add_hidden_offers_request === null || (is_array($add_hidden_offers_request) && count($add_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers_1' + 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1023,40 +896,40 @@ class FbsApi } /** - * Operation addOffersToArchive_2 + * Operation addOffersToArchive * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addOffersToArchive_2($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_2'][0]) + public function addOffersToArchive($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - list($response) = $this->addOffersToArchive_2WithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); + list($response) = $this->addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); return $response; } /** - * Operation addOffersToArchive_2WithHttpInfo + * Operation addOffersToArchiveWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addOffersToArchive_2WithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_2'][0]) + public function addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - $request = $this->addOffersToArchive_2Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1083,223 +956,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AddOffersToArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1313,34 +1020,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1350,7 +1034,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1358,7 +1042,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1366,7 +1050,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1374,7 +1058,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1382,7 +1066,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1390,7 +1074,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1398,7 +1082,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1406,27 +1090,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addOffersToArchive_2Async + * Operation addOffersToArchiveAsync * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_2Async($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_2'][0]) + public function addOffersToArchiveAsync($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - return $this->addOffersToArchive_2AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) + return $this->addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1435,21 +1121,21 @@ class FbsApi } /** - * Operation addOffersToArchive_2AsyncWithHttpInfo + * Operation addOffersToArchiveAsyncWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_2AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_2'][0]) + public function addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - $request = $this->addOffersToArchive_2Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1488,37 +1174,37 @@ class FbsApi } /** - * Create request for operation 'addOffersToArchive_2' + * Create request for operation 'addOffersToArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addOffersToArchive_2Request($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_2'][0]) + public function addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling addOffersToArchive_2' + 'Missing the required parameter $business_id when calling addOffersToArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.addOffersToArchive_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.addOffersToArchive, must be bigger than or equal to 1.'); } // verify the required parameter 'add_offers_to_archive_request' is set if ($add_offers_to_archive_request === null || (is_array($add_offers_to_archive_request) && count($add_offers_to_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive_2' + 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/archive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1607,38 +1293,38 @@ class FbsApi } /** - * Operation calculateTariffs_0 + * Operation calculateTariffs * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function calculateTariffs_0($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_0'][0]) + public function calculateTariffs($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - list($response) = $this->calculateTariffs_0WithHttpInfo($calculate_tariffs_request, $contentType); + list($response) = $this->calculateTariffsWithHttpInfo($calculate_tariffs_request, $contentType); return $response; } /** - * Operation calculateTariffs_0WithHttpInfo + * Operation calculateTariffsWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function calculateTariffs_0WithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_0'][0]) + public function calculateTariffsWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - $request = $this->calculateTariffs_0Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1665,196 +1351,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CalculateTariffsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1868,34 +1409,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1905,7 +1423,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1913,7 +1431,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1921,7 +1439,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1929,7 +1447,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1937,7 +1455,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1945,7 +1463,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1953,26 +1471,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation calculateTariffs_0Async + * Operation calculateTariffsAsync * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_0Async($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_0'][0]) + public function calculateTariffsAsync($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - return $this->calculateTariffs_0AsyncWithHttpInfo($calculate_tariffs_request, $contentType) + return $this->calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1981,20 +1501,20 @@ class FbsApi } /** - * Operation calculateTariffs_0AsyncWithHttpInfo + * Operation calculateTariffsAsyncWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_0AsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_0'][0]) + public function calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - $request = $this->calculateTariffs_0Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2033,26 +1553,26 @@ class FbsApi } /** - * Create request for operation 'calculateTariffs_0' + * Create request for operation 'calculateTariffs' * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function calculateTariffs_0Request($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_0'][0]) + public function calculateTariffsRequest($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { // verify the required parameter 'calculate_tariffs_request' is set if ($calculate_tariffs_request === null || (is_array($calculate_tariffs_request) && count($calculate_tariffs_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs_0' + 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs' ); } - $resourcePath = '/tariffs/calculate'; + $resourcePath = '/v2/tariffs/calculate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2133,40 +1653,40 @@ class FbsApi } /** - * Operation confirmBusinessPrices_2 + * Operation confirmBusinessPrices * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmBusinessPrices_2($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_2'][0]) + public function confirmBusinessPrices($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - list($response) = $this->confirmBusinessPrices_2WithHttpInfo($business_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmBusinessPrices_2WithHttpInfo + * Operation confirmBusinessPricesWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmBusinessPrices_2WithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_2'][0]) + public function confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - $request = $this->confirmBusinessPrices_2Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2193,223 +1713,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2423,34 +1777,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2460,7 +1791,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2468,7 +1799,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2476,7 +1807,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2484,7 +1815,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2492,7 +1823,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2500,7 +1831,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2508,7 +1839,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2516,27 +1847,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmBusinessPrices_2Async + * Operation confirmBusinessPricesAsync * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_2Async($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_2'][0]) + public function confirmBusinessPricesAsync($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - return $this->confirmBusinessPrices_2AsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) + return $this->confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2545,21 +1878,21 @@ class FbsApi } /** - * Operation confirmBusinessPrices_2AsyncWithHttpInfo + * Operation confirmBusinessPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_2AsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_2'][0]) + public function confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmBusinessPrices_2Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2598,37 +1931,37 @@ class FbsApi } /** - * Create request for operation 'confirmBusinessPrices_2' + * Create request for operation 'confirmBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmBusinessPrices_2Request($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_2'][0]) + public function confirmBusinessPricesRequest($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling confirmBusinessPrices_2' + 'Missing the required parameter $business_id when calling confirmBusinessPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.confirmBusinessPrices_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.confirmBusinessPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices_2' + 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices' ); } - $resourcePath = '/businesses/{businessId}/price-quarantine/confirm'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2717,40 +2050,40 @@ class FbsApi } /** - * Operation confirmCampaignPrices_2 + * Operation confirmCampaignPrices * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmCampaignPrices_2($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_2'][0]) + public function confirmCampaignPrices($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - list($response) = $this->confirmCampaignPrices_2WithHttpInfo($campaign_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmCampaignPrices_2WithHttpInfo + * Operation confirmCampaignPricesWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmCampaignPrices_2WithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_2'][0]) + public function confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - $request = $this->confirmCampaignPrices_2Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2777,223 +2110,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3007,34 +2174,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3044,7 +2188,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3052,7 +2196,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3060,7 +2204,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3068,7 +2212,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3076,7 +2220,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3084,7 +2228,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3092,7 +2236,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3100,27 +2244,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmCampaignPrices_2Async + * Operation confirmCampaignPricesAsync * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_2Async($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_2'][0]) + public function confirmCampaignPricesAsync($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - return $this->confirmCampaignPrices_2AsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) + return $this->confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3129,21 +2275,21 @@ class FbsApi } /** - * Operation confirmCampaignPrices_2AsyncWithHttpInfo + * Operation confirmCampaignPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_2AsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_2'][0]) + public function confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmCampaignPrices_2Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3182,37 +2328,37 @@ class FbsApi } /** - * Create request for operation 'confirmCampaignPrices_2' + * Create request for operation 'confirmCampaignPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmCampaignPrices_2Request($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_2'][0]) + public function confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling confirmCampaignPrices_2' + 'Missing the required parameter $campaign_id when calling confirmCampaignPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.confirmCampaignPrices_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.confirmCampaignPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices_2' + 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3301,42 +2447,42 @@ class FbsApi } /** - * Operation confirmShipment_0 + * Operation confirmShipment * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request confirm_shipment_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request confirm_shipment_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmShipment_0($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment_0'][0]) + public function confirmShipment($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment'][0]) { - list($response) = $this->confirmShipment_0WithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request, $contentType); + list($response) = $this->confirmShipmentWithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request, $contentType); return $response; } /** - * Operation confirmShipment_0WithHttpInfo + * Operation confirmShipmentWithHttpInfo * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmShipment_0WithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment_0'][0]) + public function confirmShipmentWithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment'][0]) { - $request = $this->confirmShipment_0Request($campaign_id, $shipment_id, $confirm_shipment_request, $contentType); + $request = $this->confirmShipmentRequest($campaign_id, $shipment_id, $confirm_shipment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3363,196 +2509,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3566,34 +2567,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3603,7 +2581,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3611,7 +2589,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3619,7 +2597,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3627,7 +2605,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3635,7 +2613,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3643,7 +2621,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3651,28 +2629,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmShipment_0Async + * Operation confirmShipmentAsync * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmShipment_0Async($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment_0'][0]) + public function confirmShipmentAsync($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment'][0]) { - return $this->confirmShipment_0AsyncWithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request, $contentType) + return $this->confirmShipmentAsyncWithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3681,22 +2661,22 @@ class FbsApi } /** - * Operation confirmShipment_0AsyncWithHttpInfo + * Operation confirmShipmentAsyncWithHttpInfo * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmShipment_0AsyncWithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment_0'][0]) + public function confirmShipmentAsyncWithHttpInfo($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmShipment_0Request($campaign_id, $shipment_id, $confirm_shipment_request, $contentType); + $request = $this->confirmShipmentRequest($campaign_id, $shipment_id, $confirm_shipment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3735,42 +2715,42 @@ class FbsApi } /** - * Create request for operation 'confirmShipment_0' + * Create request for operation 'confirmShipment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmShipment_0Request($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment_0'][0]) + public function confirmShipmentRequest($campaign_id, $shipment_id, $confirm_shipment_request = null, string $contentType = self::contentTypes['confirmShipment'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling confirmShipment_0' + 'Missing the required parameter $campaign_id when calling confirmShipment' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.confirmShipment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.confirmShipment, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling confirmShipment_0' + 'Missing the required parameter $shipment_id when calling confirmShipment' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.confirmShipment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.confirmShipment, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3867,40 +2847,40 @@ class FbsApi } /** - * Operation createChat_1 + * Operation createChat * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function createChat_1($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_1'][0]) + public function createChat($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - list($response) = $this->createChat_1WithHttpInfo($business_id, $create_chat_request, $contentType); + list($response) = $this->createChatWithHttpInfo($business_id, $create_chat_request, $contentType); return $response; } /** - * Operation createChat_1WithHttpInfo + * Operation createChatWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createChat_1WithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_1'][0]) + public function createChatWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - $request = $this->createChat_1Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3927,196 +2907,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateChatResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateChatResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateChatResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4130,34 +2965,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4167,7 +2979,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4175,7 +2987,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4183,7 +2995,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4191,7 +3003,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4199,7 +3011,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4207,7 +3019,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4215,27 +3027,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation createChat_1Async + * Operation createChatAsync * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_1Async($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_1'][0]) + public function createChatAsync($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - return $this->createChat_1AsyncWithHttpInfo($business_id, $create_chat_request, $contentType) + return $this->createChatAsyncWithHttpInfo($business_id, $create_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4244,21 +3058,21 @@ class FbsApi } /** - * Operation createChat_1AsyncWithHttpInfo + * Operation createChatAsyncWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_1AsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_1'][0]) + public function createChatAsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - $request = $this->createChat_1Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4297,37 +3111,37 @@ class FbsApi } /** - * Create request for operation 'createChat_1' + * Create request for operation 'createChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createChat_1Request($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_1'][0]) + public function createChatRequest($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling createChat_1' + 'Missing the required parameter $business_id when calling createChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.createChat_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.createChat, must be bigger than or equal to 1.'); } // verify the required parameter 'create_chat_request' is set if ($create_chat_request === null || (is_array($create_chat_request) && count($create_chat_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_chat_request when calling createChat_1' + 'Missing the required parameter $create_chat_request when calling createChat' ); } - $resourcePath = '/businesses/{businessId}/chats/new'; + $resourcePath = '/v2/businesses/{businessId}/chats/new'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4416,40 +3230,40 @@ class FbsApi } /** - * Operation deleteCampaignOffers_2 + * Operation deleteCampaignOffers * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteCampaignOffers_2($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_2'][0]) + public function deleteCampaignOffers($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - list($response) = $this->deleteCampaignOffers_2WithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); + list($response) = $this->deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); return $response; } /** - * Operation deleteCampaignOffers_2WithHttpInfo + * Operation deleteCampaignOffersWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCampaignOffers_2WithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_2'][0]) + public function deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - $request = $this->deleteCampaignOffers_2Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4476,223 +3290,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4706,34 +3354,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4743,7 +3368,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4751,7 +3376,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4759,7 +3384,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4767,7 +3392,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4775,7 +3400,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4783,7 +3408,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4791,7 +3416,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4799,27 +3424,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteCampaignOffers_2Async + * Operation deleteCampaignOffersAsync * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_2Async($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_2'][0]) + public function deleteCampaignOffersAsync($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - return $this->deleteCampaignOffers_2AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) + return $this->deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4828,21 +3455,21 @@ class FbsApi } /** - * Operation deleteCampaignOffers_2AsyncWithHttpInfo + * Operation deleteCampaignOffersAsyncWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_2AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_2'][0]) + public function deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - $request = $this->deleteCampaignOffers_2Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4881,37 +3508,37 @@ class FbsApi } /** - * Create request for operation 'deleteCampaignOffers_2' + * Create request for operation 'deleteCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCampaignOffers_2Request($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_2'][0]) + public function deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteCampaignOffers_2' + 'Missing the required parameter $campaign_id when calling deleteCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.deleteCampaignOffers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.deleteCampaignOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_campaign_offers_request' is set if ($delete_campaign_offers_request === null || (is_array($delete_campaign_offers_request) && count($delete_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers_2' + 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5000,40 +3627,40 @@ class FbsApi } /** - * Operation deleteGoodsFeedbackComment_1 + * Operation deleteGoodsFeedbackComment * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteGoodsFeedbackComment_1($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_1'][0]) + public function deleteGoodsFeedbackComment($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - list($response) = $this->deleteGoodsFeedbackComment_1WithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); + list($response) = $this->deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation deleteGoodsFeedbackComment_1WithHttpInfo + * Operation deleteGoodsFeedbackCommentWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteGoodsFeedbackComment_1WithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_1'][0]) + public function deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - $request = $this->deleteGoodsFeedbackComment_1Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5060,196 +3687,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5263,34 +3745,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5300,7 +3759,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5308,7 +3767,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5316,7 +3775,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5324,7 +3783,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5332,7 +3791,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5340,7 +3799,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5348,27 +3807,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteGoodsFeedbackComment_1Async + * Operation deleteGoodsFeedbackCommentAsync * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_1Async($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_1'][0]) + public function deleteGoodsFeedbackCommentAsync($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - return $this->deleteGoodsFeedbackComment_1AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) + return $this->deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5377,21 +3838,21 @@ class FbsApi } /** - * Operation deleteGoodsFeedbackComment_1AsyncWithHttpInfo + * Operation deleteGoodsFeedbackCommentAsyncWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_1AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_1'][0]) + public function deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteGoodsFeedbackComment_1Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5430,37 +3891,37 @@ class FbsApi } /** - * Create request for operation 'deleteGoodsFeedbackComment_1' + * Create request for operation 'deleteGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteGoodsFeedbackComment_1Request($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_1'][0]) + public function deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment_1' + 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deleteGoodsFeedbackComment_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deleteGoodsFeedbackComment, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_goods_feedback_comment_request' is set if ($delete_goods_feedback_comment_request === null || (is_array($delete_goods_feedback_comment_request) && count($delete_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment_1' + 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/delete'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5549,40 +4010,40 @@ class FbsApi } /** - * Operation deleteHiddenOffers_1 + * Operation deleteHiddenOffers * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteHiddenOffers_1($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_1'][0]) + public function deleteHiddenOffers($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - list($response) = $this->deleteHiddenOffers_1WithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); + list($response) = $this->deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); return $response; } /** - * Operation deleteHiddenOffers_1WithHttpInfo + * Operation deleteHiddenOffersWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteHiddenOffers_1WithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_1'][0]) + public function deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - $request = $this->deleteHiddenOffers_1Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5609,223 +4070,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5839,34 +4134,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5876,7 +4148,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5884,7 +4156,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5892,7 +4164,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5900,7 +4172,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5908,7 +4180,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5916,7 +4188,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5924,7 +4196,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5932,27 +4204,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteHiddenOffers_1Async + * Operation deleteHiddenOffersAsync * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_1Async($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_1'][0]) + public function deleteHiddenOffersAsync($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - return $this->deleteHiddenOffers_1AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) + return $this->deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5961,21 +4235,21 @@ class FbsApi } /** - * Operation deleteHiddenOffers_1AsyncWithHttpInfo + * Operation deleteHiddenOffersAsyncWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_1AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_1'][0]) + public function deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteHiddenOffers_1Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6014,37 +4288,37 @@ class FbsApi } /** - * Create request for operation 'deleteHiddenOffers_1' + * Create request for operation 'deleteHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteHiddenOffers_1Request($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_1'][0]) + public function deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteHiddenOffers_1' + 'Missing the required parameter $campaign_id when calling deleteHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.deleteHiddenOffers_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.deleteHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_hidden_offers_request' is set if ($delete_hidden_offers_request === null || (is_array($delete_hidden_offers_request) && count($delete_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers_1' + 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6133,40 +4407,40 @@ class FbsApi } /** - * Operation deleteOffersFromArchive_2 + * Operation deleteOffers * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffersFromArchive_2($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_2'][0]) + public function deleteOffers($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - list($response) = $this->deleteOffersFromArchive_2WithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); + list($response) = $this->deleteOffersWithHttpInfo($business_id, $delete_offers_request, $contentType); return $response; } /** - * Operation deleteOffersFromArchive_2WithHttpInfo + * Operation deleteOffersWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffersFromArchive_2WithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_2'][0]) + public function deleteOffersWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $request = $this->deleteOffersFromArchive_2Request($business_id, $delete_offers_from_archive_request, $contentType); + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6193,223 +4467,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6423,44 +4531,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + '\OpenAPI\Client\Model\DeleteOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6468,7 +4553,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6476,7 +4561,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6484,7 +4569,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6492,7 +4577,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6500,7 +4585,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6508,7 +4593,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6516,27 +4601,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffersFromArchive_2Async + * Operation deleteOffersAsync * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_2Async($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_2'][0]) + public function deleteOffersAsync($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - return $this->deleteOffersFromArchive_2AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) + return $this->deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -6545,21 +4632,21 @@ class FbsApi } /** - * Operation deleteOffersFromArchive_2AsyncWithHttpInfo + * Operation deleteOffersAsyncWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_2AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_2'][0]) + public function deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - $request = $this->deleteOffersFromArchive_2Request($business_id, $delete_offers_from_archive_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6598,37 +4685,37 @@ class FbsApi } /** - * Create request for operation 'deleteOffersFromArchive_2' + * Create request for operation 'deleteOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffersFromArchive_2Request($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_2'][0]) + public function deleteOffersRequest($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffersFromArchive_2' + 'Missing the required parameter $business_id when calling deleteOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deleteOffersFromArchive_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deleteOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_from_archive_request' is set - if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { + // verify the required parameter 'delete_offers_request' is set + if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive_2' + 'Missing the required parameter $delete_offers_request when calling deleteOffers' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/unarchive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6654,12 +4741,12 @@ class FbsApi ); // for model (json/xml) - if (isset($delete_offers_from_archive_request)) { + if (isset($delete_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); } else { - $httpBody = $delete_offers_from_archive_request; + $httpBody = $delete_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6717,40 +4804,40 @@ class FbsApi } /** - * Operation deleteOffers_2 + * Operation deleteOffersFromArchive * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffers_2($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_2'][0]) + public function deleteOffersFromArchive($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - list($response) = $this->deleteOffers_2WithHttpInfo($business_id, $delete_offers_request, $contentType); + list($response) = $this->deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); return $response; } /** - * Operation deleteOffers_2WithHttpInfo + * Operation deleteOffersFromArchiveWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffers_2WithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_2'][0]) + public function deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $request = $this->deleteOffers_2Request($business_id, $delete_offers_request, $contentType); + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6777,223 +4864,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7007,44 +4928,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersResponse', + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7052,7 +4950,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7060,7 +4958,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7068,7 +4966,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7076,7 +4974,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7084,7 +4982,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7092,7 +4990,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7100,27 +4998,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffers_2Async + * Operation deleteOffersFromArchiveAsync * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_2Async($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_2'][0]) + public function deleteOffersFromArchiveAsync($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - return $this->deleteOffers_2AsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) + return $this->deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -7129,21 +5029,21 @@ class FbsApi } /** - * Operation deleteOffers_2AsyncWithHttpInfo + * Operation deleteOffersFromArchiveAsyncWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_2AsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_2'][0]) + public function deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - $request = $this->deleteOffers_2Request($business_id, $delete_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7182,37 +5082,37 @@ class FbsApi } /** - * Create request for operation 'deleteOffers_2' + * Create request for operation 'deleteOffersFromArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffers_2Request($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_2'][0]) + public function deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffers_2' + 'Missing the required parameter $business_id when calling deleteOffersFromArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deleteOffers_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deleteOffersFromArchive, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_request' is set - if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { + // verify the required parameter 'delete_offers_from_archive_request' is set + if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_request when calling deleteOffers_2' + 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/delete'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/unarchive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7238,12 +5138,12 @@ class FbsApi ); // for model (json/xml) - if (isset($delete_offers_request)) { + if (isset($delete_offers_from_archive_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); } else { - $httpBody = $delete_offers_request; + $httpBody = $delete_offers_from_archive_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7301,40 +5201,40 @@ class FbsApi } /** - * Operation deletePromoOffers_1 + * Operation deletePromoOffers * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deletePromoOffers_1($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_1'][0]) + public function deletePromoOffers($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - list($response) = $this->deletePromoOffers_1WithHttpInfo($business_id, $delete_promo_offers_request, $contentType); + list($response) = $this->deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, $contentType); return $response; } /** - * Operation deletePromoOffers_1WithHttpInfo + * Operation deletePromoOffersWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deletePromoOffers_1WithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_1'][0]) + public function deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - $request = $this->deletePromoOffers_1Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -7361,196 +5261,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeletePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7564,34 +5319,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -7601,7 +5333,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7609,7 +5341,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7617,7 +5349,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7625,7 +5357,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7633,7 +5365,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7641,7 +5373,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7649,27 +5381,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deletePromoOffers_1Async + * Operation deletePromoOffersAsync * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_1Async($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_1'][0]) + public function deletePromoOffersAsync($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - return $this->deletePromoOffers_1AsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) + return $this->deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -7678,21 +5412,21 @@ class FbsApi } /** - * Operation deletePromoOffers_1AsyncWithHttpInfo + * Operation deletePromoOffersAsyncWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_1AsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_1'][0]) + public function deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - $request = $this->deletePromoOffers_1Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7731,37 +5465,37 @@ class FbsApi } /** - * Create request for operation 'deletePromoOffers_1' + * Create request for operation 'deletePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deletePromoOffers_1Request($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_1'][0]) + public function deletePromoOffersRequest($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deletePromoOffers_1' + 'Missing the required parameter $business_id when calling deletePromoOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deletePromoOffers_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.deletePromoOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_promo_offers_request' is set if ($delete_promo_offers_request === null || (is_array($delete_promo_offers_request) && count($delete_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers_1' + 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/delete'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7850,40 +5584,40 @@ class FbsApi } /** - * Operation downloadShipmentAct_0 + * Operation downloadShipmentAct * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentAct_0($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct_0'][0]) + public function downloadShipmentAct($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct'][0]) { - list($response) = $this->downloadShipmentAct_0WithHttpInfo($campaign_id, $shipment_id, $contentType); + list($response) = $this->downloadShipmentActWithHttpInfo($campaign_id, $shipment_id, $contentType); return $response; } /** - * Operation downloadShipmentAct_0WithHttpInfo + * Operation downloadShipmentActWithHttpInfo * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentAct_0WithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct_0'][0]) + public function downloadShipmentActWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct'][0]) { - $request = $this->downloadShipmentAct_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentActRequest($campaign_id, $shipment_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7910,196 +5644,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8113,34 +5702,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8150,7 +5716,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8158,7 +5724,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8166,7 +5732,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8174,7 +5740,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8182,7 +5748,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8190,7 +5756,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8198,27 +5764,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation downloadShipmentAct_0Async + * Operation downloadShipmentActAsync * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentAct_0Async($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct_0'][0]) + public function downloadShipmentActAsync($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct'][0]) { - return $this->downloadShipmentAct_0AsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) + return $this->downloadShipmentActAsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) ->then( function ($response) { return $response[0]; @@ -8227,21 +5795,21 @@ class FbsApi } /** - * Operation downloadShipmentAct_0AsyncWithHttpInfo + * Operation downloadShipmentActAsyncWithHttpInfo * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentAct_0AsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct_0'][0]) + public function downloadShipmentActAsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentAct_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentActRequest($campaign_id, $shipment_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8280,40 +5848,40 @@ class FbsApi } /** - * Create request for operation 'downloadShipmentAct_0' + * Create request for operation 'downloadShipmentAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentAct_0Request($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct_0'][0]) + public function downloadShipmentActRequest($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentAct'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling downloadShipmentAct_0' + 'Missing the required parameter $campaign_id when calling downloadShipmentAct' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentAct, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling downloadShipmentAct_0' + 'Missing the required parameter $shipment_id when calling downloadShipmentAct' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentAct, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/act'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8403,40 +5971,40 @@ class FbsApi } /** - * Operation downloadShipmentDiscrepancyAct_0 + * Operation downloadShipmentDiscrepancyAct * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentDiscrepancyAct_0($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct_0'][0]) + public function downloadShipmentDiscrepancyAct($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct'][0]) { - list($response) = $this->downloadShipmentDiscrepancyAct_0WithHttpInfo($campaign_id, $shipment_id, $contentType); + list($response) = $this->downloadShipmentDiscrepancyActWithHttpInfo($campaign_id, $shipment_id, $contentType); return $response; } /** - * Operation downloadShipmentDiscrepancyAct_0WithHttpInfo + * Operation downloadShipmentDiscrepancyActWithHttpInfo * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentDiscrepancyAct_0WithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct_0'][0]) + public function downloadShipmentDiscrepancyActWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct'][0]) { - $request = $this->downloadShipmentDiscrepancyAct_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentDiscrepancyActRequest($campaign_id, $shipment_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -8463,196 +6031,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8666,34 +6089,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8703,7 +6103,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8711,7 +6111,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8719,7 +6119,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8727,7 +6127,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8735,7 +6135,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8743,7 +6143,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8751,27 +6151,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation downloadShipmentDiscrepancyAct_0Async + * Operation downloadShipmentDiscrepancyActAsync * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentDiscrepancyAct_0Async($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct_0'][0]) + public function downloadShipmentDiscrepancyActAsync($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct'][0]) { - return $this->downloadShipmentDiscrepancyAct_0AsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) + return $this->downloadShipmentDiscrepancyActAsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) ->then( function ($response) { return $response[0]; @@ -8780,21 +6182,21 @@ class FbsApi } /** - * Operation downloadShipmentDiscrepancyAct_0AsyncWithHttpInfo + * Operation downloadShipmentDiscrepancyActAsyncWithHttpInfo * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentDiscrepancyAct_0AsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct_0'][0]) + public function downloadShipmentDiscrepancyActAsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentDiscrepancyAct_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentDiscrepancyActRequest($campaign_id, $shipment_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8833,40 +6235,40 @@ class FbsApi } /** - * Create request for operation 'downloadShipmentDiscrepancyAct_0' + * Create request for operation 'downloadShipmentDiscrepancyAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentDiscrepancyAct_0Request($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct_0'][0]) + public function downloadShipmentDiscrepancyActRequest($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentDiscrepancyAct'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling downloadShipmentDiscrepancyAct_0' + 'Missing the required parameter $campaign_id when calling downloadShipmentDiscrepancyAct' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentDiscrepancyAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentDiscrepancyAct, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling downloadShipmentDiscrepancyAct_0' + 'Missing the required parameter $shipment_id when calling downloadShipmentDiscrepancyAct' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentDiscrepancyAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentDiscrepancyAct, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/discrepancy-act'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/discrepancy-act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8956,40 +6358,40 @@ class FbsApi } /** - * Operation downloadShipmentInboundAct_0 + * Operation downloadShipmentInboundAct * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentInboundAct_0($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct_0'][0]) + public function downloadShipmentInboundAct($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct'][0]) { - list($response) = $this->downloadShipmentInboundAct_0WithHttpInfo($campaign_id, $shipment_id, $contentType); + list($response) = $this->downloadShipmentInboundActWithHttpInfo($campaign_id, $shipment_id, $contentType); return $response; } /** - * Operation downloadShipmentInboundAct_0WithHttpInfo + * Operation downloadShipmentInboundActWithHttpInfo * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentInboundAct_0WithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct_0'][0]) + public function downloadShipmentInboundActWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct'][0]) { - $request = $this->downloadShipmentInboundAct_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentInboundActRequest($campaign_id, $shipment_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -9016,196 +6418,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9219,34 +6476,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9256,7 +6490,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9264,7 +6498,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9272,7 +6506,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9280,7 +6514,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9288,7 +6522,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9296,7 +6530,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9304,27 +6538,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation downloadShipmentInboundAct_0Async + * Operation downloadShipmentInboundActAsync * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentInboundAct_0Async($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct_0'][0]) + public function downloadShipmentInboundActAsync($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct'][0]) { - return $this->downloadShipmentInboundAct_0AsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) + return $this->downloadShipmentInboundActAsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) ->then( function ($response) { return $response[0]; @@ -9333,21 +6569,21 @@ class FbsApi } /** - * Operation downloadShipmentInboundAct_0AsyncWithHttpInfo + * Operation downloadShipmentInboundActAsyncWithHttpInfo * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentInboundAct_0AsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct_0'][0]) + public function downloadShipmentInboundActAsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentInboundAct_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentInboundActRequest($campaign_id, $shipment_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9386,40 +6622,40 @@ class FbsApi } /** - * Create request for operation 'downloadShipmentInboundAct_0' + * Create request for operation 'downloadShipmentInboundAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentInboundAct_0Request($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct_0'][0]) + public function downloadShipmentInboundActRequest($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentInboundAct'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling downloadShipmentInboundAct_0' + 'Missing the required parameter $campaign_id when calling downloadShipmentInboundAct' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentInboundAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentInboundAct, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling downloadShipmentInboundAct_0' + 'Missing the required parameter $shipment_id when calling downloadShipmentInboundAct' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentInboundAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentInboundAct, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/inbound-act'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/inbound-act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9509,42 +6745,42 @@ class FbsApi } /** - * Operation downloadShipmentPalletLabels_0 + * Operation downloadShipmentPalletLabels * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentPalletLabels_0($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels_0'][0]) + public function downloadShipmentPalletLabels($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels'][0]) { - list($response) = $this->downloadShipmentPalletLabels_0WithHttpInfo($campaign_id, $shipment_id, $format, $contentType); + list($response) = $this->downloadShipmentPalletLabelsWithHttpInfo($campaign_id, $shipment_id, $format, $contentType); return $response; } /** - * Operation downloadShipmentPalletLabels_0WithHttpInfo + * Operation downloadShipmentPalletLabelsWithHttpInfo * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentPalletLabels_0WithHttpInfo($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels_0'][0]) + public function downloadShipmentPalletLabelsWithHttpInfo($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels'][0]) { - $request = $this->downloadShipmentPalletLabels_0Request($campaign_id, $shipment_id, $format, $contentType); + $request = $this->downloadShipmentPalletLabelsRequest($campaign_id, $shipment_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -9571,196 +6807,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9774,34 +6865,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9811,7 +6879,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9819,7 +6887,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9827,7 +6895,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9835,7 +6903,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9843,7 +6911,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9851,7 +6919,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9859,28 +6927,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation downloadShipmentPalletLabels_0Async + * Operation downloadShipmentPalletLabelsAsync * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentPalletLabels_0Async($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels_0'][0]) + public function downloadShipmentPalletLabelsAsync($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels'][0]) { - return $this->downloadShipmentPalletLabels_0AsyncWithHttpInfo($campaign_id, $shipment_id, $format, $contentType) + return $this->downloadShipmentPalletLabelsAsyncWithHttpInfo($campaign_id, $shipment_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -9889,22 +6959,22 @@ class FbsApi } /** - * Operation downloadShipmentPalletLabels_0AsyncWithHttpInfo + * Operation downloadShipmentPalletLabelsAsyncWithHttpInfo * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentPalletLabels_0AsyncWithHttpInfo($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels_0'][0]) + public function downloadShipmentPalletLabelsAsyncWithHttpInfo($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentPalletLabels_0Request($campaign_id, $shipment_id, $format, $contentType); + $request = $this->downloadShipmentPalletLabelsRequest($campaign_id, $shipment_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9943,42 +7013,42 @@ class FbsApi } /** - * Create request for operation 'downloadShipmentPalletLabels_0' + * Create request for operation 'downloadShipmentPalletLabels' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentPalletLabels_0Request($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels_0'][0]) + public function downloadShipmentPalletLabelsRequest($campaign_id, $shipment_id, $format = null, string $contentType = self::contentTypes['downloadShipmentPalletLabels'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling downloadShipmentPalletLabels_0' + 'Missing the required parameter $campaign_id when calling downloadShipmentPalletLabels' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentPalletLabels_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentPalletLabels, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling downloadShipmentPalletLabels_0' + 'Missing the required parameter $shipment_id when calling downloadShipmentPalletLabels' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentPalletLabels_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentPalletLabels, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallet/labels'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallet/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10077,40 +7147,42 @@ class FbsApi } /** - * Operation downloadShipmentReceptionTransferAct_0 + * Operation downloadShipmentReceptionTransferAct * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentReceptionTransferAct_0($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct_0'][0]) + public function downloadShipmentReceptionTransferAct($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { - list($response) = $this->downloadShipmentReceptionTransferAct_0WithHttpInfo($campaign_id, $warehouse_id, $contentType); + list($response) = $this->downloadShipmentReceptionTransferActWithHttpInfo($campaign_id, $warehouse_id, $signatory, $contentType); return $response; } /** - * Operation downloadShipmentReceptionTransferAct_0WithHttpInfo + * Operation downloadShipmentReceptionTransferActWithHttpInfo * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentReceptionTransferAct_0WithHttpInfo($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct_0'][0]) + public function downloadShipmentReceptionTransferActWithHttpInfo($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { - $request = $this->downloadShipmentReceptionTransferAct_0Request($campaign_id, $warehouse_id, $contentType); + $request = $this->downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id, $signatory, $contentType); try { $options = $this->createHttpClientOption(); @@ -10137,196 +7209,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10340,34 +7267,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -10377,7 +7281,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10385,7 +7289,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10393,7 +7297,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10401,7 +7305,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10409,7 +7313,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10417,7 +7321,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10425,27 +7329,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation downloadShipmentReceptionTransferAct_0Async + * Operation downloadShipmentReceptionTransferActAsync * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentReceptionTransferAct_0Async($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct_0'][0]) + public function downloadShipmentReceptionTransferActAsync($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { - return $this->downloadShipmentReceptionTransferAct_0AsyncWithHttpInfo($campaign_id, $warehouse_id, $contentType) + return $this->downloadShipmentReceptionTransferActAsyncWithHttpInfo($campaign_id, $warehouse_id, $signatory, $contentType) ->then( function ($response) { return $response[0]; @@ -10454,21 +7361,22 @@ class FbsApi } /** - * Operation downloadShipmentReceptionTransferAct_0AsyncWithHttpInfo + * Operation downloadShipmentReceptionTransferActAsyncWithHttpInfo * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentReceptionTransferAct_0AsyncWithHttpInfo($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct_0'][0]) + public function downloadShipmentReceptionTransferActAsyncWithHttpInfo($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentReceptionTransferAct_0Request($campaign_id, $warehouse_id, $contentType); + $request = $this->downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id, $signatory, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10507,34 +7415,36 @@ class FbsApi } /** - * Create request for operation 'downloadShipmentReceptionTransferAct_0' + * Create request for operation 'downloadShipmentReceptionTransferAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentReceptionTransferAct_0Request($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct_0'][0]) + public function downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling downloadShipmentReceptionTransferAct_0' + 'Missing the required parameter $campaign_id when calling downloadShipmentReceptionTransferAct' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentReceptionTransferAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentReceptionTransferAct, must be bigger than or equal to 1.'); } if ($warehouse_id !== null && $warehouse_id < 1) { - throw new \InvalidArgumentException('invalid value for "$warehouse_id" when calling FbsApi.downloadShipmentReceptionTransferAct_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$warehouse_id" when calling FbsApi.downloadShipmentReceptionTransferAct, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/shipments/reception-transfer-act'; + + $resourcePath = '/v2/campaigns/{campaignId}/shipments/reception-transfer-act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10550,6 +7460,15 @@ class FbsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signatory, + 'signatory', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -10625,40 +7544,40 @@ class FbsApi } /** - * Operation downloadShipmentTransportationWaybill_0 + * Operation downloadShipmentTransportationWaybill * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentTransportationWaybill_0($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill_0'][0]) + public function downloadShipmentTransportationWaybill($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill'][0]) { - list($response) = $this->downloadShipmentTransportationWaybill_0WithHttpInfo($campaign_id, $shipment_id, $contentType); + list($response) = $this->downloadShipmentTransportationWaybillWithHttpInfo($campaign_id, $shipment_id, $contentType); return $response; } /** - * Operation downloadShipmentTransportationWaybill_0WithHttpInfo + * Operation downloadShipmentTransportationWaybillWithHttpInfo * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentTransportationWaybill_0WithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill_0'][0]) + public function downloadShipmentTransportationWaybillWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill'][0]) { - $request = $this->downloadShipmentTransportationWaybill_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentTransportationWaybillRequest($campaign_id, $shipment_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10685,196 +7604,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10888,34 +7662,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -10925,7 +7676,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10933,7 +7684,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10941,7 +7692,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10949,7 +7700,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10957,7 +7708,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10965,7 +7716,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10973,27 +7724,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation downloadShipmentTransportationWaybill_0Async + * Operation downloadShipmentTransportationWaybillAsync * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentTransportationWaybill_0Async($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill_0'][0]) + public function downloadShipmentTransportationWaybillAsync($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill'][0]) { - return $this->downloadShipmentTransportationWaybill_0AsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) + return $this->downloadShipmentTransportationWaybillAsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) ->then( function ($response) { return $response[0]; @@ -11002,21 +7755,21 @@ class FbsApi } /** - * Operation downloadShipmentTransportationWaybill_0AsyncWithHttpInfo + * Operation downloadShipmentTransportationWaybillAsyncWithHttpInfo * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentTransportationWaybill_0AsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill_0'][0]) + public function downloadShipmentTransportationWaybillAsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentTransportationWaybill_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->downloadShipmentTransportationWaybillRequest($campaign_id, $shipment_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11055,40 +7808,40 @@ class FbsApi } /** - * Create request for operation 'downloadShipmentTransportationWaybill_0' + * Create request for operation 'downloadShipmentTransportationWaybill' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentTransportationWaybill_0Request($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill_0'][0]) + public function downloadShipmentTransportationWaybillRequest($campaign_id, $shipment_id, string $contentType = self::contentTypes['downloadShipmentTransportationWaybill'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling downloadShipmentTransportationWaybill_0' + 'Missing the required parameter $campaign_id when calling downloadShipmentTransportationWaybill' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentTransportationWaybill_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.downloadShipmentTransportationWaybill, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling downloadShipmentTransportationWaybill_0' + 'Missing the required parameter $shipment_id when calling downloadShipmentTransportationWaybill' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentTransportationWaybill_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.downloadShipmentTransportationWaybill, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/transportation-waybill'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/transportation-waybill'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11178,40 +7931,40 @@ class FbsApi } /** - * Operation generateBoostConsolidatedReport_1 + * Operation generateBannersStatisticsReport * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateBoostConsolidatedReport_1($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_1'][0]) + public function generateBannersStatisticsReport($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - list($response) = $this->generateBoostConsolidatedReport_1WithHttpInfo($generate_boost_consolidated_request, $format, $contentType); + list($response) = $this->generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format, $contentType); return $response; } /** - * Operation generateBoostConsolidatedReport_1WithHttpInfo + * Operation generateBannersStatisticsReportWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateBoostConsolidatedReport_1WithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_1'][0]) + public function generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - $request = $this->generateBoostConsolidatedReport_1Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11238,169 +7991,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11414,34 +8043,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11451,7 +8057,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11459,7 +8065,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11467,7 +8073,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11475,7 +8081,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11483,7 +8089,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11491,27 +8097,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateBoostConsolidatedReport_1Async + * Operation generateBannersStatisticsReportAsync * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_1Async($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_1'][0]) + public function generateBannersStatisticsReportAsync($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - return $this->generateBoostConsolidatedReport_1AsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) + return $this->generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -11520,21 +8128,21 @@ class FbsApi } /** - * Operation generateBoostConsolidatedReport_1AsyncWithHttpInfo + * Operation generateBannersStatisticsReportAsyncWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_1AsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_1'][0]) + public function generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateBoostConsolidatedReport_1Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11573,28 +8181,28 @@ class FbsApi } /** - * Create request for operation 'generateBoostConsolidatedReport_1' + * Create request for operation 'generateBannersStatisticsReport' * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateBoostConsolidatedReport_1Request($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_1'][0]) + public function generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - // verify the required parameter 'generate_boost_consolidated_request' is set - if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { + // verify the required parameter 'generate_banners_statistics_request' is set + if ($generate_banners_statistics_request === null || (is_array($generate_banners_statistics_request) && count($generate_banners_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport_1' + 'Missing the required parameter $generate_banners_statistics_request when calling generateBannersStatisticsReport' ); } - $resourcePath = '/reports/boost-consolidated/generate'; + $resourcePath = '/v2/reports/banners-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11621,12 +8229,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_boost_consolidated_request)) { + if (isset($generate_banners_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_banners_statistics_request)); } else { - $httpBody = $generate_boost_consolidated_request; + $httpBody = $generate_banners_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11684,40 +8292,40 @@ class FbsApi } /** - * Operation generateCompetitorsPositionReport_2 + * Operation generateBoostConsolidatedReport * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateCompetitorsPositionReport_2($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_2'][0]) + public function generateBoostConsolidatedReport($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - list($response) = $this->generateCompetitorsPositionReport_2WithHttpInfo($generate_competitors_position_report_request, $format, $contentType); + list($response) = $this->generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format, $contentType); return $response; } /** - * Operation generateCompetitorsPositionReport_2WithHttpInfo + * Operation generateBoostConsolidatedReportWithHttpInfo * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateCompetitorsPositionReport_2WithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_2'][0]) + public function generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - $request = $this->generateCompetitorsPositionReport_2Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11744,169 +8352,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11920,34 +8404,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11957,7 +8418,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11965,7 +8426,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11973,7 +8434,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11981,7 +8442,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11989,7 +8450,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11997,27 +8458,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateCompetitorsPositionReport_2Async + * Operation generateBoostConsolidatedReportAsync * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_2Async($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_2'][0]) + public function generateBoostConsolidatedReportAsync($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - return $this->generateCompetitorsPositionReport_2AsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) + return $this->generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12026,21 +8489,21 @@ class FbsApi } /** - * Operation generateCompetitorsPositionReport_2AsyncWithHttpInfo + * Operation generateBoostConsolidatedReportAsyncWithHttpInfo * - * Отчет «Конкурентная позиция» + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_2AsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_2'][0]) + public function generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateCompetitorsPositionReport_2Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12079,28 +8542,28 @@ class FbsApi } /** - * Create request for operation 'generateCompetitorsPositionReport_2' + * Create request for operation 'generateBoostConsolidatedReport' * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateCompetitorsPositionReport_2Request($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_2'][0]) + public function generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - // verify the required parameter 'generate_competitors_position_report_request' is set - if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { + // verify the required parameter 'generate_boost_consolidated_request' is set + if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport_2' + 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport' ); } - $resourcePath = '/reports/competitors-position/generate'; + $resourcePath = '/v2/reports/boost-consolidated/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12127,12 +8590,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_competitors_position_report_request)) { + if (isset($generate_boost_consolidated_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); } else { - $httpBody = $generate_competitors_position_report_request; + $httpBody = $generate_boost_consolidated_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12190,40 +8653,40 @@ class FbsApi } /** - * Operation generateGoodsFeedbackReport_1 + * Operation generateClosureDocumentsDetalizationReport * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsFeedbackReport_1($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_1'][0]) + public function generateClosureDocumentsDetalizationReport($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - list($response) = $this->generateGoodsFeedbackReport_1WithHttpInfo($generate_goods_feedback_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType); return $response; } /** - * Operation generateGoodsFeedbackReport_1WithHttpInfo + * Operation generateClosureDocumentsDetalizationReportWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsFeedbackReport_1WithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_1'][0]) + public function generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - $request = $this->generateGoodsFeedbackReport_1Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12250,169 +8713,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12426,34 +8771,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12463,7 +8785,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12471,7 +8793,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12479,7 +8801,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12487,7 +8809,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12495,7 +8825,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12503,27 +8833,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsFeedbackReport_1Async + * Operation generateClosureDocumentsDetalizationReportAsync * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_1Async($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_1'][0]) + public function generateClosureDocumentsDetalizationReportAsync($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - return $this->generateGoodsFeedbackReport_1AsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) + return $this->generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12532,21 +8864,21 @@ class FbsApi } /** - * Operation generateGoodsFeedbackReport_1AsyncWithHttpInfo + * Operation generateClosureDocumentsDetalizationReportAsyncWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_1AsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_1'][0]) + public function generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsFeedbackReport_1Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12585,28 +8917,28 @@ class FbsApi } /** - * Create request for operation 'generateGoodsFeedbackReport_1' + * Create request for operation 'generateClosureDocumentsDetalizationReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsFeedbackReport_1Request($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_1'][0]) + public function generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - // verify the required parameter 'generate_goods_feedback_request' is set - if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { + // verify the required parameter 'generate_closure_documents_detalization_request' is set + if ($generate_closure_documents_detalization_request === null || (is_array($generate_closure_documents_detalization_request) && count($generate_closure_documents_detalization_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport_1' + 'Missing the required parameter $generate_closure_documents_detalization_request when calling generateClosureDocumentsDetalizationReport' ); } - $resourcePath = '/reports/goods-feedback/generate'; + $resourcePath = '/v2/reports/closure-documents/detalization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12633,12 +8965,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_goods_feedback_request)) { + if (isset($generate_closure_documents_detalization_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_detalization_request)); } else { - $httpBody = $generate_goods_feedback_request; + $httpBody = $generate_closure_documents_detalization_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12696,40 +9028,38 @@ class FbsApi } /** - * Operation generateGoodsRealizationReport_1 + * Operation generateClosureDocumentsReport * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsRealizationReport_1($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_1'][0]) + public function generateClosureDocumentsReport($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - list($response) = $this->generateGoodsRealizationReport_1WithHttpInfo($generate_goods_realization_report_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, $contentType); return $response; } /** - * Operation generateGoodsRealizationReport_1WithHttpInfo + * Operation generateClosureDocumentsReportWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsRealizationReport_1WithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_1'][0]) + public function generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - $request = $this->generateGoodsRealizationReport_1Request($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -12756,169 +9086,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12932,34 +9138,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12969,7 +9152,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12977,7 +9160,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12985,7 +9168,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12993,7 +9176,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13001,7 +9184,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13009,27 +9192,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsRealizationReport_1Async + * Operation generateClosureDocumentsReportAsync * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReport_1Async($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_1'][0]) + public function generateClosureDocumentsReportAsync($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - return $this->generateGoodsRealizationReport_1AsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) + return $this->generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, $contentType) ->then( function ($response) { return $response[0]; @@ -13038,21 +9222,20 @@ class FbsApi } /** - * Operation generateGoodsRealizationReport_1AsyncWithHttpInfo + * Operation generateClosureDocumentsReportAsyncWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReport_1AsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_1'][0]) + public function generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsRealizationReport_1Request($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13091,43 +9274,32 @@ class FbsApi } /** - * Create request for operation 'generateGoodsRealizationReport_1' + * Create request for operation 'generateClosureDocumentsReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsRealizationReport_1Request($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_1'][0]) + public function generateClosureDocumentsReportRequest($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - // verify the required parameter 'generate_goods_realization_report_request' is set - if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { + // verify the required parameter 'generate_closure_documents_request' is set + if ($generate_closure_documents_request === null || (is_array($generate_closure_documents_request) && count($generate_closure_documents_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport_1' + 'Missing the required parameter $generate_closure_documents_request when calling generateClosureDocumentsReport' ); } - - $resourcePath = '/reports/goods-realization/generate'; + $resourcePath = '/v2/reports/closure-documents/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -13139,12 +9311,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_goods_realization_report_request)) { + if (isset($generate_closure_documents_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_request)); } else { - $httpBody = $generate_goods_realization_report_request; + $httpBody = $generate_closure_documents_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13202,40 +9374,40 @@ class FbsApi } /** - * Operation generateMassOrderLabelsReport_0 + * Operation generateCompetitorsPositionReport * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateMassOrderLabelsReport_0($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_0'][0]) + public function generateCompetitorsPositionReport($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - list($response) = $this->generateMassOrderLabelsReport_0WithHttpInfo($generate_mass_order_labels_request, $format, $contentType); + list($response) = $this->generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format, $contentType); return $response; } /** - * Operation generateMassOrderLabelsReport_0WithHttpInfo + * Operation generateCompetitorsPositionReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateMassOrderLabelsReport_0WithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_0'][0]) + public function generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - $request = $this->generateMassOrderLabelsReport_0Request($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -13262,169 +9434,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13438,34 +9486,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -13475,7 +9500,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13483,7 +9508,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13491,7 +9516,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13499,7 +9524,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13507,7 +9532,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13515,27 +9540,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateMassOrderLabelsReport_0Async + * Operation generateCompetitorsPositionReportAsync * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReport_0Async($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_0'][0]) + public function generateCompetitorsPositionReportAsync($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - return $this->generateMassOrderLabelsReport_0AsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) + return $this->generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -13544,21 +9571,21 @@ class FbsApi } /** - * Operation generateMassOrderLabelsReport_0AsyncWithHttpInfo + * Operation generateCompetitorsPositionReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReport_0AsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_0'][0]) + public function generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateMassOrderLabelsReport_0Request($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13597,28 +9624,28 @@ class FbsApi } /** - * Create request for operation 'generateMassOrderLabelsReport_0' + * Create request for operation 'generateCompetitorsPositionReport' * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateMassOrderLabelsReport_0Request($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport_0'][0]) + public function generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - // verify the required parameter 'generate_mass_order_labels_request' is set - if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { + // verify the required parameter 'generate_competitors_position_report_request' is set + if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport_0' + 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport' ); } - $resourcePath = '/reports/documents/labels/generate'; + $resourcePath = '/v2/reports/competitors-position/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13629,7 +9656,7 @@ class FbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required @@ -13645,12 +9672,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_mass_order_labels_request)) { + if (isset($generate_competitors_position_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); } else { - $httpBody = $generate_mass_order_labels_request; + $httpBody = $generate_competitors_position_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13708,46 +9735,40 @@ class FbsApi } /** - * Operation generateOrderLabel_0 + * Operation generateGoodsFeedbackReport * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateOrderLabel_0($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_0'][0]) + public function generateGoodsFeedbackReport($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - list($response) = $this->generateOrderLabel_0WithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + list($response) = $this->generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format, $contentType); return $response; } /** - * Operation generateOrderLabel_0WithHttpInfo + * Operation generateGoodsFeedbackReportWithHttpInfo * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateOrderLabel_0WithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_0'][0]) + public function generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $request = $this->generateOrderLabel_0Request($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -13774,196 +9795,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13977,44 +9847,21 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14022,7 +9869,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14030,7 +9877,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14038,15 +9885,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14054,7 +9893,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14062,30 +9901,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateOrderLabel_0Async + * Operation generateGoodsFeedbackReportAsync * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabel_0Async($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_0'][0]) + public function generateGoodsFeedbackReportAsync($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - return $this->generateOrderLabel_0AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType) + return $this->generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14094,24 +9932,21 @@ class FbsApi } /** - * Operation generateOrderLabel_0AsyncWithHttpInfo + * Operation generateGoodsFeedbackReportAsyncWithHttpInfo * - * Готовый ярлык‑наклейка для коробки в заказе + * Отчет по отзывам о товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabel_0AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_0'][0]) + public function generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $returnType = '\SplFileObject'; - $request = $this->generateOrderLabel_0Request($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14150,55 +9985,28 @@ class FbsApi } /** - * Create request for operation 'generateOrderLabel_0' + * Create request for operation 'generateGoodsFeedbackReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) - * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateOrderLabel_0Request($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel_0'][0]) + public function generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling generateOrderLabel_0' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.generateOrderLabel_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling generateOrderLabel_0' - ); - } - - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling generateOrderLabel_0' - ); - } - - // verify the required parameter 'box_id' is set - if ($box_id === null || (is_array($box_id) && count($box_id) === 0)) { + // verify the required parameter 'generate_goods_feedback_request' is set + if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $box_id when calling generateOrderLabel_0' + 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; + $resourcePath = '/v2/reports/goods-feedback/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14209,55 +10017,30 @@ class FbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($shipment_id !== null) { - $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), - $resourcePath - ); - } - // path params - if ($box_id !== null) { - $resourcePath = str_replace( - '{' . 'boxId' . '}', - ObjectSerializer::toPathValue($box_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + } else { + $httpBody = $generate_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -14305,7 +10088,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14313,42 +10096,40 @@ class FbsApi } /** - * Operation generateOrderLabels_0 + * Operation generateGoodsPricesReport * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateOrderLabels_0($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_0'][0]) + public function generateGoodsPricesReport($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - list($response) = $this->generateOrderLabels_0WithHttpInfo($campaign_id, $order_id, $format, $contentType); + list($response) = $this->generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format, $contentType); return $response; } /** - * Operation generateOrderLabels_0WithHttpInfo + * Operation generateGoodsPricesReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateOrderLabels_0WithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_0'][0]) + public function generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $request = $this->generateOrderLabels_0Request($campaign_id, $order_id, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14375,196 +10156,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14578,44 +10208,21 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14623,7 +10230,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14631,7 +10238,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14639,15 +10246,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14655,7 +10254,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14663,28 +10262,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateOrderLabels_0Async + * Operation generateGoodsPricesReportAsync * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabels_0Async($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_0'][0]) + public function generateGoodsPricesReportAsync($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - return $this->generateOrderLabels_0AsyncWithHttpInfo($campaign_id, $order_id, $format, $contentType) + return $this->generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14693,22 +10293,21 @@ class FbsApi } /** - * Operation generateOrderLabels_0AsyncWithHttpInfo + * Operation generateGoodsPricesReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в одном заказе + * Отчет «Цены» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateOrderLabels_0AsyncWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_0'][0]) + public function generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $returnType = '\SplFileObject'; - $request = $this->generateOrderLabels_0Request($campaign_id, $order_id, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14747,39 +10346,28 @@ class FbsApi } /** - * Create request for operation 'generateOrderLabels_0' + * Create request for operation 'generateGoodsPricesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateOrderLabels_0Request($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels_0'][0]) + public function generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling generateOrderLabels_0' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.generateOrderLabels_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'generate_goods_prices_report_request' is set + if ($generate_goods_prices_report_request === null || (is_array($generate_goods_prices_report_request) && count($generate_goods_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling generateOrderLabels_0' + 'Missing the required parameter $generate_goods_prices_report_request when calling generateGoodsPricesReport' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; + $resourcePath = '/v2/reports/goods-prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14790,39 +10378,30 @@ class FbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_goods_prices_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_prices_report_request)); + } else { + $httpBody = $generate_goods_prices_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -14870,7 +10449,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14878,40 +10457,40 @@ class FbsApi } /** - * Operation generatePricesReport_1 + * Operation generateGoodsRealizationReport * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generatePricesReport_1($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_1'][0]) + public function generateGoodsRealizationReport($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - list($response) = $this->generatePricesReport_1WithHttpInfo($generate_prices_report_request, $format, $contentType); + list($response) = $this->generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format, $contentType); return $response; } /** - * Operation generatePricesReport_1WithHttpInfo + * Operation generateGoodsRealizationReportWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generatePricesReport_1WithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_1'][0]) + public function generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - $request = $this->generatePricesReport_1Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14938,169 +10517,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15114,34 +10575,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -15151,7 +10589,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15159,7 +10597,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15167,7 +10605,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15175,7 +10613,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15183,7 +10629,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15191,27 +10637,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generatePricesReport_1Async + * Operation generateGoodsRealizationReportAsync * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_1Async($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_1'][0]) + public function generateGoodsRealizationReportAsync($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - return $this->generatePricesReport_1AsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) + return $this->generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -15220,21 +10668,21 @@ class FbsApi } /** - * Operation generatePricesReport_1AsyncWithHttpInfo + * Operation generateGoodsRealizationReportAsyncWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_1AsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_1'][0]) + public function generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generatePricesReport_1Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15273,28 +10721,28 @@ class FbsApi } /** - * Create request for operation 'generatePricesReport_1' + * Create request for operation 'generateGoodsRealizationReport' * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generatePricesReport_1Request($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_1'][0]) + public function generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - // verify the required parameter 'generate_prices_report_request' is set - if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { + // verify the required parameter 'generate_goods_realization_report_request' is set + if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport_1' + 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport' ); } - $resourcePath = '/reports/prices/generate'; + $resourcePath = '/v2/reports/goods-realization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15321,12 +10769,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_prices_report_request)) { + if (isset($generate_goods_realization_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); } else { - $httpBody = $generate_prices_report_request; + $httpBody = $generate_goods_realization_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -15384,40 +10832,40 @@ class FbsApi } /** - * Operation generateShelfsStatisticsReport_1 + * Operation generateJewelryFiscalReport * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShelfsStatisticsReport_1($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_1'][0]) + public function generateJewelryFiscalReport($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - list($response) = $this->generateShelfsStatisticsReport_1WithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); + list($response) = $this->generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType); return $response; } /** - * Operation generateShelfsStatisticsReport_1WithHttpInfo + * Operation generateJewelryFiscalReportWithHttpInfo * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShelfsStatisticsReport_1WithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_1'][0]) + public function generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - $request = $this->generateShelfsStatisticsReport_1Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -15444,169 +10892,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15620,34 +10944,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -15657,7 +10958,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15665,7 +10966,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15673,7 +10974,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15681,7 +10982,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15689,7 +10990,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15697,27 +10998,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShelfsStatisticsReport_1Async + * Operation generateJewelryFiscalReportAsync * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_1Async($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_1'][0]) + public function generateJewelryFiscalReportAsync($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - return $this->generateShelfsStatisticsReport_1AsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) + return $this->generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -15726,21 +11029,21 @@ class FbsApi } /** - * Operation generateShelfsStatisticsReport_1AsyncWithHttpInfo + * Operation generateJewelryFiscalReportAsyncWithHttpInfo * - * Отчет по полкам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_1AsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_1'][0]) + public function generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShelfsStatisticsReport_1Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15779,28 +11082,28 @@ class FbsApi } /** - * Create request for operation 'generateShelfsStatisticsReport_1' + * Create request for operation 'generateJewelryFiscalReport' * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShelfsStatisticsReport_1Request($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_1'][0]) + public function generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - // verify the required parameter 'generate_shelfs_statistics_request' is set - if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { + // verify the required parameter 'generate_jewelry_fiscal_report_request' is set + if ($generate_jewelry_fiscal_report_request === null || (is_array($generate_jewelry_fiscal_report_request) && count($generate_jewelry_fiscal_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport_1' + 'Missing the required parameter $generate_jewelry_fiscal_report_request when calling generateJewelryFiscalReport' ); } - $resourcePath = '/reports/shelf-statistics/generate'; + $resourcePath = '/v2/reports/jewelry-fiscal/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15827,12 +11130,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_shelfs_statistics_request)) { + if (isset($generate_jewelry_fiscal_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_jewelry_fiscal_report_request)); } else { - $httpBody = $generate_shelfs_statistics_request; + $httpBody = $generate_jewelry_fiscal_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -15890,38 +11193,40 @@ class FbsApi } /** - * Operation generateShipmentListDocumentReport_0 + * Operation generateKeyIndicatorsReport * - * Получение листа сборки + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShipmentListDocumentReport_0($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport_0'][0]) + public function generateKeyIndicatorsReport($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - list($response) = $this->generateShipmentListDocumentReport_0WithHttpInfo($generate_shipment_list_document_report_request, $contentType); + list($response) = $this->generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format, $contentType); return $response; } /** - * Operation generateShipmentListDocumentReport_0WithHttpInfo + * Operation generateKeyIndicatorsReportWithHttpInfo * - * Получение листа сборки + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShipmentListDocumentReport_0WithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport_0'][0]) + public function generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - $request = $this->generateShipmentListDocumentReport_0Request($generate_shipment_list_document_report_request, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -15948,169 +11253,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -16124,34 +11305,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -16161,7 +11319,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16169,7 +11327,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16177,7 +11335,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16185,7 +11343,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16193,7 +11351,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16201,26 +11359,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShipmentListDocumentReport_0Async + * Operation generateKeyIndicatorsReportAsync * - * Получение листа сборки + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShipmentListDocumentReport_0Async($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport_0'][0]) + public function generateKeyIndicatorsReportAsync($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - return $this->generateShipmentListDocumentReport_0AsyncWithHttpInfo($generate_shipment_list_document_report_request, $contentType) + return $this->generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16229,20 +11390,21 @@ class FbsApi } /** - * Operation generateShipmentListDocumentReport_0AsyncWithHttpInfo + * Operation generateKeyIndicatorsReportAsyncWithHttpInfo * - * Получение листа сборки + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShipmentListDocumentReport_0AsyncWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport_0'][0]) + public function generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShipmentListDocumentReport_0Request($generate_shipment_list_document_report_request, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16281,32 +11443,43 @@ class FbsApi } /** - * Create request for operation 'generateShipmentListDocumentReport_0' + * Create request for operation 'generateKeyIndicatorsReport' * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShipmentListDocumentReport_0Request($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport_0'][0]) + public function generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - // verify the required parameter 'generate_shipment_list_document_report_request' is set - if ($generate_shipment_list_document_report_request === null || (is_array($generate_shipment_list_document_report_request) && count($generate_shipment_list_document_report_request) === 0)) { + // verify the required parameter 'generate_key_indicators_request' is set + if ($generate_key_indicators_request === null || (is_array($generate_key_indicators_request) && count($generate_key_indicators_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shipment_list_document_report_request when calling generateShipmentListDocumentReport_0' + 'Missing the required parameter $generate_key_indicators_request when calling generateKeyIndicatorsReport' ); } - $resourcePath = '/reports/documents/shipment-list/generate'; + + $resourcePath = '/v2/reports/key-indicators/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -16318,12 +11491,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_shipment_list_document_report_request)) { + if (isset($generate_key_indicators_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shipment_list_document_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_key_indicators_request)); } else { - $httpBody = $generate_shipment_list_document_report_request; + $httpBody = $generate_key_indicators_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -16381,40 +11554,40 @@ class FbsApi } /** - * Operation generateShowsSalesReport_2 + * Operation generateMassOrderLabelsReport * - * Отчет «Аналитика продаж» + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShowsSalesReport_2($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_2'][0]) + public function generateMassOrderLabelsReport($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - list($response) = $this->generateShowsSalesReport_2WithHttpInfo($generate_shows_sales_report_request, $format, $contentType); + list($response) = $this->generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format, $contentType); return $response; } /** - * Operation generateShowsSalesReport_2WithHttpInfo + * Operation generateMassOrderLabelsReportWithHttpInfo * - * Отчет «Аналитика продаж» + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShowsSalesReport_2WithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_2'][0]) + public function generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - $request = $this->generateShowsSalesReport_2Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16441,169 +11614,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -16617,34 +11666,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -16654,7 +11680,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16662,7 +11688,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16670,7 +11696,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16678,7 +11704,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16686,7 +11712,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16694,27 +11720,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShowsSalesReport_2Async + * Operation generateMassOrderLabelsReportAsync * - * Отчет «Аналитика продаж» + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_2Async($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_2'][0]) + public function generateMassOrderLabelsReportAsync($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - return $this->generateShowsSalesReport_2AsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) + return $this->generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16723,21 +11751,21 @@ class FbsApi } /** - * Operation generateShowsSalesReport_2AsyncWithHttpInfo + * Operation generateMassOrderLabelsReportAsyncWithHttpInfo * - * Отчет «Аналитика продаж» + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_2AsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_2'][0]) + public function generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShowsSalesReport_2Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16776,28 +11804,28 @@ class FbsApi } /** - * Create request for operation 'generateShowsSalesReport_2' + * Create request for operation 'generateMassOrderLabelsReport' * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShowsSalesReport_2Request($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_2'][0]) + public function generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) { - // verify the required parameter 'generate_shows_sales_report_request' is set - if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { + // verify the required parameter 'generate_mass_order_labels_request' is set + if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport_2' + 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport' ); } - $resourcePath = '/reports/shows-sales/generate'; + $resourcePath = '/v2/reports/documents/labels/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16808,7 +11836,7 @@ class FbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required @@ -16824,12 +11852,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_shows_sales_report_request)) { + if (isset($generate_mass_order_labels_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); } else { - $httpBody = $generate_shows_sales_report_request; + $httpBody = $generate_mass_order_labels_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -16887,40 +11915,40 @@ class FbsApi } /** - * Operation generateStocksOnWarehousesReport_1 + * Operation generateOfferBarcodes * - * Отчет по остаткам на складах + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateStocksOnWarehousesReport_1($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_1'][0]) + public function generateOfferBarcodes($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - list($response) = $this->generateStocksOnWarehousesReport_1WithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + list($response) = $this->generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType); return $response; } /** - * Operation generateStocksOnWarehousesReport_1WithHttpInfo + * Operation generateOfferBarcodesWithHttpInfo * - * Отчет по остаткам на складах + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateStocksOnWarehousesReport_1WithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_1'][0]) + public function generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $request = $this->generateStocksOnWarehousesReport_1Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -16947,169 +11975,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17123,44 +12033,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17168,7 +12055,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17176,7 +12063,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17184,7 +12071,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17192,7 +12079,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17200,27 +12095,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateStocksOnWarehousesReport_1Async + * Operation generateOfferBarcodesAsync * - * Отчет по остаткам на складах + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_1Async($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_1'][0]) + public function generateOfferBarcodesAsync($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - return $this->generateStocksOnWarehousesReport_1AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) + return $this->generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -17229,21 +12126,21 @@ class FbsApi } /** - * Operation generateStocksOnWarehousesReport_1AsyncWithHttpInfo + * Operation generateOfferBarcodesAsyncWithHttpInfo * - * Отчет по остаткам на складах + * Генерация штрихкодов * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_1AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_1'][0]) + public function generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateStocksOnWarehousesReport_1Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse'; + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17282,45 +12179,53 @@ class FbsApi } /** - * Create request for operation 'generateStocksOnWarehousesReport_1' + * Create request for operation 'generateOfferBarcodes' * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateStocksOnWarehousesReport_1Request($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_1'][0]) + public function generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set - if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport_1' + 'Missing the required parameter $business_id when calling generateOfferBarcodes' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.generateOfferBarcodes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'generate_offer_barcodes_request' is set + if ($generate_offer_barcodes_request === null || (is_array($generate_offer_barcodes_request) && count($generate_offer_barcodes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_offer_barcodes_request when calling generateOfferBarcodes' ); } - - $resourcePath = '/reports/stocks-on-warehouses/generate'; + $resourcePath = '/v1/businesses/{businessId}/offer-mappings/barcodes/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -17330,12 +12235,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_stocks_on_warehouses_report_request)) { + if (isset($generate_offer_barcodes_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_offer_barcodes_request)); } else { - $httpBody = $generate_stocks_on_warehouses_report_request; + $httpBody = $generate_offer_barcodes_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -17393,40 +12298,46 @@ class FbsApi } /** - * Operation generateUnitedMarketplaceServicesReport_2 + * Operation generateOrderLabel * - * Отчет по стоимости услуг + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedMarketplaceServicesReport_2($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_2'][0]) + public function generateOrderLabel($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - list($response) = $this->generateUnitedMarketplaceServicesReport_2WithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType); + list($response) = $this->generateOrderLabelWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); return $response; } /** - * Operation generateUnitedMarketplaceServicesReport_2WithHttpInfo + * Operation generateOrderLabelWithHttpInfo * - * Отчет по стоимости услуг + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedMarketplaceServicesReport_2WithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_2'][0]) + public function generateOrderLabelWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - $request = $this->generateUnitedMarketplaceServicesReport_2Request($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -17453,169 +12364,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17629,44 +12422,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17674,7 +12444,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17682,7 +12452,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17690,7 +12460,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17698,7 +12476,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17706,27 +12484,32 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedMarketplaceServicesReport_2Async + * Operation generateOrderLabelAsync * - * Отчет по стоимости услуг + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_2Async($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_2'][0]) + public function generateOrderLabelAsync($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - return $this->generateUnitedMarketplaceServicesReport_2AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType) + return $this->generateOrderLabelAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -17735,21 +12518,24 @@ class FbsApi } /** - * Operation generateUnitedMarketplaceServicesReport_2AsyncWithHttpInfo + * Operation generateOrderLabelAsyncWithHttpInfo * - * Отчет по стоимости услуг + * Готовый ярлык‑наклейка для коробки в заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_2AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_2'][0]) + public function generateOrderLabelAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedMarketplaceServicesReport_2Request($generate_united_marketplace_services_report_request, $format, $contentType); + $returnType = '\SplFileObject'; + $request = $this->generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17788,28 +12574,55 @@ class FbsApi } /** - * Create request for operation 'generateUnitedMarketplaceServicesReport_2' + * Create request for operation 'generateOrderLabel' * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) + * @param int $box_id Идентификатор коробки. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedMarketplaceServicesReport_2Request($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_2'][0]) + public function generateOrderLabelRequest($campaign_id, $order_id, $shipment_id, $box_id, $format = null, string $contentType = self::contentTypes['generateOrderLabel'][0]) { - // verify the required parameter 'generate_united_marketplace_services_report_request' is set - if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport_2' + 'Missing the required parameter $campaign_id when calling generateOrderLabel' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.generateOrderLabel, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling generateOrderLabel' ); } + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $shipment_id when calling generateOrderLabel' + ); + } + + // verify the required parameter 'box_id' is set + if ($box_id === null || (is_array($box_id) && count($box_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $box_id when calling generateOrderLabel' + ); + } - $resourcePath = '/reports/united-marketplace-services/generate'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17820,30 +12633,55 @@ class FbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), + $resourcePath + ); + } + // path params + if ($box_id !== null) { + $resourcePath = str_replace( + '{' . 'boxId' . '}', + ObjectSerializer::toPathValue($box_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); // for model (json/xml) - if (isset($generate_united_marketplace_services_report_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); - } else { - $httpBody = $generate_united_marketplace_services_report_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17891,7 +12729,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17899,40 +12737,42 @@ class FbsApi } /** - * Operation generateUnitedNettingReport_2 + * Operation generateOrderLabels * - * Отчет по платежам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedNettingReport_2($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_2'][0]) + public function generateOrderLabels($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - list($response) = $this->generateUnitedNettingReport_2WithHttpInfo($generate_united_netting_report_request, $format, $contentType); + list($response) = $this->generateOrderLabelsWithHttpInfo($campaign_id, $order_id, $format, $contentType); return $response; } /** - * Operation generateUnitedNettingReport_2WithHttpInfo + * Operation generateOrderLabelsWithHttpInfo * - * Отчет по платежам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedNettingReport_2WithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_2'][0]) + public function generateOrderLabelsWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - $request = $this->generateUnitedNettingReport_2Request($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateOrderLabelsRequest($campaign_id, $order_id, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -17959,169 +12799,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18135,44 +12857,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GenerateReportResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18180,7 +12879,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18188,7 +12887,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18196,7 +12895,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18204,7 +12911,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18212,27 +12919,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedNettingReport_2Async + * Operation generateOrderLabelsAsync * - * Отчет по платежам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_2Async($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_2'][0]) + public function generateOrderLabelsAsync($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - return $this->generateUnitedNettingReport_2AsyncWithHttpInfo($generate_united_netting_report_request, $format, $contentType) + return $this->generateOrderLabelsAsyncWithHttpInfo($campaign_id, $order_id, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -18241,21 +12951,22 @@ class FbsApi } /** - * Operation generateUnitedNettingReport_2AsyncWithHttpInfo + * Operation generateOrderLabelsAsyncWithHttpInfo * - * Отчет по платежам + * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_2AsyncWithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_2'][0]) + public function generateOrderLabelsAsyncWithHttpInfo($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedNettingReport_2Request($generate_united_netting_report_request, $format, $contentType); + $returnType = '\SplFileObject'; + $request = $this->generateOrderLabelsRequest($campaign_id, $order_id, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18294,28 +13005,39 @@ class FbsApi } /** - * Create request for operation 'generateUnitedNettingReport_2' + * Create request for operation 'generateOrderLabels' * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedNettingReport_2Request($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_2'][0]) + public function generateOrderLabelsRequest($campaign_id, $order_id, $format = null, string $contentType = self::contentTypes['generateOrderLabels'][0]) { - // verify the required parameter 'generate_united_netting_report_request' is set - if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport_2' + 'Missing the required parameter $campaign_id when calling generateOrderLabels' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.generateOrderLabels, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling generateOrderLabels' ); } - $resourcePath = '/reports/united-netting/generate'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18326,30 +13048,39 @@ class FbsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'ReportFormatType', // openApiType + 'PageFormatType', // openApiType '', // style false, // explode false // required ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); // for model (json/xml) - if (isset($generate_united_netting_report_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); - } else { - $httpBody = $generate_united_netting_report_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -18397,7 +13128,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18405,40 +13136,42 @@ class FbsApi } /** - * Operation generateUnitedOrdersReport_1 + * Operation generatePricesReport * - * Отчет по заказам + * Отчет «Цены на рынке» * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function generateUnitedOrdersReport_1($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_1'][0]) + public function generatePricesReport($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - list($response) = $this->generateUnitedOrdersReport_1WithHttpInfo($generate_united_orders_request, $format, $contentType); + list($response) = $this->generatePricesReportWithHttpInfo($generate_prices_report_request, $format, $contentType); return $response; } /** - * Operation generateUnitedOrdersReport_1WithHttpInfo + * Operation generatePricesReportWithHttpInfo * - * Отчет по заказам + * Отчет «Цены на рынке» * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function generateUnitedOrdersReport_1WithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_1'][0]) + public function generatePricesReportWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $request = $this->generateUnitedOrdersReport_1Request($generate_united_orders_request, $format, $contentType); + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -18465,169 +13198,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18641,34 +13250,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -18678,7 +13264,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18686,7 +13272,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18694,7 +13280,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18702,7 +13288,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18710,7 +13296,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18718,27 +13304,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedOrdersReport_1Async + * Operation generatePricesReportAsync * - * Отчет по заказам + * Отчет «Цены на рынке» * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function generateUnitedOrdersReport_1Async($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_1'][0]) + public function generatePricesReportAsync($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - return $this->generateUnitedOrdersReport_1AsyncWithHttpInfo($generate_united_orders_request, $format, $contentType) + return $this->generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -18747,21 +13336,22 @@ class FbsApi } /** - * Operation generateUnitedOrdersReport_1AsyncWithHttpInfo + * Operation generatePricesReportAsyncWithHttpInfo * - * Отчет по заказам + * Отчет «Цены на рынке» * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function generateUnitedOrdersReport_1AsyncWithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_1'][0]) + public function generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedOrdersReport_1Request($generate_united_orders_request, $format, $contentType); + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18800,28 +13390,29 @@ class FbsApi } /** - * Create request for operation 'generateUnitedOrdersReport_1' + * Create request for operation 'generatePricesReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function generateUnitedOrdersReport_1Request($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_1'][0]) + public function generatePricesReportRequest($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - // verify the required parameter 'generate_united_orders_request' is set - if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { + // verify the required parameter 'generate_prices_report_request' is set + if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport_1' + 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport' ); } - $resourcePath = '/reports/united-orders/generate'; + $resourcePath = '/v2/reports/prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18848,12 +13439,12 @@ class FbsApi ); // for model (json/xml) - if (isset($generate_united_orders_request)) { + if (isset($generate_prices_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); } else { - $httpBody = $generate_united_orders_request; + $httpBody = $generate_prices_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -18911,44 +13502,40 @@ class FbsApi } /** - * Operation getAllOffers_1 + * Operation generateSalesGeographyReport * - * Все предложения магазина + * Отчет по географии продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getAllOffers_1($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_1'][0]) + public function generateSalesGeographyReport($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - list($response) = $this->getAllOffers_1WithHttpInfo($campaign_id, $feed_id, $chunk, $contentType); + list($response) = $this->generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format, $contentType); return $response; } /** - * Operation getAllOffers_1WithHttpInfo + * Operation generateSalesGeographyReportWithHttpInfo * - * Все предложения магазина + * Отчет по географии продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getAllOffers_1WithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_1'][0]) + public function generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $request = $this->getAllOffers_1Request($campaign_id, $feed_id, $chunk, $contentType); + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -18975,196 +13562,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetAllOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetAllOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetAllOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19178,44 +13614,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetAllOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19223,7 +13636,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19231,7 +13644,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19239,15 +13652,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19255,7 +13660,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19263,29 +13668,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllOffers_1Async + * Operation generateSalesGeographyReportAsync * - * Все предложения магазина + * Отчет по географии продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffers_1Async($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_1'][0]) + public function generateSalesGeographyReportAsync($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - return $this->getAllOffers_1AsyncWithHttpInfo($campaign_id, $feed_id, $chunk, $contentType) + return $this->generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -19294,23 +13699,21 @@ class FbsApi } /** - * Operation getAllOffers_1AsyncWithHttpInfo + * Operation generateSalesGeographyReportAsyncWithHttpInfo * - * Все предложения магазина + * Отчет по географии продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffers_1AsyncWithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_1'][0]) + public function generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - $request = $this->getAllOffers_1Request($campaign_id, $feed_id, $chunk, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19349,34 +13752,28 @@ class FbsApi } /** - * Create request for operation 'getAllOffers_1' + * Create request for operation 'generateSalesGeographyReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getAllOffers_1Request($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_1'][0]) + public function generateSalesGeographyReportRequest($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_sales_geography_request' is set + if ($generate_sales_geography_request === null || (is_array($generate_sales_geography_request) && count($generate_sales_geography_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getAllOffers_1' + 'Missing the required parameter $generate_sales_geography_request when calling generateSalesGeographyReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getAllOffers_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/offers/all'; + $resourcePath = '/v2/reports/sales-geography/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19385,32 +13782,15 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chunk, - 'chunk', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19420,7 +13800,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_sales_geography_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_sales_geography_request)); + } else { + $httpBody = $generate_sales_geography_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -19468,7 +13855,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19476,44 +13863,40 @@ class FbsApi } /** - * Operation getBidsInfoForBusiness_1 + * Operation generateShelfsStatisticsReport * - * Информация об установленных ставках + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBidsInfoForBusiness_1($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_1'][0]) + public function generateShelfsStatisticsReport($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - list($response) = $this->getBidsInfoForBusiness_1WithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + list($response) = $this->generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); return $response; } /** - * Operation getBidsInfoForBusiness_1WithHttpInfo + * Operation generateShelfsStatisticsReportWithHttpInfo * - * Информация об установленных ставках + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBidsInfoForBusiness_1WithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_1'][0]) + public function generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $request = $this->getBidsInfoForBusiness_1Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -19540,196 +13923,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19743,44 +13975,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsInfoResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19788,7 +13997,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19796,7 +14005,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19804,15 +14013,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19820,7 +14021,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19828,29 +14029,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsInfoForBusiness_1Async + * Operation generateShelfsStatisticsReportAsync * - * Информация об установленных ставках + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsInfoForBusiness_1Async($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_1'][0]) + public function generateShelfsStatisticsReportAsync($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - return $this->getBidsInfoForBusiness_1AsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) + return $this->generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -19859,23 +14060,21 @@ class FbsApi } /** - * Operation getBidsInfoForBusiness_1AsyncWithHttpInfo + * Operation generateShelfsStatisticsReportAsyncWithHttpInfo * - * Информация об установленных ставках + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsInfoForBusiness_1AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_1'][0]) + public function generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - $request = $this->getBidsInfoForBusiness_1Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19914,35 +14113,28 @@ class FbsApi } /** - * Create request for operation 'getBidsInfoForBusiness_1' + * Create request for operation 'generateShelfsStatisticsReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBidsInfoForBusiness_1Request($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_1'][0]) + public function generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_shelfs_statistics_request' is set + if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsInfoForBusiness_1' + 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBidsInfoForBusiness_1, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/businesses/{businessId}/bids/info'; + $resourcePath = '/v2/reports/shelf-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19951,32 +14143,15 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19986,12 +14161,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_bids_info_request)) { + if (isset($generate_shelfs_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); } else { - $httpBody = $get_bids_info_request; + $httpBody = $generate_shelfs_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -20049,40 +14224,38 @@ class FbsApi } /** - * Operation getBidsRecommendations_1 + * Operation generateShipmentListDocumentReport * - * Рекомендованные ставки для заданных товаров + * Получение листа сборки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBidsRecommendations_1($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_1'][0]) + public function generateShipmentListDocumentReport($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) { - list($response) = $this->getBidsRecommendations_1WithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); + list($response) = $this->generateShipmentListDocumentReportWithHttpInfo($generate_shipment_list_document_report_request, $contentType); return $response; } /** - * Operation getBidsRecommendations_1WithHttpInfo + * Operation generateShipmentListDocumentReportWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Получение листа сборки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBidsRecommendations_1WithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_1'][0]) + public function generateShipmentListDocumentReportWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) { - $request = $this->getBidsRecommendations_1Request($business_id, $get_bids_recommendations_request, $contentType); + $request = $this->generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -20109,196 +14282,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20312,44 +14334,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20357,7 +14356,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20365,7 +14364,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20373,15 +14372,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20389,7 +14380,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20397,27 +14388,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsRecommendations_1Async + * Operation generateShipmentListDocumentReportAsync * - * Рекомендованные ставки для заданных товаров + * Получение листа сборки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_1Async($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_1'][0]) + public function generateShipmentListDocumentReportAsync($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) { - return $this->getBidsRecommendations_1AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) + return $this->generateShipmentListDocumentReportAsyncWithHttpInfo($generate_shipment_list_document_report_request, $contentType) ->then( function ($response) { return $response[0]; @@ -20426,21 +14418,20 @@ class FbsApi } /** - * Operation getBidsRecommendations_1AsyncWithHttpInfo + * Operation generateShipmentListDocumentReportAsyncWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Получение листа сборки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_1AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_1'][0]) + public function generateShipmentListDocumentReportAsyncWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - $request = $this->getBidsRecommendations_1Request($business_id, $get_bids_recommendations_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20479,37 +14470,26 @@ class FbsApi } /** - * Create request for operation 'getBidsRecommendations_1' + * Create request for operation 'generateShipmentListDocumentReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBidsRecommendations_1Request($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_1'][0]) + public function generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsRecommendations_1' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBidsRecommendations_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_bids_recommendations_request' is set - if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { + // verify the required parameter 'generate_shipment_list_document_report_request' is set + if ($generate_shipment_list_document_report_request === null || (is_array($generate_shipment_list_document_report_request) && count($generate_shipment_list_document_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations_1' + 'Missing the required parameter $generate_shipment_list_document_report_request when calling generateShipmentListDocumentReport' ); } - $resourcePath = '/businesses/{businessId}/bids/recommendations'; + $resourcePath = '/v2/reports/documents/shipment-list/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20518,14 +14498,6 @@ class FbsApi - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -20535,12 +14507,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_bids_recommendations_request)) { + if (isset($generate_shipment_list_document_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shipment_list_document_report_request)); } else { - $httpBody = $get_bids_recommendations_request; + $httpBody = $generate_shipment_list_document_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -20598,44 +14570,40 @@ class FbsApi } /** - * Operation getBusinessQuarantineOffers_2 + * Operation generateShowsBoostReport * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessQuarantineOffers_2($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_2'][0]) + public function generateShowsBoostReport($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - list($response) = $this->getBusinessQuarantineOffers_2WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format, $contentType); return $response; } /** - * Operation getBusinessQuarantineOffers_2WithHttpInfo + * Operation generateShowsBoostReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessQuarantineOffers_2WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_2'][0]) + public function generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $request = $this->getBusinessQuarantineOffers_2Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -20662,196 +14630,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20865,44 +14682,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20910,7 +14704,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20918,7 +14712,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20926,15 +14720,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20942,7 +14728,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20950,29 +14736,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessQuarantineOffers_2Async + * Operation generateShowsBoostReportAsync * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_2Async($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_2'][0]) + public function generateShowsBoostReportAsync($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - return $this->getBusinessQuarantineOffers_2AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -20981,23 +14767,21 @@ class FbsApi } /** - * Operation getBusinessQuarantineOffers_2AsyncWithHttpInfo + * Operation generateShowsBoostReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_2AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_2'][0]) + public function generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getBusinessQuarantineOffers_2Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21036,41 +14820,28 @@ class FbsApi } /** - * Create request for operation 'getBusinessQuarantineOffers_2' + * Create request for operation 'generateShowsBoostReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessQuarantineOffers_2Request($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_2'][0]) + public function generateShowsBoostReportRequest($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers_2' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBusinessQuarantineOffers_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_shows_boost_request' is set + if ($generate_shows_boost_request === null || (is_array($generate_shows_boost_request) && count($generate_shows_boost_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers_2' + 'Missing the required parameter $generate_shows_boost_request when calling generateShowsBoostReport' ); } - - $resourcePath = '/businesses/{businessId}/price-quarantine'; + $resourcePath = '/v2/reports/shows-boost/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21079,32 +14850,15 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -21114,12 +14868,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_shows_boost_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_boost_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_shows_boost_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -21177,38 +14931,40 @@ class FbsApi } /** - * Operation getBusinessSettings_1 + * Operation generateShowsSalesReport * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessSettings_1($business_id, string $contentType = self::contentTypes['getBusinessSettings_1'][0]) + public function generateShowsSalesReport($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - list($response) = $this->getBusinessSettings_1WithHttpInfo($business_id, $contentType); + list($response) = $this->generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format, $contentType); return $response; } /** - * Operation getBusinessSettings_1WithHttpInfo + * Operation generateShowsSalesReportWithHttpInfo * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessSettings_1WithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_1'][0]) + public function generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $request = $this->getBusinessSettings_1Request($business_id, $contentType); + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -21235,196 +14991,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21438,44 +15049,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21483,7 +15071,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21491,7 +15079,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21499,7 +15087,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21507,7 +15095,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21515,7 +15103,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21523,26 +15111,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessSettings_1Async + * Operation generateShowsSalesReportAsync * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_1Async($business_id, string $contentType = self::contentTypes['getBusinessSettings_1'][0]) + public function generateShowsSalesReportAsync($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - return $this->getBusinessSettings_1AsyncWithHttpInfo($business_id, $contentType) + return $this->generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -21551,20 +15142,21 @@ class FbsApi } /** - * Operation getBusinessSettings_1AsyncWithHttpInfo + * Operation generateShowsSalesReportAsyncWithHttpInfo * - * Настройки кабинета + * Отчет «Аналитика продаж» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_1AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_1'][0]) + public function generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - $request = $this->getBusinessSettings_1Request($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21603,45 +15195,45 @@ class FbsApi } /** - * Create request for operation 'getBusinessSettings_1' + * Create request for operation 'generateShowsSalesReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessSettings_1Request($business_id, string $contentType = self::contentTypes['getBusinessSettings_1'][0]) + public function generateShowsSalesReportRequest($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_shows_sales_report_request' is set + if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessSettings_1' + 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBusinessSettings_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/businesses/{businessId}/settings'; + + + $resourcePath = '/v2/reports/shows-sales/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -21651,7 +15243,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_shows_sales_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + } else { + $httpBody = $generate_shows_sales_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -21707,38 +15306,40 @@ class FbsApi } /** - * Operation getCampaignLogins_2 + * Operation generateStocksOnWarehousesReport * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignLogins_2($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_2'][0]) + public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - list($response) = $this->getCampaignLogins_2WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); return $response; } /** - * Operation getCampaignLogins_2WithHttpInfo + * Operation generateStocksOnWarehousesReportWithHttpInfo * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignLogins_2WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_2'][0]) + public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $request = $this->getCampaignLogins_2Request($campaign_id, $contentType); + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -21765,196 +15366,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignLoginsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21968,44 +15424,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignLoginsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22013,7 +15446,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22021,7 +15454,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22029,7 +15462,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22037,7 +15470,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22045,7 +15478,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22053,26 +15486,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignLogins_2Async + * Operation generateStocksOnWarehousesReportAsync * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_2Async($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_2'][0]) + public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - return $this->getCampaignLogins_2AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -22081,20 +15517,21 @@ class FbsApi } /** - * Operation getCampaignLogins_2AsyncWithHttpInfo + * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo * - * Логины, связанные с магазином + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_2AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_2'][0]) + public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - $request = $this->getCampaignLogins_2Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22133,45 +15570,45 @@ class FbsApi } /** - * Create request for operation 'getCampaignLogins_2' + * Create request for operation 'generateStocksOnWarehousesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignLogins_2Request($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_2'][0]) + public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set + if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignLogins_2' + 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignLogins_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/logins'; + + + $resourcePath = '/v2/reports/stocks-on-warehouses/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -22181,7 +15618,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_stocks_on_warehouses_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + } else { + $httpBody = $generate_stocks_on_warehouses_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -22229,7 +15673,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -22237,44 +15681,42 @@ class FbsApi } /** - * Operation getCampaignOffers_2 + * Operation generateUnitedMarketplaceServicesReport * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignOffers_2($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_2'][0]) + public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - list($response) = $this->getCampaignOffers_2WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignOffers_2WithHttpInfo + * Operation generateUnitedMarketplaceServicesReportWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignOffers_2WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_2'][0]) + public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $request = $this->getCampaignOffers_2Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -22301,196 +15743,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22504,44 +15801,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22549,7 +15823,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22557,7 +15831,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22565,7 +15839,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22573,7 +15847,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22581,7 +15855,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22589,29 +15863,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignOffers_2Async + * Operation generateUnitedMarketplaceServicesReportAsync * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_2Async($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_2'][0]) + public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - return $this->getCampaignOffers_2AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) + return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -22620,23 +15895,22 @@ class FbsApi } /** - * Operation getCampaignOffers_2AsyncWithHttpInfo + * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_2AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_2'][0]) + public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - $request = $this->getCampaignOffers_2Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22675,41 +15949,30 @@ class FbsApi } /** - * Create request for operation 'getCampaignOffers_2' + * Create request for operation 'generateUnitedMarketplaceServicesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignOffers_2Request($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_2'][0]) + public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignOffers_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignOffers_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_campaign_offers_request' is set - if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + // verify the required parameter 'generate_united_marketplace_services_report_request' is set + if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers_2' + 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' ); } - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/reports/united-marketplace-services/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22718,32 +15981,24 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -22753,12 +16008,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_campaign_offers_request)) { + if (isset($generate_united_marketplace_services_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); } else { - $httpBody = $get_campaign_offers_request; + $httpBody = $generate_united_marketplace_services_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -22816,44 +16071,42 @@ class FbsApi } /** - * Operation getCampaignQuarantineOffers_2 + * Operation generateUnitedNettingReport * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignQuarantineOffers_2($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_2'][0]) + public function generateUnitedNettingReport($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - list($response) = $this->getCampaignQuarantineOffers_2WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignQuarantineOffers_2WithHttpInfo + * Operation generateUnitedNettingReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignQuarantineOffers_2WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_2'][0]) + public function generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $request = $this->getCampaignQuarantineOffers_2Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -22880,196 +16133,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23083,44 +16191,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23128,7 +16213,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23136,7 +16221,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23144,7 +16229,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23152,7 +16237,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23160,7 +16245,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23168,29 +16253,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignQuarantineOffers_2Async + * Operation generateUnitedNettingReportAsync * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_2Async($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_2'][0]) + public function generateUnitedNettingReportAsync($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - return $this->getCampaignQuarantineOffers_2AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -23199,23 +16285,22 @@ class FbsApi } /** - * Operation getCampaignQuarantineOffers_2AsyncWithHttpInfo + * Operation generateUnitedNettingReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_2AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_2'][0]) + public function generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getCampaignQuarantineOffers_2Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23254,41 +16339,30 @@ class FbsApi } /** - * Create request for operation 'getCampaignQuarantineOffers_2' + * Create request for operation 'generateUnitedNettingReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignQuarantineOffers_2Request($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_2'][0]) + public function generateUnitedNettingReportRequest($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignQuarantineOffers_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_united_netting_report_request' is set + if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers_2' + 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine'; + $resourcePath = '/v2/reports/united-netting/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23297,32 +16371,24 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -23332,12 +16398,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_united_netting_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_united_netting_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -23395,40 +16461,42 @@ class FbsApi } /** - * Operation getCampaignRegion_2 + * Operation generateUnitedOrdersReport * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignRegion_2($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_2'][0]) + public function generateUnitedOrdersReport($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - list($response) = $this->getCampaignRegion_2WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignRegion_2WithHttpInfo + * Operation generateUnitedOrdersReportWithHttpInfo * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRegion_2WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_2'][0]) + public function generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $request = $this->getCampaignRegion_2Request($campaign_id, $contentType); + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -23455,196 +16523,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignRegionResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23658,44 +16581,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignRegionResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23703,7 +16603,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23711,7 +16611,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23719,7 +16619,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23727,7 +16627,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23735,7 +16635,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23743,27 +16643,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignRegion_2Async + * Operation generateUnitedOrdersReportAsync * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_2Async($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_2'][0]) + public function generateUnitedOrdersReportAsync($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - return $this->getCampaignRegion_2AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -23772,21 +16675,22 @@ class FbsApi } /** - * Operation getCampaignRegion_2AsyncWithHttpInfo + * Operation generateUnitedOrdersReportAsyncWithHttpInfo * - * Регион магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_2AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_2'][0]) + public function generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - $request = $this->getCampaignRegion_2Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23825,46 +16729,56 @@ class FbsApi } /** - * Create request for operation 'getCampaignRegion_2' + * Create request for operation 'generateUnitedOrdersReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getCampaignRegion_2Request($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_2'][0]) + public function generateUnitedOrdersReportRequest($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_orders_request' is set + if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignRegion_2' + 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignRegion_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/region'; + + + + $resourcePath = '/v2/reports/united-orders/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -23874,7 +16788,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_orders_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + } else { + $httpBody = $generate_united_orders_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -23922,7 +16843,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -23930,38 +16851,40 @@ class FbsApi } /** - * Operation getCampaignSettings_1 + * Operation generateUnitedReturnsReport * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignSettings_1($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_1'][0]) + public function generateUnitedReturnsReport($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - list($response) = $this->getCampaignSettings_1WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format, $contentType); return $response; } /** - * Operation getCampaignSettings_1WithHttpInfo + * Operation generateUnitedReturnsReportWithHttpInfo * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignSettings_1WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_1'][0]) + public function generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $request = $this->getCampaignSettings_1Request($campaign_id, $contentType); + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -23988,196 +16911,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24191,44 +16963,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24236,7 +16985,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24244,7 +16993,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24252,15 +17001,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24268,7 +17009,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24276,26 +17017,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignSettings_1Async + * Operation generateUnitedReturnsReportAsync * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_1Async($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_1'][0]) + public function generateUnitedReturnsReportAsync($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - return $this->getCampaignSettings_1AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -24304,20 +17048,21 @@ class FbsApi } /** - * Operation getCampaignSettings_1AsyncWithHttpInfo + * Operation generateUnitedReturnsReportAsyncWithHttpInfo * - * Настройки магазина + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_1AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_1'][0]) + public function generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - $request = $this->getCampaignSettings_1Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24356,45 +17101,45 @@ class FbsApi } /** - * Create request for operation 'getCampaignSettings_1' + * Create request for operation 'generateUnitedReturnsReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignSettings_1Request($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_1'][0]) + public function generateUnitedReturnsReportRequest($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_returns_request' is set + if ($generate_united_returns_request === null || (is_array($generate_united_returns_request) && count($generate_united_returns_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignSettings_1' + 'Missing the required parameter $generate_united_returns_request when calling generateUnitedReturnsReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignSettings_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/settings'; + + + $resourcePath = '/v2/reports/united-returns/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -24404,7 +17149,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_returns_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_returns_request)); + } else { + $httpBody = $generate_united_returns_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -24452,7 +17204,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -24460,38 +17212,36 @@ class FbsApi } /** - * Operation getCampaign_2 + * Operation getAuthTokenInfo * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaign_2($campaign_id, string $contentType = self::contentTypes['getCampaign_2'][0]) + public function getAuthTokenInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - list($response) = $this->getCampaign_2WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getAuthTokenInfoWithHttpInfo($contentType); return $response; } /** - * Operation getCampaign_2WithHttpInfo + * Operation getAuthTokenInfoWithHttpInfo * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaign_2WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_2'][0]) + public function getAuthTokenInfoWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $request = $this->getCampaign_2Request($campaign_id, $contentType); + $request = $this->getAuthTokenInfoRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -24518,196 +17268,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24721,44 +17320,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignResponse', + '\OpenAPI\Client\Model\GetTokenInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24766,7 +17342,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24774,7 +17350,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24782,15 +17358,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24798,7 +17366,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24806,26 +17374,27 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaign_2Async + * Operation getAuthTokenInfoAsync * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_2Async($campaign_id, string $contentType = self::contentTypes['getCampaign_2'][0]) + public function getAuthTokenInfoAsync(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - return $this->getCampaign_2AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getAuthTokenInfoAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -24834,20 +17403,19 @@ class FbsApi } /** - * Operation getCampaign_2AsyncWithHttpInfo + * Operation getAuthTokenInfoAsyncWithHttpInfo * - * Информация о магазине + * Получение информации о токене авторизации * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_2AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_2'][0]) + public function getAuthTokenInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - $request = $this->getCampaign_2Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetTokenInfoResponse'; + $request = $this->getAuthTokenInfoRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24886,29 +17454,18 @@ class FbsApi } /** - * Create request for operation 'getCampaign_2' + * Create request for operation 'getAuthTokenInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaign_2Request($campaign_id, string $contentType = self::contentTypes['getCampaign_2'][0]) + public function getAuthTokenInfoRequest(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaign_2' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaign_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}'; + $resourcePath = '/v2/auth/token'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24917,14 +17474,6 @@ class FbsApi - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -24982,7 +17531,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -24990,42 +17539,44 @@ class FbsApi } /** - * Operation getCampaignsByLogin_2 + * Operation getBidsInfoForBusiness * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignsByLogin_2($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_2'][0]) + public function getBidsInfoForBusiness($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - list($response) = $this->getCampaignsByLogin_2WithHttpInfo($login, $page, $page_size, $contentType); + list($response) = $this->getBidsInfoForBusinessWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $response; } /** - * Operation getCampaignsByLogin_2WithHttpInfo + * Operation getBidsInfoForBusinessWithHttpInfo * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignsByLogin_2WithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_2'][0]) + public function getBidsInfoForBusinessWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $request = $this->getCampaignsByLogin_2Request($login, $page, $page_size, $contentType); + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -25052,196 +17603,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25255,44 +17661,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetBidsInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25300,7 +17683,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25308,7 +17691,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25316,7 +17699,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25324,7 +17707,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25332,7 +17715,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25340,28 +17723,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignsByLogin_2Async + * Operation getBidsInfoForBusinessAsync * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_2Async($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_2'][0]) + public function getBidsInfoForBusinessAsync($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - return $this->getCampaignsByLogin_2AsyncWithHttpInfo($login, $page, $page_size, $contentType) + return $this->getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) ->then( function ($response) { return $response[0]; @@ -25370,22 +17756,23 @@ class FbsApi } /** - * Operation getCampaignsByLogin_2AsyncWithHttpInfo + * Operation getBidsInfoForBusinessAsyncWithHttpInfo * - * Магазины, доступные логину + * Информация об установленных ставках * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_2AsyncWithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_2'][0]) + public function getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaignsByLogin_2Request($login, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25424,33 +17811,38 @@ class FbsApi } /** - * Create request for operation 'getCampaignsByLogin_2' + * Create request for operation 'getBidsInfoForBusiness' * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignsByLogin_2Request($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_2'][0]) + public function getBidsInfoForBusinessRequest($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - // verify the required parameter 'login' is set - if ($login === null || (is_array($login) && count($login) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $login when calling getCampaignsByLogin_2' + 'Missing the required parameter $business_id when calling getBidsInfoForBusiness' ); } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); + } + - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getCampaignsByLogin_2, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/by_login/{login}'; + $resourcePath = '/v2/businesses/{businessId}/bids/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -25459,17 +17851,17 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -25478,10 +17870,10 @@ class FbsApi // path params - if ($login !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'login' . '}', - ObjectSerializer::toPathValue($login), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -25494,7 +17886,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_bids_info_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + } else { + $httpBody = $get_bids_info_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -25542,7 +17941,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -25550,40 +17949,40 @@ class FbsApi } /** - * Operation getCampaigns_2 + * Operation getBidsRecommendations * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaigns_2($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_2'][0]) + public function getBidsRecommendations($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - list($response) = $this->getCampaigns_2WithHttpInfo($page, $page_size, $contentType); + list($response) = $this->getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); return $response; } /** - * Operation getCampaigns_2WithHttpInfo + * Operation getBidsRecommendationsWithHttpInfo * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaigns_2WithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_2'][0]) + public function getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $request = $this->getCampaigns_2Request($page, $page_size, $contentType); + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -25610,196 +18009,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25813,44 +18067,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25858,7 +18089,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25866,7 +18097,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25874,7 +18105,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25882,7 +18113,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25890,7 +18121,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25898,27 +18129,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaigns_2Async + * Operation getBidsRecommendationsAsync * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_2Async($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_2'][0]) + public function getBidsRecommendationsAsync($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - return $this->getCampaigns_2AsyncWithHttpInfo($page, $page_size, $contentType) + return $this->getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) ->then( function ($response) { return $response[0]; @@ -25927,21 +18160,21 @@ class FbsApi } /** - * Operation getCampaigns_2AsyncWithHttpInfo + * Operation getBidsRecommendationsAsyncWithHttpInfo * - * Список магазинов пользователя + * Рекомендованные ставки для заданных товаров * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_2AsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_2'][0]) + public function getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaigns_2Request($page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25980,51 +18213,53 @@ class FbsApi } /** - * Create request for operation 'getCampaigns_2' + * Create request for operation 'getBidsRecommendations' * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaigns_2Request($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_2'][0]) + public function getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getCampaigns_2, must be smaller than or equal to 10000.'); + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBidsRecommendations' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBidsRecommendations, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_bids_recommendations_request' is set + if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations' + ); + } - $resourcePath = '/campaigns'; + $resourcePath = '/v2/businesses/{businessId}/bids/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -26034,7 +18269,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_bids_recommendations_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); + } else { + $httpBody = $get_bids_recommendations_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -26082,7 +18324,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -26090,38 +18332,44 @@ class FbsApi } /** - * Operation getCategoriesMaxSaleQuantum_1 + * Operation getBusinessOrders * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesMaxSaleQuantum_1($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_1'][0]) + public function getBusinessOrders($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - list($response) = $this->getCategoriesMaxSaleQuantum_1WithHttpInfo($get_categories_max_sale_quantum_request, $contentType); + list($response) = $this->getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoriesMaxSaleQuantum_1WithHttpInfo + * Operation getBusinessOrdersWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesMaxSaleQuantum_1WithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_1'][0]) + public function getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $request = $this->getCategoriesMaxSaleQuantum_1Request($get_categories_max_sale_quantum_request, $contentType); + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -26148,196 +18396,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26351,44 +18454,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26396,7 +18476,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26404,7 +18484,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26412,7 +18492,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26420,7 +18500,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26428,7 +18508,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26436,26 +18516,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesMaxSaleQuantum_1Async + * Operation getBusinessOrdersAsync * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_1Async($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_1'][0]) + public function getBusinessOrdersAsync($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - return $this->getCategoriesMaxSaleQuantum_1AsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) + return $this->getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -26464,20 +18549,23 @@ class FbsApi } /** - * Operation getCategoriesMaxSaleQuantum_1AsyncWithHttpInfo + * Operation getBusinessOrdersAsyncWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_1AsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_1'][0]) + public function getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - $request = $this->getCategoriesMaxSaleQuantum_1Request($get_categories_max_sale_quantum_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessOrdersResponse'; + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26516,34 +18604,78 @@ class FbsApi } /** - * Create request for operation 'getCategoriesMaxSaleQuantum_1' + * Create request for operation 'getBusinessOrders' * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesMaxSaleQuantum_1Request($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_1'][0]) + public function getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - // verify the required parameter 'get_categories_max_sale_quantum_request' is set - if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessOrders' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_business_orders_request' is set + if ($get_business_orders_request === null || (is_array($get_business_orders_request) && count($get_business_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum_1' + 'Missing the required parameter $get_business_orders_request when calling getBusinessOrders' ); } - $resourcePath = '/categories/max-sale-quantum'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -26553,12 +18685,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_categories_max_sale_quantum_request)) { + if (isset($get_business_orders_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_business_orders_request)); } else { - $httpBody = $get_categories_max_sale_quantum_request; + $httpBody = $get_business_orders_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -26616,38 +18748,44 @@ class FbsApi } /** - * Operation getCategoriesTree_1 + * Operation getBusinessQuarantineOffers * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesTree_1($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_1'][0]) + public function getBusinessQuarantineOffers($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - list($response) = $this->getCategoriesTree_1WithHttpInfo($get_categories_request, $contentType); + list($response) = $this->getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoriesTree_1WithHttpInfo + * Operation getBusinessQuarantineOffersWithHttpInfo * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesTree_1WithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_1'][0]) + public function getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $request = $this->getCategoriesTree_1Request($get_categories_request, $contentType); + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -26674,196 +18812,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26877,44 +18870,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26922,7 +18892,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26930,7 +18900,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26938,7 +18908,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26946,7 +18916,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26954,7 +18924,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26962,26 +18932,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesTree_1Async + * Operation getBusinessQuarantineOffersAsync * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_1Async($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_1'][0]) + public function getBusinessQuarantineOffersAsync($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - return $this->getCategoriesTree_1AsyncWithHttpInfo($get_categories_request, $contentType) + return $this->getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -26990,20 +18965,23 @@ class FbsApi } /** - * Operation getCategoriesTree_1AsyncWithHttpInfo + * Operation getBusinessQuarantineOffersAsyncWithHttpInfo * - * Дерево категорий + * Список товаров, находящихся в карантине по цене в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_1AsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_1'][0]) + public function getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - $request = $this->getCategoriesTree_1Request($get_categories_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27042,28 +19020,78 @@ class FbsApi } /** - * Create request for operation 'getCategoriesTree_1' + * Create request for operation 'getBusinessQuarantineOffers' * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesTree_1Request($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_1'][0]) + public function getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers' + ); + } + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + - $resourcePath = '/categories/tree'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -27073,12 +19101,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_categories_request)) { + if (isset($get_quarantine_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); } else { - $httpBody = $get_categories_request; + $httpBody = $get_quarantine_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -27136,38 +19164,38 @@ class FbsApi } /** - * Operation getCategoryContentParameters_2 + * Operation getBusinessSettings * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoryContentParameters_2($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_2'][0]) + public function getBusinessSettings($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - list($response) = $this->getCategoryContentParameters_2WithHttpInfo($category_id, $contentType); + list($response) = $this->getBusinessSettingsWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getCategoryContentParameters_2WithHttpInfo + * Operation getBusinessSettingsWithHttpInfo * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoryContentParameters_2WithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_2'][0]) + public function getBusinessSettingsWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $request = $this->getCategoryContentParameters_2Request($category_id, $contentType); + $request = $this->getBusinessSettingsRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27194,196 +19222,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -27397,44 +19280,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27442,7 +19302,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27450,7 +19310,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27458,7 +19318,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27466,7 +19326,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27474,7 +19334,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27482,26 +19342,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoryContentParameters_2Async + * Operation getBusinessSettingsAsync * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_2Async($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_2'][0]) + public function getBusinessSettingsAsync($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - return $this->getCategoryContentParameters_2AsyncWithHttpInfo($category_id, $contentType) + return $this->getBusinessSettingsAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -27510,20 +19372,20 @@ class FbsApi } /** - * Operation getCategoryContentParameters_2AsyncWithHttpInfo + * Operation getBusinessSettingsAsyncWithHttpInfo * - * Списки характеристик товаров по категориям + * Настройки кабинета * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_2AsyncWithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_2'][0]) + public function getBusinessSettingsAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - $request = $this->getCategoryContentParameters_2Request($category_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; + $request = $this->getBusinessSettingsRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27562,29 +19424,29 @@ class FbsApi } /** - * Create request for operation 'getCategoryContentParameters_2' + * Create request for operation 'getBusinessSettings' * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoryContentParameters_2Request($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_2'][0]) + public function getBusinessSettingsRequest($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - // verify the required parameter 'category_id' is set - if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $category_id when calling getCategoryContentParameters_2' + 'Missing the required parameter $business_id when calling getBusinessSettings' ); } - if ($category_id < 1) { - throw new \InvalidArgumentException('invalid value for "$category_id" when calling FbsApi.getCategoryContentParameters_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getBusinessSettings, must be bigger than or equal to 1.'); } - $resourcePath = '/category/{categoryId}/parameters'; + $resourcePath = '/v2/businesses/{businessId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27594,10 +19456,10 @@ class FbsApi // path params - if ($category_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'categoryId' . '}', - ObjectSerializer::toPathValue($category_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -27666,46 +19528,38 @@ class FbsApi } /** - * Operation getChatHistory_1 + * Operation getCampaign * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChatHistory_1($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_1'][0]) + public function getCampaign($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - list($response) = $this->getChatHistory_1WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + list($response) = $this->getCampaignWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getChatHistory_1WithHttpInfo + * Operation getCampaignWithHttpInfo * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChatHistory_1WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_1'][0]) + public function getCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $request = $this->getChatHistory_1Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $request = $this->getCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27732,196 +19586,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatHistoryResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -27935,44 +19644,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatHistoryResponse', + '\OpenAPI\Client\Model\GetCampaignResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27980,7 +19666,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27988,7 +19674,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27996,7 +19682,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28004,7 +19690,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28012,7 +19698,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28020,30 +19706,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChatHistory_1Async + * Operation getCampaignAsync * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_1Async($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_1'][0]) + public function getCampaignAsync($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - return $this->getChatHistory_1AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) + return $this->getCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -28052,24 +19736,20 @@ class FbsApi } /** - * Operation getChatHistory_1AsyncWithHttpInfo + * Operation getCampaignAsyncWithHttpInfo * - * Получение истории сообщений в чате + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_1AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_1'][0]) + public function getCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - $request = $this->getChatHistory_1Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; + $request = $this->getCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28108,92 +19788,42 @@ class FbsApi } /** - * Create request for operation 'getChatHistory_1' + * Create request for operation 'getCampaign' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChatHistory_1Request($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_1'][0]) + public function getCampaignRequest($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChatHistory_1' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getChatHistory_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling getChatHistory_1' + 'Missing the required parameter $campaign_id when calling getCampaign' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.getChatHistory_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaign, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chat_history_request' is set - if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chat_history_request when calling getChatHistory_1' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats/history'; + $resourcePath = '/v2/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -28206,14 +19836,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_chat_history_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); - } else { - $httpBody = $get_chat_history_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -28261,7 +19884,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -28269,44 +19892,44 @@ class FbsApi } /** - * Operation getChats_1 + * Operation getCampaignOffers * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChats_1($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_1'][0]) + public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - list($response) = $this->getChats_1WithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); + list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getChats_1WithHttpInfo + * Operation getCampaignOffersWithHttpInfo * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChats_1WithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_1'][0]) + public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $request = $this->getChats_1Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -28333,196 +19956,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -28536,44 +20014,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatsResponse', + '\OpenAPI\Client\Model\GetCampaignOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28581,7 +20036,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28589,7 +20044,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28597,7 +20052,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28605,7 +20060,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28613,7 +20068,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28621,29 +20076,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChats_1Async + * Operation getCampaignOffersAsync * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_1Async($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_1'][0]) + public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - return $this->getChats_1AsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) + return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -28652,23 +20109,23 @@ class FbsApi } /** - * Operation getChats_1AsyncWithHttpInfo + * Operation getCampaignOffersAsyncWithHttpInfo * - * Получение доступных чатов + * Информация о товарах, которые размещены в заданном магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_1AsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_1'][0]) + public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - $request = $this->getChats_1Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28707,41 +20164,44 @@ class FbsApi } /** - * Create request for operation 'getChats_1' + * Create request for operation 'getCampaignOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChats_1Request($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_1'][0]) + public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChats_1' + 'Missing the required parameter $campaign_id when calling getCampaignOffers' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getChats_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chats_request' is set - if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { + // verify the required parameter 'get_campaign_offers_request' is set + if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_chats_request when calling getChats_1' + 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/chats'; + $resourcePath = '/v2/campaigns/{campaignId}/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28769,10 +20229,10 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -28785,12 +20245,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_chats_request)) { + if (isset($get_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); } else { - $httpBody = $get_chats_request; + $httpBody = $get_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -28848,36 +20308,44 @@ class FbsApi } /** - * Operation getDeliveryServices_0 + * Operation getCampaignQuarantineOffers * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getDeliveryServices_0(string $contentType = self::contentTypes['getDeliveryServices_0'][0]) + public function getCampaignQuarantineOffers($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - list($response) = $this->getDeliveryServices_0WithHttpInfo($contentType); + list($response) = $this->getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getDeliveryServices_0WithHttpInfo + * Operation getCampaignQuarantineOffersWithHttpInfo * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getDeliveryServices_0WithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices_0'][0]) + public function getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $request = $this->getDeliveryServices_0Request($contentType); + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -28904,196 +20372,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetDeliveryServicesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetDeliveryServicesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29107,44 +20430,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29152,7 +20452,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29160,7 +20460,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29168,7 +20468,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29176,7 +20476,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29184,7 +20484,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29192,25 +20492,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getDeliveryServices_0Async + * Operation getCampaignQuarantineOffersAsync * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryServices_0Async(string $contentType = self::contentTypes['getDeliveryServices_0'][0]) + public function getCampaignQuarantineOffersAsync($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - return $this->getDeliveryServices_0AsyncWithHttpInfo($contentType) + return $this->getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -29219,19 +20525,23 @@ class FbsApi } /** - * Operation getDeliveryServices_0AsyncWithHttpInfo + * Operation getCampaignQuarantineOffersAsyncWithHttpInfo * - * Справочник служб доставки + * Список товаров, находящихся в карантине по цене в магазине * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDeliveryServices_0AsyncWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices_0'][0]) + public function getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; - $request = $this->getDeliveryServices_0Request($contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29270,26 +20580,78 @@ class FbsApi } /** - * Create request for operation 'getDeliveryServices_0' + * Create request for operation 'getCampaignQuarantineOffers' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getDeliveryServices_0Request(string $contentType = self::contentTypes['getDeliveryServices_0'][0]) + public function getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers' + ); + } + - $resourcePath = '/delivery/services'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -29299,7 +20661,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_quarantine_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + } else { + $httpBody = $get_quarantine_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -29347,7 +20716,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -29355,50 +20724,38 @@ class FbsApi } /** - * Operation getFeedIndexLogs_1 + * Operation getCampaignSettings * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeedIndexLogs_1($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_1'][0]) + public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - list($response) = $this->getFeedIndexLogs_1WithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getFeedIndexLogs_1WithHttpInfo + * Operation getCampaignSettingsWithHttpInfo * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedIndexLogs_1WithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_1'][0]) + public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $request = $this->getFeedIndexLogs_1Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -29425,196 +20782,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29628,44 +20840,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29673,7 +20862,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29681,7 +20870,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29689,7 +20878,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29697,7 +20886,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29705,7 +20894,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29713,32 +20902,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedIndexLogs_1Async + * Operation getCampaignSettingsAsync * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_1Async($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_1'][0]) + public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - return $this->getFeedIndexLogs_1AsyncWithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType) + return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -29747,26 +20932,20 @@ class FbsApi } /** - * Operation getFeedIndexLogs_1AsyncWithHttpInfo + * Operation getCampaignSettingsAsyncWithHttpInfo * - * Отчет по индексации прайс-листа + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_1AsyncWithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_1'][0]) + public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - $request = $this->getFeedIndexLogs_1Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29805,88 +20984,35 @@ class FbsApi } /** - * Create request for operation 'getFeedIndexLogs_1' + * Create request for operation 'getCampaignSettings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeedIndexLogs_1Request($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_1'][0]) + public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedIndexLogs_1' + 'Missing the required parameter $campaign_id when calling getCampaignSettings' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getFeedIndexLogs_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getCampaignSettings, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeedIndexLogs_1' - ); - } - - - - - - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/index-logs'; + $resourcePath = '/v2/campaigns/{campaignId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_from, - 'published_time_from', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_to, - 'published_time_to', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'FeedIndexLogsStatusType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -29897,14 +21023,6 @@ class FbsApi $resourcePath ); } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -29970,42 +21088,40 @@ class FbsApi } /** - * Operation getFeed_1 + * Operation getCampaigns * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_1'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeed_1($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_1'][0]) + public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - list($response) = $this->getFeed_1WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); return $response; } /** - * Operation getFeed_1WithHttpInfo + * Operation getCampaignsWithHttpInfo * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_1'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeed_1WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_1'][0]) + public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $request = $this->getFeed_1Request($campaign_id, $feed_id, $contentType); + $request = $this->getCampaignsRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -30032,196 +21148,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30235,44 +21206,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedResponse', + '\OpenAPI\Client\Model\GetCampaignsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30280,7 +21228,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30288,7 +21236,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30296,7 +21244,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30304,7 +21252,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30312,7 +21260,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30320,28 +21268,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeed_1Async + * Operation getCampaignsAsync * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_1'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_1Async($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_1'][0]) + public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - return $this->getFeed_1AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -30350,22 +21299,21 @@ class FbsApi } /** - * Operation getFeed_1AsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * Информация о прайс-листе + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_1'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_1AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_1'][0]) + public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - $request = $this->getFeed_1Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; + $request = $this->getCampaignsRequest($page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30404,62 +21352,51 @@ class FbsApi } /** - * Create request for operation 'getFeed_1' + * Create request for operation 'getCampaigns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_1'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeed_1Request($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_1'][0]) + public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeed_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getFeed_1, must be bigger than or equal to 1.'); + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getCampaigns, must be smaller than or equal to 10000.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeed_1' - ); - } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}'; + $resourcePath = '/v2/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -30525,46 +21462,40 @@ class FbsApi } /** - * Operation getFeedbackAndCommentUpdates_2 + * Operation getCategoriesMaxSaleQuantum * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getFeedbackAndCommentUpdates_2($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_2'][0]) + public function getCategoriesMaxSaleQuantum($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - list($response) = $this->getFeedbackAndCommentUpdates_2WithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType); + list($response) = $this->getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, $contentType); return $response; } /** - * Operation getFeedbackAndCommentUpdates_2WithHttpInfo + * Operation getCategoriesMaxSaleQuantumWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getFeedbackAndCommentUpdates_2WithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_2'][0]) + public function getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $request = $this->getFeedbackAndCommentUpdates_2Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -30591,196 +21522,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedbackListResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30794,44 +21580,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedbackListResponse', + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30839,7 +21602,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30847,7 +21610,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30855,7 +21618,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30863,7 +21626,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30871,7 +21634,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30879,30 +21642,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedbackAndCommentUpdates_2Async + * Operation getCategoriesMaxSaleQuantumAsync * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getFeedbackAndCommentUpdates_2Async($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_2'][0]) + public function getCategoriesMaxSaleQuantumAsync($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - return $this->getFeedbackAndCommentUpdates_2AsyncWithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType) + return $this->getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) ->then( function ($response) { return $response[0]; @@ -30911,24 +21673,21 @@ class FbsApi } /** - * Operation getFeedbackAndCommentUpdates_2AsyncWithHttpInfo + * Operation getCategoriesMaxSaleQuantumAsyncWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getFeedbackAndCommentUpdates_2AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_2'][0]) + public function getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - $request = $this->getFeedbackAndCommentUpdates_2Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30967,79 +21726,35 @@ class FbsApi } /** - * Create request for operation 'getFeedbackAndCommentUpdates_2' + * Create request for operation 'getCategoriesMaxSaleQuantum' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getFeedbackAndCommentUpdates_2Request($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_2'][0]) + public function getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'get_categories_max_sale_quantum_request' is set + if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedbackAndCommentUpdates_2' + 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getFeedbackAndCommentUpdates_2, must be bigger than or equal to 1.'); - } - - - - $resourcePath = '/campaigns/{campaignId}/feedback/updates'; + $resourcePath = '/v2/categories/max-sale-quantum'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'from_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -31049,7 +21764,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_categories_max_sale_quantum_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + } else { + $httpBody = $get_categories_max_sale_quantum_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -31097,7 +21819,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31105,40 +21827,38 @@ class FbsApi } /** - * Operation getFeeds_1 + * Operation getCategoriesTree * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeeds_1($campaign_id, string $contentType = self::contentTypes['getFeeds_1'][0]) + public function getCategoriesTree($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - list($response) = $this->getFeeds_1WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getCategoriesTreeWithHttpInfo($get_categories_request, $contentType); return $response; } /** - * Operation getFeeds_1WithHttpInfo + * Operation getCategoriesTreeWithHttpInfo * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeeds_1WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_1'][0]) + public function getCategoriesTreeWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $request = $this->getFeeds_1Request($campaign_id, $contentType); + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -31165,196 +21885,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -31368,44 +21943,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedsResponse', + '\OpenAPI\Client\Model\GetCategoriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31413,7 +21965,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31421,7 +21973,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31429,7 +21981,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31437,7 +21989,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31445,7 +21997,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31453,27 +22005,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeeds_1Async + * Operation getCategoriesTreeAsync * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeeds_1Async($campaign_id, string $contentType = self::contentTypes['getFeeds_1'][0]) + public function getCategoriesTreeAsync($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - return $this->getFeeds_1AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getCategoriesTreeAsyncWithHttpInfo($get_categories_request, $contentType) ->then( function ($response) { return $response[0]; @@ -31482,21 +22035,20 @@ class FbsApi } /** - * Operation getFeeds_1AsyncWithHttpInfo + * Operation getCategoriesTreeAsyncWithHttpInfo * - * Список прайс-листов магазина + * Дерево категорий * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeeds_1AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_1'][0]) + public function getCategoriesTreeAsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - $request = $this->getFeeds_1Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31535,30 +22087,20 @@ class FbsApi } /** - * Create request for operation 'getFeeds_1' + * Create request for operation 'getCategoriesTree' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeeds_1Request($campaign_id, string $contentType = self::contentTypes['getFeeds_1'][0]) + public function getCategoriesTreeRequest($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeeds_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getFeeds_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/feeds'; + + $resourcePath = '/v2/categories/tree'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31567,14 +22109,6 @@ class FbsApi - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -31584,7 +22118,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_categories_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + } else { + $httpBody = $get_categories_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -31632,7 +22173,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31640,44 +22181,40 @@ class FbsApi } /** - * Operation getGoodsFeedbackComments_1 + * Operation getCategoryContentParameters * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_1'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbackComments_1($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_1'][0]) + public function getCategoryContentParameters($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - list($response) = $this->getGoodsFeedbackComments_1WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $business_id, $contentType); return $response; } /** - * Operation getGoodsFeedbackComments_1WithHttpInfo + * Operation getCategoryContentParametersWithHttpInfo * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_1'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbackComments_1WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_1'][0]) + public function getCategoryContentParametersWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $request = $this->getGoodsFeedbackComments_1Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -31704,196 +22241,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -31907,44 +22299,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31952,7 +22321,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31960,7 +22329,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31968,7 +22337,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31976,7 +22345,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31984,7 +22353,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31992,29 +22361,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbackComments_1Async + * Operation getCategoryContentParametersAsync * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_1'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_1Async($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_1'][0]) + public function getCategoryContentParametersAsync($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - return $this->getGoodsFeedbackComments_1AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) + return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -32023,23 +22392,21 @@ class FbsApi } /** - * Operation getGoodsFeedbackComments_1AsyncWithHttpInfo + * Operation getCategoryContentParametersAsyncWithHttpInfo * - * Получение комментариев к отзыву + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_1'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_1AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_1'][0]) + public function getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - $request = $this->getGoodsFeedbackComments_1Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32078,41 +22445,34 @@ class FbsApi } /** - * Create request for operation 'getGoodsFeedbackComments_1' + * Create request for operation 'getCategoryContentParameters' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_1'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbackComments_1Request($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_1'][0]) + public function getCategoryContentParametersRequest($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'category_id' is set + if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbackComments_1' + 'Missing the required parameter $category_id when calling getCategoryContentParameters' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getGoodsFeedbackComments_1, must be bigger than or equal to 1.'); + if ($category_id <= 0) { + throw new \InvalidArgumentException('invalid value for "$category_id" when calling FbsApi.getCategoryContentParameters, must be bigger than 0.'); } - // verify the required parameter 'get_goods_feedback_comments_request' is set - if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments_1' - ); + if ($business_id !== null && $business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getCategoryContentParameters, must be bigger than or equal to 1.'); } + - - - - $resourcePath = '/businesses/{businessId}/goods-feedback/comments'; + $resourcePath = '/v2/category/{categoryId}/parameters'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32121,17 +22481,8 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $business_id, + 'businessId', // param base name 'integer', // openApiType '', // style false, // explode @@ -32140,10 +22491,10 @@ class FbsApi // path params - if ($business_id !== null) { + if ($category_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'categoryId' . '}', + ObjectSerializer::toPathValue($category_id), $resourcePath ); } @@ -32156,14 +22507,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_goods_feedback_comments_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); - } else { - $httpBody = $get_goods_feedback_comments_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -32219,44 +22563,40 @@ class FbsApi } /** - * Operation getGoodsFeedbacks_1 + * Operation getChat * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbacks_1($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_1'][0]) + public function getChat($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - list($response) = $this->getGoodsFeedbacks_1WithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + list($response) = $this->getChatWithHttpInfo($business_id, $chat_id, $contentType); return $response; } /** - * Operation getGoodsFeedbacks_1WithHttpInfo + * Operation getChatWithHttpInfo * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbacks_1WithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_1'][0]) + public function getChatWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $request = $this->getGoodsFeedbacks_1Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $request = $this->getChatRequest($business_id, $chat_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -32283,196 +22623,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32486,44 +22681,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + '\OpenAPI\Client\Model\GetChatResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32531,7 +22703,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32539,7 +22711,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32547,7 +22719,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32555,7 +22727,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32563,7 +22735,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32571,29 +22743,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbacks_1Async + * Operation getChatAsync * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_1Async($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_1'][0]) + public function getChatAsync($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - return $this->getGoodsFeedbacks_1AsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) + return $this->getChatAsyncWithHttpInfo($business_id, $chat_id, $contentType) ->then( function ($response) { return $response[0]; @@ -32602,23 +22774,21 @@ class FbsApi } /** - * Operation getGoodsFeedbacks_1AsyncWithHttpInfo + * Operation getChatAsyncWithHttpInfo * - * Получение отзывов о товарах продавца + * Получение чата по идентификатору * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_1AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_1'][0]) + public function getChatAsyncWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - $request = $this->getGoodsFeedbacks_1Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatResponse'; + $request = $this->getChatRequest($business_id, $chat_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32657,35 +22827,40 @@ class FbsApi } /** - * Create request for operation 'getGoodsFeedbacks_1' + * Create request for operation 'getChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbacks_1Request($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_1'][0]) + public function getChatRequest($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbacks_1' + 'Missing the required parameter $business_id when calling getChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getGoodsFeedbacks_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.getChat, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/businesses/{businessId}/goods-feedback'; + $resourcePath = '/v2/businesses/{businessId}/chat'; $formParams = []; $queryParams = []; $headerParams = []; @@ -32694,21 +22869,12 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); @@ -32729,14 +22895,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_goods_feedback_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); - } else { - $httpBody = $get_goods_feedback_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -32784,7 +22943,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -32792,40 +22951,46 @@ class FbsApi } /** - * Operation getGoodsStats_1 + * Operation getChatHistory * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsStats_1($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_1'][0]) + public function getChatHistory($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - list($response) = $this->getGoodsStats_1WithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); + list($response) = $this->getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getGoodsStats_1WithHttpInfo + * Operation getChatHistoryWithHttpInfo * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsStats_1WithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_1'][0]) + public function getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $request = $this->getGoodsStats_1Request($campaign_id, $get_goods_stats_request, $contentType); + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -32852,196 +23017,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33055,44 +23075,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsStatsResponse', + '\OpenAPI\Client\Model\GetChatHistoryResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33100,7 +23097,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33108,7 +23105,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33116,7 +23113,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33124,7 +23121,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33132,7 +23129,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33140,27 +23137,32 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsStats_1Async + * Operation getChatHistoryAsync * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_1Async($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_1'][0]) + public function getChatHistoryAsync($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - return $this->getGoodsStats_1AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) + return $this->getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -33169,21 +23171,24 @@ class FbsApi } /** - * Operation getGoodsStats_1AsyncWithHttpInfo + * Operation getChatHistoryAsyncWithHttpInfo * - * Отчет по товарам + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_1AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_1'][0]) + public function getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - $request = $this->getGoodsStats_1Request($campaign_id, $get_goods_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33222,50 +23227,95 @@ class FbsApi } /** - * Create request for operation 'getGoodsStats_1' + * Create request for operation 'getChatHistory' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsStats_1Request($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_1'][0]) + public function getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getGoodsStats_1' + 'Missing the required parameter $business_id when calling getChatHistory' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getGoodsStats_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getChatHistory, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_goods_stats_request' is set - if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats_1' + 'Missing the required parameter $chat_id when calling getChatHistory' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.getChatHistory, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_chat_history_request' is set + if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chat_history_request when calling getChatHistory' ); } - $resourcePath = '/campaigns/{campaignId}/stats/skus'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getChatHistory, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/chats/history'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -33278,12 +23328,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_goods_stats_request)) { + if (isset($get_chat_history_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); } else { - $httpBody = $get_goods_stats_request; + $httpBody = $get_chat_history_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -33341,50 +23391,42 @@ class FbsApi } /** - * Operation getHiddenOffers_1 + * Operation getChatMessage * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getHiddenOffers_1($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_1'][0]) + public function getChatMessage($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - list($response) = $this->getHiddenOffers_1WithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + list($response) = $this->getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, $contentType); return $response; } /** - * Operation getHiddenOffers_1WithHttpInfo + * Operation getChatMessageWithHttpInfo * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getHiddenOffers_1WithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_1'][0]) + public function getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $request = $this->getHiddenOffers_1Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -33411,169 +23453,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetHiddenOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33587,44 +23511,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetHiddenOffersResponse', + '\OpenAPI\Client\Model\GetChatMessageResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33632,7 +23533,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33640,7 +23541,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33648,7 +23549,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33656,7 +23565,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33664,32 +23573,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getHiddenOffers_1Async + * Operation getChatMessageAsync * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_1Async($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_1'][0]) + public function getChatMessageAsync($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - return $this->getHiddenOffers_1AsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType) + return $this->getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, $contentType) ->then( function ($response) { return $response[0]; @@ -33698,26 +23605,22 @@ class FbsApi } /** - * Operation getHiddenOffers_1AsyncWithHttpInfo + * Operation getChatMessageAsyncWithHttpInfo * - * Информация о скрытых вами товарах + * Получение сообщения в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_1AsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_1'][0]) + public function getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - $request = $this->getHiddenOffers_1Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatMessageResponse'; + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33756,44 +23659,51 @@ class FbsApi } /** - * Create request for operation 'getHiddenOffers_1' + * Create request for operation 'getChatMessage' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getHiddenOffers_1Request($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_1'][0]) + public function getChatMessageRequest($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getHiddenOffers_1' + 'Missing the required parameter $business_id when calling getChatMessage' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getHiddenOffers_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getChatMessage, must be bigger than or equal to 1.'); } - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getHiddenOffers_1, must be smaller than or equal to 10000.'); + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatMessage' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'message_id' is set + if ($message_id === null || (is_array($message_id) && count($message_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $message_id when calling getChatMessage' + ); + } + if ($message_id < 1) { + throw new \InvalidArgumentException('invalid value for "$message_id" when calling FbsApi.getChatMessage, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -33802,65 +23712,29 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $message_id, + 'messageId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -33929,44 +23803,44 @@ class FbsApi } /** - * Operation getOfferCardsContentStatus_2 + * Operation getChats * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferCardsContentStatus_2($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_2'][0]) + public function getChats($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - list($response) = $this->getOfferCardsContentStatus_2WithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + list($response) = $this->getChatsWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferCardsContentStatus_2WithHttpInfo + * Operation getChatsWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferCardsContentStatus_2WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_2'][0]) + public function getChatsWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $request = $this->getOfferCardsContentStatus_2Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -33993,196 +23867,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -34196,44 +23925,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + '\OpenAPI\Client\Model\GetChatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34241,7 +23947,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34249,7 +23955,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34257,7 +23963,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34265,7 +23971,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34273,7 +23979,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34281,29 +23987,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferCardsContentStatus_2Async + * Operation getChatsAsync * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_2Async($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_2'][0]) + public function getChatsAsync($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - return $this->getOfferCardsContentStatus_2AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) + return $this->getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -34312,23 +24020,23 @@ class FbsApi } /** - * Operation getOfferCardsContentStatus_2AsyncWithHttpInfo + * Operation getChatsAsyncWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение доступных чатов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_2AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_2'][0]) + public function getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - $request = $this->getOfferCardsContentStatus_2Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34367,35 +24075,44 @@ class FbsApi } /** - * Create request for operation 'getOfferCardsContentStatus_2' + * Create request for operation 'getChats' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferCardsContentStatus_2Request($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_2'][0]) + public function getChatsRequest($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferCardsContentStatus_2' + 'Missing the required parameter $business_id when calling getChats' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getOfferCardsContentStatus_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getChats, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_chats_request' is set + if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chats_request when calling getChats' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getChats, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offer-cards'; + $resourcePath = '/v2/businesses/{businessId}/chats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34439,12 +24156,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_offer_cards_content_status_request)) { + if (isset($get_chats_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); } else { - $httpBody = $get_offer_cards_content_status_request; + $httpBody = $get_chats_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -34502,58 +24219,44 @@ class FbsApi } /** - * Operation getOfferMappingEntries_1 + * Operation getDefaultPrices * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappingEntries_1($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_1'][0]) + public function getDefaultPrices($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - list($response) = $this->getOfferMappingEntries_1WithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + list($response) = $this->getDefaultPricesWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $response; } /** - * Operation getOfferMappingEntries_1WithHttpInfo + * Operation getDefaultPricesWithHttpInfo * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappingEntries_1WithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_1'][0]) + public function getDefaultPricesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $request = $this->getOfferMappingEntries_1Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -34580,196 +24283,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -34783,44 +24341,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetDefaultPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34828,7 +24363,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34836,7 +24371,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34844,7 +24379,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34852,7 +24387,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34860,7 +24395,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34868,36 +24403,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappingEntries_1Async + * Operation getDefaultPricesAsync * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_1Async($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_1'][0]) + public function getDefaultPricesAsync($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - return $this->getOfferMappingEntries_1AsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) + return $this->getDefaultPricesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -34906,30 +24436,23 @@ class FbsApi } /** - * Operation getOfferMappingEntries_1AsyncWithHttpInfo + * Operation getDefaultPricesAsyncWithHttpInfo * - * Список товаров в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_1AsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_1'][0]) + public function getDefaultPricesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - $request = $this->getOfferMappingEntries_1Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDefaultPricesResponse'; + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34968,117 +24491,44 @@ class FbsApi } /** - * Create request for operation 'getOfferMappingEntries_1' + * Create request for operation 'getDefaultPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOfferMappingEntries_1Request($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_1'][0]) + public function getDefaultPricesRequest($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOfferMappingEntries_1' + 'Missing the required parameter $business_id when calling getDefaultPrices' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOfferMappingEntries_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getDefaultPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + - - - - - - - - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_sku, - 'shop_sku', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $mapping_kind, - 'mapping_kind', // param base name - 'OfferMappingKindType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $availability, - 'availability', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $category_id, - 'category_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $vendor, - 'vendor', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, @@ -35100,10 +24550,10 @@ class FbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -35116,7 +24566,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_default_prices_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_default_prices_request)); + } else { + $httpBody = $get_default_prices_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -35164,7 +24621,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -35172,44 +24629,36 @@ class FbsApi } /** - * Operation getOfferMappings_2 + * Operation getDeliveryServices * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappings_2($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_2'][0]) + public function getDeliveryServices(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - list($response) = $this->getOfferMappings_2WithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + list($response) = $this->getDeliveryServicesWithHttpInfo($contentType); return $response; } /** - * Operation getOfferMappings_2WithHttpInfo + * Operation getDeliveryServicesWithHttpInfo * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetDeliveryServicesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappings_2WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_2'][0]) + public function getDeliveryServicesWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - $request = $this->getOfferMappings_2Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $request = $this->getDeliveryServicesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -35236,196 +24685,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35439,44 +24743,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingsResponse', + '\OpenAPI\Client\Model\GetDeliveryServicesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35484,7 +24765,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35492,7 +24773,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35500,7 +24781,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35508,7 +24789,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35516,7 +24797,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35524,29 +24805,27 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappings_2Async + * Operation getDeliveryServicesAsync * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_2Async($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_2'][0]) + public function getDeliveryServicesAsync(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - return $this->getOfferMappings_2AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType) + return $this->getDeliveryServicesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -35555,23 +24834,19 @@ class FbsApi } /** - * Operation getOfferMappings_2AsyncWithHttpInfo + * Operation getDeliveryServicesAsyncWithHttpInfo * - * Информация о товарах в каталоге + * Справочник служб доставки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_2AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_2'][0]) + public function getDeliveryServicesAsyncWithHttpInfo(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - $request = $this->getOfferMappings_2Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDeliveryServicesResponse'; + $request = $this->getDeliveryServicesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35610,69 +24885,26 @@ class FbsApi } /** - * Create request for operation 'getOfferMappings_2' + * Create request for operation 'getDeliveryServices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDeliveryServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferMappings_2Request($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_2'][0]) + public function getDeliveryServicesRequest(string $contentType = self::contentTypes['getDeliveryServices'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferMappings_2' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getOfferMappings_2, must be bigger than or equal to 1.'); - } - - - - - $resourcePath = '/businesses/{businessId}/offer-mappings'; + $resourcePath = '/v2/delivery/services'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -35682,14 +24914,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_offer_mappings_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); - } else { - $httpBody = $get_offer_mappings_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -35737,7 +24962,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -35745,44 +24970,44 @@ class FbsApi } /** - * Operation getOfferRecommendations_2 + * Operation getGoodsFeedbackComments * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferRecommendations_2($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_2'][0]) + public function getGoodsFeedbackComments($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - list($response) = $this->getOfferRecommendations_2WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + list($response) = $this->getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferRecommendations_2WithHttpInfo + * Operation getGoodsFeedbackCommentsWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferRecommendations_2WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_2'][0]) + public function getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $request = $this->getOfferRecommendations_2Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -35809,196 +25034,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36012,44 +25092,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36057,7 +25114,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36065,7 +25122,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36073,7 +25130,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36081,7 +25138,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36089,7 +25146,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36097,29 +25154,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferRecommendations_2Async + * Operation getGoodsFeedbackCommentsAsync * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_2Async($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_2'][0]) + public function getGoodsFeedbackCommentsAsync($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - return $this->getOfferRecommendations_2AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) + return $this->getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -36128,23 +25187,23 @@ class FbsApi } /** - * Operation getOfferRecommendations_2AsyncWithHttpInfo + * Operation getGoodsFeedbackCommentsAsyncWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_2AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_2'][0]) + public function getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - $request = $this->getOfferRecommendations_2Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36183,41 +25242,44 @@ class FbsApi } /** - * Create request for operation 'getOfferRecommendations_2' + * Create request for operation 'getGoodsFeedbackComments' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferRecommendations_2Request($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_2'][0]) + public function getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferRecommendations_2' + 'Missing the required parameter $business_id when calling getGoodsFeedbackComments' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getOfferRecommendations_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_offer_recommendations_request' is set - if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { + // verify the required parameter 'get_goods_feedback_comments_request' is set + if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations_2' + 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offers/recommendations'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36261,12 +25323,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_offer_recommendations_request)) { + if (isset($get_goods_feedback_comments_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); } else { - $httpBody = $get_offer_recommendations_request; + $httpBody = $get_goods_feedback_comments_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -36324,54 +25386,44 @@ class FbsApi } /** - * Operation getOffers_1 + * Operation getGoodsFeedbacks * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOffers_1($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_1'][0]) + public function getGoodsFeedbacks($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - list($response) = $this->getOffers_1WithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + list($response) = $this->getGoodsFeedbacksWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $response; } /** - * Operation getOffers_1WithHttpInfo + * Operation getGoodsFeedbacksWithHttpInfo * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOffers_1WithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_1'][0]) + public function getGoodsFeedbacksWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $request = $this->getOffers_1Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -36398,196 +25450,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36601,44 +25508,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOffersResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36646,7 +25530,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36654,7 +25538,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36662,7 +25546,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36670,7 +25554,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36678,7 +25562,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36686,34 +25570,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOffers_1Async + * Operation getGoodsFeedbacksAsync * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_1Async($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_1'][0]) + public function getGoodsFeedbacksAsync($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - return $this->getOffers_1AsyncWithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType) + return $this->getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) ->then( function ($response) { return $response[0]; @@ -36722,28 +25603,23 @@ class FbsApi } /** - * Operation getOffers_1AsyncWithHttpInfo + * Operation getGoodsFeedbacksAsyncWithHttpInfo * - * Предложения магазина + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_1AsyncWithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_1'][0]) + public function getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - $request = $this->getOffers_1Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36782,47 +25658,38 @@ class FbsApi } /** - * Create request for operation 'getOffers_1' + * Create request for operation 'getGoodsFeedbacks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOffers_1Request($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_1'][0]) + public function getGoodsFeedbacksRequest($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOffers_1' + 'Missing the required parameter $business_id when calling getGoodsFeedbacks' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOffers_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getOffers_1, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36831,26 +25698,8 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_category_id, - 'shopCategoryId', // param base name + $page_token, + 'page_token', // param base name 'string', // openApiType '', // style false, // explode @@ -36858,35 +25707,8 @@ class FbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $matched, - 'matched', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -36895,10 +25717,10 @@ class FbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -36911,7 +25733,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); + } else { + $httpBody = $get_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -36959,7 +25788,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -36967,40 +25796,44 @@ class FbsApi } /** - * Operation getOrderBusinessBuyerInfo_0 + * Operation getGoodsQuestionAnswers * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessBuyerInfo_0($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_0'][0]) + public function getGoodsQuestionAnswers($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - list($response) = $this->getOrderBusinessBuyerInfo_0WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrderBusinessBuyerInfo_0WithHttpInfo + * Operation getGoodsQuestionAnswersWithHttpInfo * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessBuyerInfo_0WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_0'][0]) + public function getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $request = $this->getOrderBusinessBuyerInfo_0Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -37027,196 +25860,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -37230,44 +25918,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + '\OpenAPI\Client\Model\GetAnswersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37275,7 +25940,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37283,7 +25948,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37291,7 +25956,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37299,7 +25964,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37307,7 +25972,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37315,27 +25980,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessBuyerInfo_0Async + * Operation getGoodsQuestionAnswersAsync * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_0Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_0'][0]) + public function getGoodsQuestionAnswersAsync($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - return $this->getOrderBusinessBuyerInfo_0AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -37344,21 +26013,23 @@ class FbsApi } /** - * Operation getOrderBusinessBuyerInfo_0AsyncWithHttpInfo + * Operation getGoodsQuestionAnswersAsyncWithHttpInfo * - * Информация о покупателе — юридическом лице + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_0AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_0'][0]) + public function getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - $request = $this->getOrderBusinessBuyerInfo_0Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetAnswersResponse'; + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37397,58 +26068,75 @@ class FbsApi } /** - * Create request for operation 'getOrderBusinessBuyerInfo_0' + * Create request for operation 'getGoodsQuestionAnswers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessBuyerInfo_0Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_0'][0]) + public function getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo_0' + 'Missing the required parameter $business_id when calling getGoodsQuestionAnswers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderBusinessBuyerInfo_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_answers_request' is set + if ($get_answers_request === null || (is_array($get_answers_request) && count($get_answers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo_0' + 'Missing the required parameter $get_answers_request when calling getGoodsQuestionAnswers' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/goods-questions/answers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -37461,7 +26149,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_answers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_answers_request)); + } else { + $httpBody = $get_answers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -37517,40 +26212,44 @@ class FbsApi } /** - * Operation getOrderBusinessDocumentsInfo_0 + * Operation getGoodsQuestions * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessDocumentsInfo_0($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_0'][0]) + public function getGoodsQuestions($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - list($response) = $this->getOrderBusinessDocumentsInfo_0WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsQuestionsWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType); return $response; } /** - * Operation getOrderBusinessDocumentsInfo_0WithHttpInfo + * Operation getGoodsQuestionsWithHttpInfo * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessDocumentsInfo_0WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_0'][0]) + public function getGoodsQuestionsWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $request = $this->getOrderBusinessDocumentsInfo_0Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -37577,196 +26276,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -37780,44 +26334,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + '\OpenAPI\Client\Model\GetQuestionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37825,7 +26356,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37833,7 +26364,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37841,7 +26372,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37849,7 +26380,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37857,7 +26388,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37865,27 +26396,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessDocumentsInfo_0Async + * Operation getGoodsQuestionsAsync * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_0Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_0'][0]) + public function getGoodsQuestionsAsync($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - return $this->getOrderBusinessDocumentsInfo_0AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType) ->then( function ($response) { return $response[0]; @@ -37894,21 +26429,23 @@ class FbsApi } /** - * Operation getOrderBusinessDocumentsInfo_0AsyncWithHttpInfo + * Operation getGoodsQuestionsAsyncWithHttpInfo * - * Информация о документах + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_0AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_0'][0]) + public function getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - $request = $this->getOrderBusinessDocumentsInfo_0Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuestionsResponse'; + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37947,58 +26484,69 @@ class FbsApi } /** - * Create request for operation 'getOrderBusinessDocumentsInfo_0' + * Create request for operation 'getGoodsQuestions' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessDocumentsInfo_0Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_0'][0]) + public function getGoodsQuestionsRequest($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo_0' + 'Missing the required parameter $business_id when calling getGoodsQuestions' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderBusinessDocumentsInfo_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getGoodsQuestions, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo_0' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getGoodsQuestions, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/documents'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -38011,7 +26559,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_questions_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_questions_request)); + } else { + $httpBody = $get_questions_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -38067,40 +26622,40 @@ class FbsApi } /** - * Operation getOrderLabelsData_0 + * Operation getGoodsStats * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderLabelsData_0($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_0'][0]) + public function getGoodsStats($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - list($response) = $this->getOrderLabelsData_0WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); return $response; } /** - * Operation getOrderLabelsData_0WithHttpInfo + * Operation getGoodsStatsWithHttpInfo * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderLabelsData_0WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_0'][0]) + public function getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $request = $this->getOrderLabelsData_0Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -38127,196 +26682,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38330,44 +26740,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + '\OpenAPI\Client\Model\GetGoodsStatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38375,7 +26762,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38383,7 +26770,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38391,7 +26778,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38399,7 +26786,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38407,7 +26794,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38415,27 +26802,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderLabelsData_0Async + * Operation getGoodsStatsAsync * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderLabelsData_0Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_0'][0]) + public function getGoodsStatsAsync($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - return $this->getOrderLabelsData_0AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) ->then( function ($response) { return $response[0]; @@ -38444,21 +26833,21 @@ class FbsApi } /** - * Operation getOrderLabelsData_0AsyncWithHttpInfo + * Operation getGoodsStatsAsyncWithHttpInfo * - * Данные для самостоятельного изготовления ярлыков + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderLabelsData_0AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_0'][0]) + public function getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - $request = $this->getOrderLabelsData_0Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38497,37 +26886,37 @@ class FbsApi } /** - * Create request for operation 'getOrderLabelsData_0' + * Create request for operation 'getGoodsStats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderLabelsData_0Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData_0'][0]) + public function getGoodsStatsRequest($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderLabelsData_0' + 'Missing the required parameter $campaign_id when calling getGoodsStats' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderLabelsData_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getGoodsStats, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_goods_stats_request' is set + if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderLabelsData_0' + 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/skus'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38544,14 +26933,6 @@ class FbsApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -38561,7 +26942,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); + } else { + $httpBody = $get_goods_stats_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -38609,7 +26997,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38617,40 +27005,44 @@ class FbsApi } /** - * Operation getOrder_1 + * Operation getHiddenOffers * - * Информация об одном заказе + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrder_1($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_1'][0]) + public function getHiddenOffers($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - list($response) = $this->getOrder_1WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getHiddenOffersWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrder_1WithHttpInfo + * Operation getHiddenOffersWithHttpInfo * - * Информация об одном заказе + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrder_1WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_1'][0]) + public function getHiddenOffersWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $request = $this->getOrder_1Request($campaign_id, $order_id, $contentType); + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -38677,196 +27069,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38880,44 +27121,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderResponse', + '\OpenAPI\Client\Model\GetHiddenOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38925,7 +27143,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38933,7 +27151,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38941,15 +27159,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38957,7 +27167,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38965,27 +27175,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrder_1Async + * Operation getHiddenOffersAsync * - * Информация об одном заказе + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_1Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_1'][0]) + public function getHiddenOffersAsync($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - return $this->getOrder_1AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -38994,21 +27208,23 @@ class FbsApi } /** - * Operation getOrder_1AsyncWithHttpInfo + * Operation getHiddenOffersAsyncWithHttpInfo * - * Информация об одном заказе + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_1AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_1'][0]) + public function getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - $request = $this->getOrder_1Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39047,43 +27263,71 @@ class FbsApi } /** - * Create request for operation 'getOrder_1' + * Create request for operation 'getHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrder_1Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_1'][0]) + public function getHiddenOffersRequest($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrder_1' + 'Missing the required parameter $campaign_id when calling getHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrder_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getHiddenOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrder_1' - ); - } + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getHiddenOffers, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offer_id, + 'offer_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -39094,14 +27338,6 @@ class FbsApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -39167,44 +27403,44 @@ class FbsApi } /** - * Operation getOrdersStats_1 + * Operation getOfferCardsContentStatus * - * Детальная информация по заказам + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrdersStats_1($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_1'][0]) + public function getOfferCardsContentStatus($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - list($response) = $this->getOrdersStats_1WithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + list($response) = $this->getOfferCardsContentStatusWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); return $response; } /** - * Operation getOrdersStats_1WithHttpInfo + * Operation getOfferCardsContentStatusWithHttpInfo * - * Детальная информация по заказам + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrdersStats_1WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_1'][0]) + public function getOfferCardsContentStatusWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - $request = $this->getOrdersStats_1Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -39231,196 +27467,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39434,44 +27525,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersStatsResponse', + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39479,7 +27547,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39487,7 +27555,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39495,7 +27563,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39503,7 +27571,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39511,7 +27579,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39519,29 +27587,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrdersStats_1Async + * Operation getOfferCardsContentStatusAsync * - * Детальная информация по заказам + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrdersStats_1Async($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_1'][0]) + public function getOfferCardsContentStatusAsync($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - return $this->getOrdersStats_1AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + return $this->getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -39550,23 +27620,23 @@ class FbsApi } /** - * Operation getOrdersStats_1AsyncWithHttpInfo + * Operation getOfferCardsContentStatusAsyncWithHttpInfo * - * Детальная информация по заказам + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrdersStats_1AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_1'][0]) + public function getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - $request = $this->getOrdersStats_1Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39605,35 +27675,38 @@ class FbsApi } /** - * Create request for operation 'getOrdersStats_1' + * Create request for operation 'getOfferCardsContentStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrdersStats_1Request($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_1'][0]) + public function getOfferCardsContentStatusRequest($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrdersStats_1' + 'Missing the required parameter $business_id when calling getOfferCardsContentStatus' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrdersStats_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/stats/orders'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards'; $formParams = []; $queryParams = []; $headerParams = []; @@ -39661,10 +27734,10 @@ class FbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -39677,12 +27750,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_orders_stats_request)) { + if (isset($get_offer_cards_content_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); } else { - $httpBody = $get_orders_stats_request; + $httpBody = $get_offer_cards_content_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -39740,76 +27813,58 @@ class FbsApi } /** - * Operation getOrders_0 - * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_0'] to see the possible values for this operation + * Operation getOfferMappingEntries + * + * Список товаров в каталоге + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getOrders_0($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_0'][0]) + public function getOfferMappingEntries($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - list($response) = $this->getOrders_0WithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + list($response) = $this->getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrders_0WithHttpInfo - * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_0'] to see the possible values for this operation + * Operation getOfferMappingEntriesWithHttpInfo + * + * Список товаров в каталоге + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getOrders_0WithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_0'][0]) + public function getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - $request = $this->getOrders_0Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -39836,196 +27891,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40039,44 +27949,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersResponse', + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40084,7 +27971,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40092,7 +27979,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40100,7 +27987,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40108,7 +27995,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40116,7 +28003,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40124,45 +28011,38 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrders_0Async + * Operation getOfferMappingEntriesAsync * - * Информация о нескольких заказах + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrders_0Async($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_0'][0]) + public function getOfferMappingEntriesAsync($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - return $this->getOrders_0AsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + return $this->getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -40171,39 +28051,30 @@ class FbsApi } /** - * Operation getOrders_0AsyncWithHttpInfo + * Operation getOfferMappingEntriesAsyncWithHttpInfo * - * Информация о нескольких заказах + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrders_0AsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_0'][0]) + public function getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - $request = $this->getOrders_0Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40242,70 +28113,51 @@ class FbsApi } /** - * Create request for operation 'getOrders_0' + * Create request for operation 'getOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getOrders_0Request($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_0'][0]) + public function getOfferMappingEntriesRequest($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrders_0' + 'Missing the required parameter $campaign_id when calling getOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrders_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOfferMappingEntries, must be bigger than or equal to 1.'); } - + + + + - - - - - - - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getOrders_0, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getOfferMappingEntries, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/campaigns/{campaignId}/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries'; $formParams = []; $queryParams = []; $headerParams = []; @@ -40314,17 +28166,8 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name + $offer_id, + 'offer_id', // param base name 'array', // openApiType '', // style false, // explode @@ -40332,8 +28175,8 @@ class FbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $substatus, - 'substatus', // param base name + $shop_sku, + 'shop_sku', // param base name 'array', // openApiType '', // style false, // explode @@ -40341,126 +28184,45 @@ class FbsApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_from, - 'supplierShipmentDateFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_to, - 'supplierShipmentDateTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_from, - 'updatedAtFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_to, - 'updatedAtTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $dispatch_type, - 'dispatchType', // param base name - 'OrderDeliveryDispatchType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fake, - 'fake', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $has_cis, - 'hasCis', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_waiting_for_cancellation_approve, - 'onlyWaitingForCancellationApprove', // param base name - 'boolean', // openApiType + $mapping_kind, + 'mapping_kind', // param base name + 'OfferMappingKindType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_estimated_delivery, - 'onlyEstimatedDelivery', // param base name - 'boolean', // openApiType + $status, + 'status', // param base name + 'array', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $buyer_type, - 'buyerType', // param base name - 'OrderBuyerType', // openApiType + $availability, + 'availability', // param base name + 'array', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $category_id, + 'category_id', // param base name + 'array', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType + $vendor, + 'vendor', // param base name + 'array', // openApiType '', // style false, // explode false // required @@ -40558,44 +28320,46 @@ class FbsApi } /** - * Operation getPricesByOfferIds_1 + * Operation getOfferMappings * - * Просмотр цен на указанные товары в магазине + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPricesByOfferIds_1($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_1'][0]) + public function getOfferMappings($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - list($response) = $this->getPricesByOfferIds_1WithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $response; } /** - * Operation getPricesByOfferIds_1WithHttpInfo + * Operation getOfferMappingsWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPricesByOfferIds_1WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_1'][0]) + public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - $request = $this->getPricesByOfferIds_1Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -40622,196 +28386,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40825,44 +28444,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + '\OpenAPI\Client\Model\GetOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40870,7 +28466,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40878,7 +28474,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40886,7 +28482,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40894,7 +28490,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40902,7 +28498,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40910,29 +28506,32 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPricesByOfferIds_1Async + * Operation getOfferMappingsAsync * - * Просмотр цен на указанные товары в магазине + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPricesByOfferIds_1Async($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_1'][0]) + public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - return $this->getPricesByOfferIds_1AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -40941,23 +28540,24 @@ class FbsApi } /** - * Operation getPricesByOfferIds_1AsyncWithHttpInfo + * Operation getOfferMappingsAsyncWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Информация о товарах в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPricesByOfferIds_1AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_1'][0]) + public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - $request = $this->getPricesByOfferIds_1Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40996,35 +28596,40 @@ class FbsApi } /** - * Create request for operation 'getPricesByOfferIds_1' + * Create request for operation 'getOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPricesByOfferIds_1Request($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_1'][0]) + public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPricesByOfferIds_1' + 'Missing the required parameter $business_id when calling getOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getPricesByOfferIds_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getOfferMappings, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getOfferMappings, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41049,13 +28654,22 @@ class FbsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -41068,12 +28682,12 @@ class FbsApi ); // for model (json/xml) - if (isset($get_prices_by_offer_ids_request)) { + if (isset($get_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); } else { - $httpBody = $get_prices_by_offer_ids_request; + $httpBody = $get_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -41131,46 +28745,44 @@ class FbsApi } /** - * Operation getPrices_1 + * Operation getOfferRecommendations * - * Список цен + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPrices_1($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_1'][0]) + public function getOfferRecommendations($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - list($response) = $this->getPrices_1WithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + list($response) = $this->getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getPrices_1WithHttpInfo + * Operation getOfferRecommendationsWithHttpInfo * - * Список цен + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPrices_1WithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_1'][0]) + public function getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $request = $this->getPrices_1Request($campaign_id, $page_token, $limit, $archived, $contentType); + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -41197,196 +28809,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41400,44 +28867,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesResponse', + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41445,7 +28889,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41453,7 +28897,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41461,7 +28905,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41469,7 +28913,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41477,7 +28921,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41485,30 +28929,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPrices_1Async + * Operation getOfferRecommendationsAsync * - * Список цен + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPrices_1Async($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_1'][0]) + public function getOfferRecommendationsAsync($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - return $this->getPrices_1AsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + return $this->getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -41517,24 +28962,23 @@ class FbsApi } /** - * Operation getPrices_1AsyncWithHttpInfo + * Operation getOfferRecommendationsAsyncWithHttpInfo * - * Список цен + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPrices_1AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_1'][0]) + public function getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - $request = $this->getPrices_1Request($campaign_id, $page_token, $limit, $archived, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41573,36 +29017,44 @@ class FbsApi } /** - * Create request for operation 'getPrices_1' + * Create request for operation 'getOfferRecommendations' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getPrices_1Request($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_1'][0]) + public function getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPrices_1' + 'Missing the required parameter $business_id when calling getOfferRecommendations' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getPrices_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getOfferRecommendations, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_offer_recommendations_request' is set + if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getOfferRecommendations, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/businesses/{businessId}/offers/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41627,22 +29079,13 @@ class FbsApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $archived, - 'archived', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -41655,7 +29098,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_offer_recommendations_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + } else { + $httpBody = $get_offer_recommendations_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -41703,7 +29153,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -41711,44 +29161,42 @@ class FbsApi } /** - * Operation getPromoOffers_1 + * Operation getOrder * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getPromoOffers_1($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_1'][0]) + public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - list($response) = $this->getPromoOffers_1WithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getPromoOffers_1WithHttpInfo + * Operation getOrderWithHttpInfo * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getPromoOffers_1WithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_1'][0]) + public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $request = $this->getPromoOffers_1Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -41775,196 +29223,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41978,44 +29281,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPromoOffersResponse', + '\OpenAPI\Client\Model\GetOrderResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42023,7 +29303,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42031,7 +29311,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42039,7 +29319,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42047,7 +29327,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42055,7 +29335,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42063,29 +29343,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromoOffers_1Async + * Operation getOrderAsync * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getPromoOffers_1Async($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_1'][0]) + public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - return $this->getPromoOffers_1AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) + return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -42094,23 +29375,22 @@ class FbsApi } /** - * Operation getPromoOffers_1AsyncWithHttpInfo + * Operation getOrderAsyncWithHttpInfo * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getPromoOffers_1AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_1'][0]) + public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - $request = $this->getPromoOffers_1Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42149,72 +29429,59 @@ class FbsApi } /** - * Create request for operation 'getPromoOffers_1' + * Create request for operation 'getOrder' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getPromoOffers_1Request($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_1'][0]) + public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromoOffers_1' + 'Missing the required parameter $campaign_id when calling getOrder' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getPromoOffers_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrder, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_promo_offers_request' is set - if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers_1' + 'Missing the required parameter $order_id when calling getOrder' ); } - - - $resourcePath = '/businesses/{businessId}/promos/offers'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -42227,14 +29494,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_promo_offers_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promo_offers_request)); - } else { - $httpBody = $get_promo_offers_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -42282,7 +29542,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -42290,40 +29550,40 @@ class FbsApi } /** - * Operation getPromos_1 + * Operation getOrderBusinessBuyerInfo * - * Получение списка акций + * Информация о покупателе — юридическом лице * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromos_1($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_1'][0]) + public function getOrderBusinessBuyerInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - list($response) = $this->getPromos_1WithHttpInfo($business_id, $get_promos_request, $contentType); + list($response) = $this->getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getPromos_1WithHttpInfo + * Operation getOrderBusinessBuyerInfoWithHttpInfo * - * Получение списка акций + * Информация о покупателе — юридическом лице * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromos_1WithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_1'][0]) + public function getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - $request = $this->getPromos_1Request($business_id, $get_promos_request, $contentType); + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -42350,196 +29610,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromosResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromosResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromosResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -42553,44 +29668,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPromosResponse', + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42598,7 +29690,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42606,7 +29698,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42614,7 +29706,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42622,7 +29714,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42630,7 +29722,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42638,27 +29730,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromos_1Async + * Operation getOrderBusinessBuyerInfoAsync * - * Получение списка акций + * Информация о покупателе — юридическом лице * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_1Async($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_1'][0]) + public function getOrderBusinessBuyerInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - return $this->getPromos_1AsyncWithHttpInfo($business_id, $get_promos_request, $contentType) + return $this->getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -42667,21 +29761,21 @@ class FbsApi } /** - * Operation getPromos_1AsyncWithHttpInfo + * Operation getOrderBusinessBuyerInfoAsyncWithHttpInfo * - * Получение списка акций + * Информация о покупателе — юридическом лице * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_1AsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_1'][0]) + public function getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - $request = $this->getPromos_1Request($business_id, $get_promos_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42720,31 +29814,37 @@ class FbsApi } /** - * Create request for operation 'getPromos_1' + * Create request for operation 'getOrderBusinessBuyerInfo' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromos_1Request($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_1'][0]) + public function getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromos_1' + 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getPromos_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderBusinessBuyerInfo, must be bigger than or equal to 1.'); } + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo' + ); + } - $resourcePath = '/businesses/{businessId}/promos'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/business-buyer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42754,10 +29854,18 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -42770,14 +29878,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_promos_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promos_request)); - } else { - $httpBody = $get_promos_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -42833,38 +29934,40 @@ class FbsApi } /** - * Operation getQualityRatingDetails_0 + * Operation getOrderBusinessDocumentsInfo * - * Заказы, которые повлияли на индекс качества + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getQualityRatingDetails_0($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_0'][0]) + public function getOrderBusinessDocumentsInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - list($response) = $this->getQualityRatingDetails_0WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getQualityRatingDetails_0WithHttpInfo + * Operation getOrderBusinessDocumentsInfoWithHttpInfo * - * Заказы, которые повлияли на индекс качества + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getQualityRatingDetails_0WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_0'][0]) + public function getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - $request = $this->getQualityRatingDetails_0Request($campaign_id, $contentType); + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -42891,196 +29994,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43094,44 +30052,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43139,7 +30074,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43147,7 +30082,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43155,7 +30090,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43163,7 +30098,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43171,7 +30106,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43179,26 +30114,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatingDetails_0Async + * Operation getOrderBusinessDocumentsInfoAsync * - * Заказы, которые повлияли на индекс качества + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatingDetails_0Async($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_0'][0]) + public function getOrderBusinessDocumentsInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - return $this->getQualityRatingDetails_0AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -43207,20 +30145,21 @@ class FbsApi } /** - * Operation getQualityRatingDetails_0AsyncWithHttpInfo + * Operation getOrderBusinessDocumentsInfoAsyncWithHttpInfo * - * Заказы, которые повлияли на индекс качества + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatingDetails_0AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_0'][0]) + public function getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - $request = $this->getQualityRatingDetails_0Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43259,29 +30198,37 @@ class FbsApi } /** - * Create request for operation 'getQualityRatingDetails_0' + * Create request for operation 'getOrderBusinessDocumentsInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getQualityRatingDetails_0Request($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails_0'][0]) + public function getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getQualityRatingDetails_0' + 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getQualityRatingDetails_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderBusinessDocumentsInfo, must be bigger than or equal to 1.'); } + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo' + ); + } + - $resourcePath = '/campaigns/{campaignId}/ratings/quality/details'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/documents'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43298,6 +30245,14 @@ class FbsApi $resourcePath ); } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -43363,40 +30318,40 @@ class FbsApi } /** - * Operation getQualityRatings_1 + * Operation getOrderIdentifiersStatus * - * Индекс качества магазинов + * Статусы проверки кодов маркировки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getQualityRatings_1($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_1'][0]) + public function getOrderIdentifiersStatus($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) { - list($response) = $this->getQualityRatings_1WithHttpInfo($business_id, $get_quality_rating_request, $contentType); + list($response) = $this->getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getQualityRatings_1WithHttpInfo + * Operation getOrderIdentifiersStatusWithHttpInfo * - * Индекс качества магазинов + * Статусы проверки кодов маркировки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getQualityRatings_1WithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_1'][0]) + public function getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) { - $request = $this->getQualityRatings_1Request($business_id, $get_quality_rating_request, $contentType); + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -43423,196 +30378,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43626,44 +30436,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQualityRatingResponse', + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43671,7 +30458,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43679,7 +30466,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43687,7 +30474,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43695,7 +30482,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43703,7 +30490,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43711,27 +30498,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatings_1Async + * Operation getOrderIdentifiersStatusAsync * - * Индекс качества магазинов + * Статусы проверки кодов маркировки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatings_1Async($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_1'][0]) + public function getOrderIdentifiersStatusAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) { - return $this->getQualityRatings_1AsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) + return $this->getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -43740,21 +30529,21 @@ class FbsApi } /** - * Operation getQualityRatings_1AsyncWithHttpInfo + * Operation getOrderIdentifiersStatusAsyncWithHttpInfo * - * Индекс качества магазинов + * Статусы проверки кодов маркировки * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getQualityRatings_1AsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_1'][0]) + public function getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - $request = $this->getQualityRatings_1Request($business_id, $get_quality_rating_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse'; + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43793,37 +30582,37 @@ class FbsApi } /** - * Create request for operation 'getQualityRatings_1' + * Create request for operation 'getOrderIdentifiersStatus' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getQualityRatings_1Request($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_1'][0]) + public function getOrderIdentifiersStatusRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getQualityRatings_1' + 'Missing the required parameter $campaign_id when calling getOrderIdentifiersStatus' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getQualityRatings_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderIdentifiersStatus, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_quality_rating_request' is set - if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings_1' + 'Missing the required parameter $order_id when calling getOrderIdentifiersStatus' ); } - $resourcePath = '/businesses/{businessId}/ratings/quality'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43833,10 +30622,18 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -43849,14 +30646,7 @@ class FbsApi ); // for model (json/xml) - if (isset($get_quality_rating_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quality_rating_request)); - } else { - $httpBody = $get_quality_rating_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -43912,38 +30702,40 @@ class FbsApi } /** - * Operation getReportInfo_2 + * Operation getOrderLabelsData * - * Получение заданного отчета + * Данные для самостоятельного изготовления ярлыков * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReportInfo_2($report_id, string $contentType = self::contentTypes['getReportInfo_2'][0]) + public function getOrderLabelsData($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) { - list($response) = $this->getReportInfo_2WithHttpInfo($report_id, $contentType); + list($response) = $this->getOrderLabelsDataWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getReportInfo_2WithHttpInfo + * Operation getOrderLabelsDataWithHttpInfo * - * Получение заданного отчета + * Данные для самостоятельного изготовления ярлыков * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOrderLabelsDataResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReportInfo_2WithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_2'][0]) + public function getOrderLabelsDataWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) { - $request = $this->getReportInfo_2Request($report_id, $contentType); + $request = $this->getOrderLabelsDataRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -43970,196 +30762,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReportInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReportInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReportInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44173,44 +30820,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReportInfoResponse', + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44218,7 +30842,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44226,7 +30850,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44234,7 +30858,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44242,7 +30866,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44250,7 +30874,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44258,26 +30882,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReportInfo_2Async + * Operation getOrderLabelsDataAsync * - * Получение заданного отчета + * Данные для самостоятельного изготовления ярлыков * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_2Async($report_id, string $contentType = self::contentTypes['getReportInfo_2'][0]) + public function getOrderLabelsDataAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) { - return $this->getReportInfo_2AsyncWithHttpInfo($report_id, $contentType) + return $this->getOrderLabelsDataAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -44286,20 +30913,21 @@ class FbsApi } /** - * Operation getReportInfo_2AsyncWithHttpInfo + * Operation getOrderLabelsDataAsyncWithHttpInfo * - * Получение заданного отчета + * Данные для самостоятельного изготовления ярлыков * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_2AsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_2'][0]) + public function getOrderLabelsDataAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - $request = $this->getReportInfo_2Request($report_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; + $request = $this->getOrderLabelsDataRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44338,26 +30966,37 @@ class FbsApi } /** - * Create request for operation 'getReportInfo_2' + * Create request for operation 'getOrderLabelsData' * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReportInfo_2Request($report_id, string $contentType = self::contentTypes['getReportInfo_2'][0]) + public function getOrderLabelsDataRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderLabelsData'][0]) { - // verify the required parameter 'report_id' is set - if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $report_id when calling getReportInfo_2' + 'Missing the required parameter $campaign_id when calling getOrderLabelsData' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrderLabelsData, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderLabelsData' ); } - $resourcePath = '/reports/info/{reportId}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; $formParams = []; $queryParams = []; $headerParams = []; @@ -44367,10 +31006,18 @@ class FbsApi // path params - if ($report_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'reportId' . '}', - ObjectSerializer::toPathValue($report_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -44439,42 +31086,4204 @@ class FbsApi } /** - * Operation getReturnApplication_0 + * Operation getOrders * - * Получение заявления на возврат + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOrdersWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersAsync + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersAsyncWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrders' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrders' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrders, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbsApi.getOrders, number of items must be less than or equal to 50.'); + } + if ($order_ids !== null && count($order_ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbsApi.getOrders, number of items must be greater than or equal to 1.'); + } + + + + + + + + + + + + + + + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.getOrders, must be smaller than or equal to 10000.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $substatus, + 'substatus', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_from, + 'supplierShipmentDateFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_to, + 'supplierShipmentDateTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_from, + 'updatedAtFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_to, + 'updatedAtTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dispatch_type, + 'dispatchType', // param base name + 'OrderDeliveryDispatchType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fake, + 'fake', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_cis, + 'hasCis', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_waiting_for_cancellation_approve, + 'onlyWaitingForCancellationApprove', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_estimated_delivery, + 'onlyEstimatedDelivery', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_type, + 'buyerType', // param base name + 'OrderBuyerType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrdersStats + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrdersStats($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + list($response) = $this->getOrdersStatsWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + return $response; + } + + /** + * Operation getOrdersStatsWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrdersStatsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersStatsAsync + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsync($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + return $this->getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersStatsAsyncWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrdersStats' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrdersStatsRequest($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrdersStats' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getOrdersStats, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getOrdersStats, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/stats/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_orders_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); + } else { + $httpBody = $get_orders_stats_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPagedWarehouses + * + * Список складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPagedWarehouses($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + list($response) = $this->getPagedWarehousesWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); + return $response; + } + + /** + * Operation getPagedWarehousesWithHttpInfo + * + * Список складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPagedWarehousesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPagedWarehousesAsync + * + * Список складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPagedWarehousesAsync($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + return $this->getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPagedWarehousesAsyncWithHttpInfo + * + * Список складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPagedWarehousesResponse'; + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPagedWarehouses' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPagedWarehousesRequest($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getPagedWarehouses' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getPagedWarehouses, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getPagedWarehouses, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/businesses/{businessId}/warehouses'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_paged_warehouses_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_paged_warehouses_request)); + } else { + $httpBody = $get_paged_warehouses_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPrices + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getPrices($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + list($response) = $this->getPricesWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + return $response; + } + + /** + * Operation getPricesWithHttpInfo + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getPricesWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPricesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPricesAsync + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getPricesAsync($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + return $this->getPricesAsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricesAsyncWithHttpInfo + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getPricesAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPrices' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getPricesRequest($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getPrices' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getPrices, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getPrices, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $archived, + 'archived', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPricesByOfferIds + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + return $response; + } + + /** + * Operation getPricesByOfferIdsWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPricesByOfferIdsAsync + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricesByOfferIdsAsyncWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPricesByOfferIds' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_prices_by_offer_ids_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + } else { + $httpBody = $get_prices_by_offer_ids_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPromoOffers + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPromoOffers($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + list($response) = $this->getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getPromoOffersWithHttpInfo + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPromoOffersAsync + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromoOffersAsync($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + return $this->getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPromoOffersAsyncWithHttpInfo + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPromoOffers' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getPromoOffers' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getPromoOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_promo_offers_request' is set + if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getPromoOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/promos/offers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_promo_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promo_offers_request)); + } else { + $httpBody = $get_promo_offers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPromos + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPromos($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + list($response) = $this->getPromosWithHttpInfo($business_id, $get_promos_request, $contentType); + return $response; + } + + /** + * Operation getPromosWithHttpInfo + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPromosWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPromosResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPromosAsync + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromosAsync($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + return $this->getPromosAsyncWithHttpInfo($business_id, $get_promos_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPromosAsyncWithHttpInfo + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromosAsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPromos' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPromosRequest($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getPromos' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getPromos, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/businesses/{businessId}/promos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_promos_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promos_request)); + } else { + $httpBody = $get_promos_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getQualityRatingDetails + * + * Заказы, которые повлияли на индекс качества + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getQualityRatingDetails($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) + { + list($response) = $this->getQualityRatingDetailsWithHttpInfo($campaign_id, $contentType); + return $response; + } + + /** + * Operation getQualityRatingDetailsWithHttpInfo + * + * Заказы, которые повлияли на индекс качества + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetQualityRatingDetailsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getQualityRatingDetailsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) + { + $request = $this->getQualityRatingDetailsRequest($campaign_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getQualityRatingDetailsAsync + * + * Заказы, которые повлияли на индекс качества + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getQualityRatingDetailsAsync($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) + { + return $this->getQualityRatingDetailsAsyncWithHttpInfo($campaign_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getQualityRatingDetailsAsyncWithHttpInfo + * + * Заказы, которые повлияли на индекс качества + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getQualityRatingDetailsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; + $request = $this->getQualityRatingDetailsRequest($campaign_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getQualityRatingDetails' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getQualityRatingDetailsRequest($campaign_id, string $contentType = self::contentTypes['getQualityRatingDetails'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getQualityRatingDetails' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getQualityRatingDetails, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/ratings/quality/details'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getQualityRatings + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getQualityRatings($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + list($response) = $this->getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, $contentType); + return $response; + } + + /** + * Operation getQualityRatingsWithHttpInfo + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getQualityRatingsAsync + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getQualityRatingsAsync($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + return $this->getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getQualityRatingsAsyncWithHttpInfo + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getQualityRatings' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getQualityRatingsRequest($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getQualityRatings' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getQualityRatings, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quality_rating_request' is set + if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings' + ); + } + + + $resourcePath = '/v2/businesses/{businessId}/ratings/quality'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_quality_rating_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quality_rating_request)); + } else { + $httpBody = $get_quality_rating_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRegionsCodes + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getRegionsCodes(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + list($response) = $this->getRegionsCodesWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getRegionsCodesWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getRegionsCodesWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $request = $this->getRegionsCodesRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getRegionsCodesAsync + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsync(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + return $this->getRegionsCodesAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRegionsCodesAsyncWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsyncWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionsCodesResponse'; + $request = $this->getRegionsCodesRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRegionsCodes' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRegionsCodesRequest(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + + + $resourcePath = '/v2/regions/countries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnApplication_0($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_0'][0]) + public function getReportInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - list($response) = $this->getReturnApplication_0WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReportInfoWithHttpInfo($report_id, $contentType); return $response; } /** - * Operation getReturnApplication_0WithHttpInfo + * Operation getReportInfoWithHttpInfo * - * Получение заявления на возврат + * Получение заданного отчета или документа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_0'] to see the possible values for this operation + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnApplication_0WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_0'][0]) + public function getReportInfoWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) { - $request = $this->getReturnApplication_0Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReportInfoRequest($report_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -44501,196 +35310,422 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReportInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReportInfoAsync + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportInfoAsync($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + return $this->getReportInfoAsyncWithHttpInfo($report_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportInfoAsyncWithHttpInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportInfoAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; + $request = $this->getReportInfoRequest($report_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } + if ($returnType !== 'string') { + $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportInfo' + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportInfoRequest($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $report_id when calling getReportInfo' + ); + } + if (strlen($report_id) > 255) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling FbsApi.getReportInfo, must be smaller than or equal to 255.'); + } + if (strlen($report_id) < 1) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling FbsApi.getReportInfo, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/reports/info/{reportId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($report_id !== null) { + $resourcePath = str_replace( + '{' . 'reportId' . '}', + ObjectSerializer::toPathValue($report_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReturn + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно ÑÐ²ÑÐ·Ñ‹Ð²Ð°ÐµÑ‚ся с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReturn($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + list($response) = $this->getReturnWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + return $response; + } + + /** + * Operation getReturnWithHttpInfo + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReturnWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44704,44 +35739,21 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GetReturnResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44749,7 +35761,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44757,7 +35769,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44765,7 +35777,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44773,7 +35785,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44781,7 +35793,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44789,28 +35801,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnApplication_0Async + * Operation getReturnAsync * - * Получение заявления на возврат + * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnApplication_0Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_0'][0]) + public function getReturnAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - return $this->getReturnApplication_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) ->then( function ($response) { return $response[0]; @@ -44819,22 +35833,22 @@ class FbsApi } /** - * Operation getReturnApplication_0AsyncWithHttpInfo + * Operation getReturnAsyncWithHttpInfo * - * Получение заявления на возврат + * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnApplication_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_0'][0]) + public function getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { - $returnType = '\SplFileObject'; - $request = $this->getReturnApplication_0Request($campaign_id, $order_id, $return_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44873,45 +35887,45 @@ class FbsApi } /** - * Create request for operation 'getReturnApplication_0' + * Create request for operation 'getReturn' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnApplication_0Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication_0'][0]) + public function getReturnRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnApplication_0' + 'Missing the required parameter $campaign_id when calling getReturn' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturnApplication_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturn, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnApplication_0' + 'Missing the required parameter $order_id when calling getReturn' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnApplication_0' + 'Missing the required parameter $return_id when calling getReturn' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -44947,7 +35961,7 @@ class FbsApi $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream', 'application/json', ], + ['application/json', ], $contentType, $multipart ); @@ -45009,46 +36023,42 @@ class FbsApi } /** - * Operation getReturnPhoto_0 + * Operation getReturnApplication * - * Получение фотографии возврата + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnPhoto_0($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_0'][0]) + public function getReturnApplication($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - list($response) = $this->getReturnPhoto_0WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + list($response) = $this->getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); return $response; } /** - * Operation getReturnPhoto_0WithHttpInfo + * Operation getReturnApplicationWithHttpInfo * - * Получение фотографии возврата + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnPhoto_0WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_0'][0]) + public function getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - $request = $this->getReturnPhoto_0Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -45075,196 +36085,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45278,34 +36143,11 @@ class FbsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -45315,7 +36157,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45323,7 +36165,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45331,7 +36173,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45339,7 +36181,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45347,7 +36189,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45355,7 +36197,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45363,30 +36205,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnPhoto_0Async + * Operation getReturnApplicationAsync * - * Получение фотографии возврата + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_0Async($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_0'][0]) + public function getReturnApplicationAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { - return $this->getReturnPhoto_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) + return $this->getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) ->then( function ($response) { return $response[0]; @@ -45395,24 +36237,22 @@ class FbsApi } /** - * Operation getReturnPhoto_0AsyncWithHttpInfo + * Operation getReturnApplicationAsyncWithHttpInfo * - * Получение фотографии возврата + * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_0'][0]) + public function getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { $returnType = '\SplFileObject'; - $request = $this->getReturnPhoto_0Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45451,61 +36291,45 @@ class FbsApi } /** - * Create request for operation 'getReturnPhoto_0' + * Create request for operation 'getReturnApplication' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnPhoto_0Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_0'][0]) + public function getReturnApplicationRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnPhoto_0' + 'Missing the required parameter $campaign_id when calling getReturnApplication' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturnPhoto_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturnApplication, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnPhoto_0' + 'Missing the required parameter $order_id when calling getReturnApplication' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnPhoto_0' + 'Missing the required parameter $return_id when calling getReturnApplication' ); } - // verify the required parameter 'item_id' is set - if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $item_id when calling getReturnPhoto_0' - ); - } - - // verify the required parameter 'image_hash' is set - if ($image_hash === null || (is_array($image_hash) && count($image_hash) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $image_hash when calling getReturnPhoto_0' - ); - } - - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45538,22 +36362,6 @@ class FbsApi $resourcePath ); } - // path params - if ($item_id !== null) { - $resourcePath = str_replace( - '{' . 'itemId' . '}', - ObjectSerializer::toPathValue($item_id), - $resourcePath - ); - } - // path params - if ($image_hash !== null) { - $resourcePath = str_replace( - '{' . 'imageHash' . '}', - ObjectSerializer::toPathValue($image_hash), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -45619,42 +36427,46 @@ class FbsApi } /** - * Operation getReturn_0 + * Operation getReturnPhoto * - * Информация о невыкупе или возврате + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturn_0($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_0'][0]) + public function getReturnPhoto($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - list($response) = $this->getReturn_0WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); return $response; } /** - * Operation getReturn_0WithHttpInfo + * Operation getReturnPhotoWithHttpInfo * - * Информация о невыкупе или возврате + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturn_0WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_0'][0]) + public function getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - $request = $this->getReturn_0Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); try { $options = $this->createHttpClientOption(); @@ -45681,196 +36493,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45884,44 +36551,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45929,7 +36573,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45937,7 +36581,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45945,7 +36589,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45953,7 +36597,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45961,7 +36605,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45969,28 +36613,32 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturn_0Async + * Operation getReturnPhotoAsync * - * Информация о невыкупе или возврате + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_0Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_0'][0]) + public function getReturnPhotoAsync($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - return $this->getReturn_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) ->then( function ($response) { return $response[0]; @@ -45999,22 +36647,24 @@ class FbsApi } /** - * Operation getReturn_0AsyncWithHttpInfo + * Operation getReturnPhotoAsyncWithHttpInfo * - * Информация о невыкупе или возврате + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_0AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_0'][0]) + public function getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - $request = $this->getReturn_0Request($campaign_id, $order_id, $return_id, $contentType); + $returnType = '\SplFileObject'; + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46053,45 +36703,61 @@ class FbsApi } /** - * Create request for operation 'getReturn_0' + * Create request for operation 'getReturnPhoto' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturn_0Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_0'][0]) + public function getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturn_0' + 'Missing the required parameter $campaign_id when calling getReturnPhoto' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturn_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturnPhoto, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturn_0' + 'Missing the required parameter $order_id when calling getReturnPhoto' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturn_0' + 'Missing the required parameter $return_id when calling getReturnPhoto' ); } + // verify the required parameter 'item_id' is set + if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $item_id when calling getReturnPhoto' + ); + } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + // verify the required parameter 'image_hash' is set + if ($image_hash === null || (is_array($image_hash) && count($image_hash) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $image_hash when calling getReturnPhoto' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -46124,10 +36790,26 @@ class FbsApi $resourcePath ); } + // path params + if ($item_id !== null) { + $resourcePath = str_replace( + '{' . 'itemId' . '}', + ObjectSerializer::toPathValue($item_id), + $resourcePath + ); + } + // path params + if ($image_hash !== null) { + $resourcePath = str_replace( + '{' . 'imageHash' . '}', + ObjectSerializer::toPathValue($image_hash), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/octet-stream', 'application/json', ], $contentType, $multipart ); @@ -46189,56 +36871,58 @@ class FbsApi } /** - * Operation getReturns_0 + * Operation getReturns * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturns_0($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_0'][0]) + public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - list($response) = $this->getReturns_0WithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $response; } /** - * Operation getReturns_0WithHttpInfo + * Operation getReturnsWithHttpInfo * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturns_0WithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_0'][0]) + public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $request = $this->getReturns_0Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); try { $options = $this->createHttpClientOption(); @@ -46265,196 +36949,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -46468,34 +37007,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -46505,7 +37021,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46513,7 +37029,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46521,7 +37037,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46529,7 +37045,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46537,7 +37053,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46545,7 +37061,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46553,35 +37069,38 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturns_0Async + * Operation getReturnsAsync * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturns_0Async($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_0'][0]) + public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - return $this->getReturns_0AsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) ->then( function ($response) { return $response[0]; @@ -46590,29 +37109,30 @@ class FbsApi } /** - * Operation getReturns_0AsyncWithHttpInfo + * Operation getReturnsAsyncWithHttpInfo * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturns_0AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_0'][0]) + public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - $request = $this->getReturns_0Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46651,50 +37171,55 @@ class FbsApi } /** - * Create request for operation 'getReturns_0' + * Create request for operation 'getReturns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturns_0Request($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_0'][0]) + public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturns_0' + 'Missing the required parameter $campaign_id when calling getReturns' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturns_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getReturns, must be bigger than or equal to 1.'); } - + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getReturns, must be bigger than or equal to 1.'); + } + if ($order_ids !== null && count($order_ids) > 50) { - throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbsApi.getReturns_0, number of items must be less than or equal to 50.'); + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbsApi.getReturns, number of items must be less than or equal to 50.'); } + - $resourcePath = '/campaigns/{campaignId}/returns'; + $resourcePath = '/v2/campaigns/{campaignId}/returns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -46738,6 +37263,15 @@ class FbsApi false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shipment_statuses, + 'shipmentStatuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $type, 'type', // param base name @@ -46857,40 +37391,42 @@ class FbsApi } /** - * Operation getShipmentOrdersInfo_0 + * Operation getShipment * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo_0'] to see the possible values for this operation + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetShipmentOrdersInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetShipmentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getShipmentOrdersInfo_0($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo_0'][0]) + public function getShipment($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment'][0]) { - list($response) = $this->getShipmentOrdersInfo_0WithHttpInfo($campaign_id, $shipment_id, $contentType); + list($response) = $this->getShipmentWithHttpInfo($campaign_id, $shipment_id, $cancelled_orders, $contentType); return $response; } /** - * Operation getShipmentOrdersInfo_0WithHttpInfo + * Operation getShipmentWithHttpInfo * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo_0'] to see the possible values for this operation + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetShipmentOrdersInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetShipmentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getShipmentOrdersInfo_0WithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo_0'][0]) + public function getShipmentWithHttpInfo($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment'][0]) { - $request = $this->getShipmentOrdersInfo_0Request($campaign_id, $shipment_id, $contentType); + $request = $this->getShipmentRequest($campaign_id, $shipment_id, $cancelled_orders, $contentType); try { $options = $this->createHttpClientOption(); @@ -46917,196 +37453,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47120,44 +37511,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', + '\OpenAPI\Client\Model\GetShipmentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47165,7 +37533,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47173,7 +37541,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47181,7 +37549,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47189,7 +37557,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47197,7 +37565,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47205,27 +37573,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getShipmentOrdersInfo_0Async + * Operation getShipmentAsync * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo_0'] to see the possible values for this operation + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getShipmentOrdersInfo_0Async($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo_0'][0]) + public function getShipmentAsync($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment'][0]) { - return $this->getShipmentOrdersInfo_0AsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) + return $this->getShipmentAsyncWithHttpInfo($campaign_id, $shipment_id, $cancelled_orders, $contentType) ->then( function ($response) { return $response[0]; @@ -47234,21 +37605,22 @@ class FbsApi } /** - * Operation getShipmentOrdersInfo_0AsyncWithHttpInfo + * Operation getShipmentAsyncWithHttpInfo * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo_0'] to see the possible values for this operation + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getShipmentOrdersInfo_0AsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo_0'][0]) + public function getShipmentAsyncWithHttpInfo($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment'][0]) { - $returnType = '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse'; - $request = $this->getShipmentOrdersInfo_0Request($campaign_id, $shipment_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetShipmentResponse'; + $request = $this->getShipmentRequest($campaign_id, $shipment_id, $cancelled_orders, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47287,46 +37659,57 @@ class FbsApi } /** - * Create request for operation 'getShipmentOrdersInfo_0' + * Create request for operation 'getShipment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo_0'] to see the possible values for this operation + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getShipmentOrdersInfo_0Request($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo_0'][0]) + public function getShipmentRequest($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getShipmentOrdersInfo_0' + 'Missing the required parameter $campaign_id when calling getShipment' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getShipmentOrdersInfo_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getShipment, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling getShipmentOrdersInfo_0' + 'Missing the required parameter $shipment_id when calling getShipment' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.getShipmentOrdersInfo_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.getShipment, must be bigger than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/info'; + + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cancelled_orders, + 'cancelledOrders', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -47410,42 +37793,40 @@ class FbsApi } /** - * Operation getShipment_0 + * Operation getShipmentOrdersInfo * - * Получение информации об одной отгрузке + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetShipmentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetShipmentOrdersInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getShipment_0($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment_0'][0]) + public function getShipmentOrdersInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo'][0]) { - list($response) = $this->getShipment_0WithHttpInfo($campaign_id, $shipment_id, $cancelled_orders, $contentType); + list($response) = $this->getShipmentOrdersInfoWithHttpInfo($campaign_id, $shipment_id, $contentType); return $response; } /** - * Operation getShipment_0WithHttpInfo + * Operation getShipmentOrdersInfoWithHttpInfo * - * Получение информации об одной отгрузке + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetShipmentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetShipmentOrdersInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getShipment_0WithHttpInfo($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment_0'][0]) + public function getShipmentOrdersInfoWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo'][0]) { - $request = $this->getShipment_0Request($campaign_id, $shipment_id, $cancelled_orders, $contentType); + $request = $this->getShipmentOrdersInfoRequest($campaign_id, $shipment_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -47472,196 +37853,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetShipmentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetShipmentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetShipmentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47675,44 +37911,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetShipmentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetShipmentResponse', + '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47720,7 +37933,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47728,7 +37941,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47736,7 +37949,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47744,7 +37957,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47752,7 +37965,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47760,28 +37973,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getShipment_0Async + * Operation getShipmentOrdersInfoAsync * - * Получение информации об одной отгрузке + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getShipment_0Async($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment_0'][0]) + public function getShipmentOrdersInfoAsync($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo'][0]) { - return $this->getShipment_0AsyncWithHttpInfo($campaign_id, $shipment_id, $cancelled_orders, $contentType) + return $this->getShipmentOrdersInfoAsyncWithHttpInfo($campaign_id, $shipment_id, $contentType) ->then( function ($response) { return $response[0]; @@ -47790,22 +38004,21 @@ class FbsApi } /** - * Operation getShipment_0AsyncWithHttpInfo + * Operation getShipmentOrdersInfoAsyncWithHttpInfo * - * Получение информации об одной отгрузке + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getShipment_0AsyncWithHttpInfo($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment_0'][0]) + public function getShipmentOrdersInfoAsyncWithHttpInfo($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetShipmentResponse'; - $request = $this->getShipment_0Request($campaign_id, $shipment_id, $cancelled_orders, $contentType); + $returnType = '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse'; + $request = $this->getShipmentOrdersInfoRequest($campaign_id, $shipment_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47844,57 +38057,46 @@ class FbsApi } /** - * Create request for operation 'getShipment_0' + * Create request for operation 'getShipmentOrdersInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getShipment_0Request($campaign_id, $shipment_id, $cancelled_orders = true, string $contentType = self::contentTypes['getShipment_0'][0]) + public function getShipmentOrdersInfoRequest($campaign_id, $shipment_id, string $contentType = self::contentTypes['getShipmentOrdersInfo'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getShipment_0' + 'Missing the required parameter $campaign_id when calling getShipmentOrdersInfo' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getShipment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getShipmentOrdersInfo, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling getShipment_0' + 'Missing the required parameter $shipment_id when calling getShipmentOrdersInfo' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.getShipment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.getShipmentOrdersInfo, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/info'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $cancelled_orders, - 'cancelledOrders', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -47978,44 +38180,44 @@ class FbsApi } /** - * Operation getStocks_1 + * Operation getStocks * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getStocks_1($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_1'][0]) + public function getStocks($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - list($response) = $this->getStocks_1WithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + list($response) = $this->getStocksWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $response; } /** - * Operation getStocks_1WithHttpInfo + * Operation getStocksWithHttpInfo * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getStocks_1WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_1'][0]) + public function getStocksWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - $request = $this->getStocks_1Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -48042,169 +38244,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehouseStocksResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48218,34 +38296,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -48255,7 +38310,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48263,7 +38318,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48271,7 +38326,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48279,7 +38334,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48287,7 +38342,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48295,29 +38350,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getStocks_1Async + * Operation getStocksAsync * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStocks_1Async($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_1'][0]) + public function getStocksAsync($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - return $this->getStocks_1AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) + return $this->getStocksAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -48326,23 +38383,23 @@ class FbsApi } /** - * Operation getStocks_1AsyncWithHttpInfo + * Operation getStocksAsyncWithHttpInfo * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getStocks_1AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_1'][0]) + public function getStocksAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - $request = $this->getStocks_1Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48381,35 +38438,38 @@ class FbsApi } /** - * Create request for operation 'getStocks_1' + * Create request for operation 'getStocks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getStocks_1Request($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_1'][0]) + public function getStocksRequest($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getStocks_1' + 'Missing the required parameter $campaign_id when calling getStocks' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getStocks_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getStocks, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.getStocks, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -48516,42 +38576,42 @@ class FbsApi } /** - * Operation getSuggestedOfferMappingEntries_1 + * Operation getSuggestedOfferMappingEntries * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getSuggestedOfferMappingEntries_1($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_1'][0]) + public function getSuggestedOfferMappingEntries($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - list($response) = $this->getSuggestedOfferMappingEntries_1WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + list($response) = $this->getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $response; } /** - * Operation getSuggestedOfferMappingEntries_1WithHttpInfo + * Operation getSuggestedOfferMappingEntriesWithHttpInfo * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getSuggestedOfferMappingEntries_1WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_1'][0]) + public function getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $request = $this->getSuggestedOfferMappingEntries_1Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -48578,196 +38638,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48781,34 +38696,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -48818,7 +38710,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48826,7 +38718,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48834,7 +38726,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48842,7 +38734,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48850,7 +38742,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48858,7 +38750,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48866,28 +38758,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappingEntries_1Async + * Operation getSuggestedOfferMappingEntriesAsync * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedOfferMappingEntries_1Async($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_1'][0]) + public function getSuggestedOfferMappingEntriesAsync($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - return $this->getSuggestedOfferMappingEntries_1AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) + return $this->getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) ->then( function ($response) { return $response[0]; @@ -48896,22 +38790,22 @@ class FbsApi } /** - * Operation getSuggestedOfferMappingEntries_1AsyncWithHttpInfo + * Operation getSuggestedOfferMappingEntriesAsyncWithHttpInfo * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedOfferMappingEntries_1AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_1'][0]) + public function getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - $request = $this->getSuggestedOfferMappingEntries_1Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48950,38 +38844,38 @@ class FbsApi } /** - * Create request for operation 'getSuggestedOfferMappingEntries_1' + * Create request for operation 'getSuggestedOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getSuggestedOfferMappingEntries_1Request($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_1'][0]) + public function getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries_1' + 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getSuggestedOfferMappingEntries_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getSuggestedOfferMappingEntries, must be bigger than or equal to 1.'); } // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries_1' + 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries' ); } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -49070,40 +38964,42 @@ class FbsApi } /** - * Operation getSuggestedOfferMappings_2 + * Operation getSuggestedOfferMappings * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getSuggestedOfferMappings_2($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_2'][0]) + public function getSuggestedOfferMappings($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - list($response) = $this->getSuggestedOfferMappings_2WithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); + list($response) = $this->getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); return $response; } /** - * Operation getSuggestedOfferMappings_2WithHttpInfo + * Operation getSuggestedOfferMappingsWithHttpInfo * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getSuggestedOfferMappings_2WithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_2'][0]) + public function getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $request = $this->getSuggestedOfferMappings_2Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -49130,196 +39026,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49333,34 +39084,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -49370,7 +39098,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49378,7 +39106,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49386,7 +39114,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49394,7 +39122,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49402,7 +39130,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49410,7 +39138,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49418,27 +39146,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappings_2Async + * Operation getSuggestedOfferMappingsAsync * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getSuggestedOfferMappings_2Async($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_2'][0]) + public function getSuggestedOfferMappingsAsync($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - return $this->getSuggestedOfferMappings_2AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) + return $this->getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -49447,21 +39178,22 @@ class FbsApi } /** - * Operation getSuggestedOfferMappings_2AsyncWithHttpInfo + * Operation getSuggestedOfferMappingsAsyncWithHttpInfo * * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getSuggestedOfferMappings_2AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_2'][0]) + public function getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - $request = $this->getSuggestedOfferMappings_2Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49500,31 +39232,32 @@ class FbsApi } /** - * Create request for operation 'getSuggestedOfferMappings_2' + * Create request for operation 'getSuggestedOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getSuggestedOfferMappings_2Request($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_2'][0]) + public function getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getSuggestedOfferMappings_2' + 'Missing the required parameter $business_id when calling getSuggestedOfferMappings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getSuggestedOfferMappings_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getSuggestedOfferMappings, must be bigger than or equal to 1.'); } - $resourcePath = '/businesses/{businessId}/offer-mappings/suggestions'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -49613,42 +39346,40 @@ class FbsApi } /** - * Operation getSuggestedPrices_1 + * Operation getWarehouses * - * Цены для продвижения товаров + * Список складов и групп складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getSuggestedPrices_1($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_1'][0]) + public function getWarehouses($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - list($response) = $this->getSuggestedPrices_1WithHttpInfo($campaign_id, $suggest_prices_request, $contentType); + list($response) = $this->getWarehousesWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getSuggestedPrices_1WithHttpInfo + * Operation getWarehousesWithHttpInfo * - * Цены для продвижения товаров + * Список складов и групп складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getSuggestedPrices_1WithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_1'][0]) + public function getWarehousesWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - $request = $this->getSuggestedPrices_1Request($campaign_id, $suggest_prices_request, $contentType); + $request = $this->getWarehousesRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -49675,196 +39406,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SuggestPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SuggestPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuggestPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49878,44 +39464,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SuggestPricesResponse', + '\OpenAPI\Client\Model\GetWarehousesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49923,7 +39486,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49931,7 +39494,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49939,7 +39502,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49947,7 +39510,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49955,7 +39518,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49963,28 +39526,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedPrices_1Async + * Operation getWarehousesAsync * - * Цены для продвижения товаров + * Список складов и групп складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedPrices_1Async($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_1'][0]) + public function getWarehousesAsync($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - return $this->getSuggestedPrices_1AsyncWithHttpInfo($campaign_id, $suggest_prices_request, $contentType) + return $this->getWarehousesAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -49993,22 +39557,21 @@ class FbsApi } /** - * Operation getSuggestedPrices_1AsyncWithHttpInfo + * Operation getWarehousesAsyncWithHttpInfo * - * Цены для продвижения товаров + * Список складов и групп складов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getSuggestedPrices_1AsyncWithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_1'][0]) + public function getWarehousesAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - $request = $this->getSuggestedPrices_1Request($campaign_id, $suggest_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; + $request = $this->getWarehousesRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -50047,38 +39610,30 @@ class FbsApi } /** - * Create request for operation 'getSuggestedPrices_1' + * Create request for operation 'getWarehouses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getSuggestedPrices_1Request($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_1'][0]) + public function getWarehousesRequest($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedPrices_1' + 'Missing the required parameter $business_id when calling getWarehouses' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.getSuggestedPrices_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getWarehouses, must be bigger than or equal to 1.'); } - // verify the required parameter 'suggest_prices_request' is set - if ($suggest_prices_request === null || (is_array($suggest_prices_request) && count($suggest_prices_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $suggest_prices_request when calling getSuggestedPrices_1' - ); - } - - $resourcePath = '/campaigns/{campaignId}/offer-prices/suggestions'; + $resourcePath = '/v2/businesses/{businessId}/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50088,10 +39643,10 @@ class FbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -50104,14 +39659,7 @@ class FbsApi ); // for model (json/xml) - if (isset($suggest_prices_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($suggest_prices_request)); - } else { - $httpBody = $suggest_prices_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -50159,7 +39707,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -50167,38 +39715,42 @@ class FbsApi } /** - * Operation getWarehouses_0 + * Operation provideOrderItemIdentifiers * - * Список складов и групп складов + * Передача кодов маркировки единиц товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getWarehouses_0($business_id, string $contentType = self::contentTypes['getWarehouses_0'][0]) + public function provideOrderItemIdentifiers($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - list($response) = $this->getWarehouses_0WithHttpInfo($business_id, $contentType); + list($response) = $this->provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $response; } /** - * Operation getWarehouses_0WithHttpInfo + * Operation provideOrderItemIdentifiersWithHttpInfo * - * Список складов и групп складов + * Передача кодов маркировки единиц товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getWarehouses_0WithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses_0'][0]) + public function provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $request = $this->getWarehouses_0Request($business_id, $contentType); + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -50225,196 +39777,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehousesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehousesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehousesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50428,44 +39835,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetWarehousesResponse', + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50473,7 +39857,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50481,7 +39865,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50489,7 +39873,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50497,7 +39881,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50505,7 +39889,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50513,26 +39897,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getWarehouses_0Async + * Operation provideOrderItemIdentifiersAsync * - * Список складов и групп складов + * Передача кодов маркировки единиц товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWarehouses_0Async($business_id, string $contentType = self::contentTypes['getWarehouses_0'][0]) + public function provideOrderItemIdentifiersAsync($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - return $this->getWarehouses_0AsyncWithHttpInfo($business_id, $contentType) + return $this->provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -50541,20 +39929,22 @@ class FbsApi } /** - * Operation getWarehouses_0AsyncWithHttpInfo + * Operation provideOrderItemIdentifiersAsyncWithHttpInfo * - * Список складов и групп складов + * Передача кодов маркировки единиц товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWarehouses_0AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses_0'][0]) + public function provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - $request = $this->getWarehouses_0Request($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -50593,29 +39983,45 @@ class FbsApi } /** - * Create request for operation 'getWarehouses_0' + * Create request for operation 'provideOrderItemIdentifiers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getWarehouses_0Request($business_id, string $contentType = self::contentTypes['getWarehouses_0'][0]) + public function provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getWarehouses_0' + 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.getWarehouses_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.provideOrderItemIdentifiers, must be bigger than or equal to 1.'); } + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers' + ); + } - $resourcePath = '/businesses/{businessId}/warehouses'; + // verify the required parameter 'provide_order_item_identifiers_request' is set + if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50625,10 +40031,18 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -50641,7 +40055,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($provide_order_item_identifiers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_item_identifiers_request)); + } else { + $httpBody = $provide_order_item_identifiers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -50689,7 +40110,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -50697,42 +40118,40 @@ class FbsApi } /** - * Operation provideOrderItemIdentifiers_0 + * Operation putBidsForBusiness * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function provideOrderItemIdentifiers_0($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_0'][0]) + public function putBidsForBusiness($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - list($response) = $this->provideOrderItemIdentifiers_0WithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + list($response) = $this->putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation provideOrderItemIdentifiers_0WithHttpInfo + * Operation putBidsForBusinessWithHttpInfo * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function provideOrderItemIdentifiers_0WithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_0'][0]) + public function putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - $request = $this->provideOrderItemIdentifiers_0Request($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -50759,196 +40178,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50962,44 +40236,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51007,7 +40258,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51015,7 +40266,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51023,7 +40274,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51031,7 +40282,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51039,7 +40290,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51047,28 +40298,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation provideOrderItemIdentifiers_0Async + * Operation putBidsForBusinessAsync * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiers_0Async($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_0'][0]) + public function putBidsForBusinessAsync($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - return $this->provideOrderItemIdentifiers_0AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) + return $this->putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -51077,22 +40329,21 @@ class FbsApi } /** - * Operation provideOrderItemIdentifiers_0AsyncWithHttpInfo + * Operation putBidsForBusinessAsyncWithHttpInfo * - * Передача кодов маркировки единиц товара + * Включение буста продаж и установка ставок * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiers_0AsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_0'][0]) + public function putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - $request = $this->provideOrderItemIdentifiers_0Request($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51131,45 +40382,37 @@ class FbsApi } /** - * Create request for operation 'provideOrderItemIdentifiers_0' + * Create request for operation 'putBidsForBusiness' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function provideOrderItemIdentifiers_0Request($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers_0'][0]) + public function putBidsForBusinessRequest($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers_0' + 'Missing the required parameter $business_id when calling putBidsForBusiness' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.provideOrderItemIdentifiers_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.putBidsForBusiness, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers_0' - ); - } - - // verify the required parameter 'provide_order_item_identifiers_request' is set - if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { + // verify the required parameter 'put_sku_bids_request' is set + if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers_0' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/identifiers'; + $resourcePath = '/v2/businesses/{businessId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -51179,18 +40422,10 @@ class FbsApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -51203,12 +40438,12 @@ class FbsApi ); // for model (json/xml) - if (isset($provide_order_item_identifiers_request)) { + if (isset($put_sku_bids_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_item_identifiers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_sku_bids_request)); } else { - $httpBody = $provide_order_item_identifiers_request; + $httpBody = $put_sku_bids_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -51266,40 +40501,40 @@ class FbsApi } /** - * Operation putBidsForBusiness_1 + * Operation putBidsForCampaign * - * Включение буста продаж и установка ставок + * Включение буста продаж и установка ставок для магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForBusiness_1($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_1'][0]) + public function putBidsForCampaign($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - list($response) = $this->putBidsForBusiness_1WithHttpInfo($business_id, $put_sku_bids_request, $contentType); + list($response) = $this->putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation putBidsForBusiness_1WithHttpInfo + * Operation putBidsForCampaignWithHttpInfo * - * Включение буста продаж и установка ставок + * Включение буста продаж и установка ставок для магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForBusiness_1WithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_1'][0]) + public function putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - $request = $this->putBidsForBusiness_1Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -51326,196 +40561,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -51529,34 +40619,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -51566,7 +40633,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51574,7 +40641,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51582,7 +40649,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51590,7 +40657,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51598,7 +40665,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51606,7 +40673,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51614,27 +40681,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForBusiness_1Async + * Operation putBidsForCampaignAsync * - * Включение буста продаж и установка ставок + * Включение буста продаж и установка ставок для магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_1Async($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_1'][0]) + public function putBidsForCampaignAsync($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - return $this->putBidsForBusiness_1AsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) + return $this->putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -51643,21 +40712,21 @@ class FbsApi } /** - * Operation putBidsForBusiness_1AsyncWithHttpInfo + * Operation putBidsForCampaignAsyncWithHttpInfo * - * Включение буста продаж и установка ставок + * Включение буста продаж и установка ставок для магазина * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_1AsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_1'][0]) + public function putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForBusiness_1Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51696,37 +40765,37 @@ class FbsApi } /** - * Create request for operation 'putBidsForBusiness_1' + * Create request for operation 'putBidsForCampaign' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForBusiness_1Request($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_1'][0]) + public function putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling putBidsForBusiness_1' + 'Missing the required parameter $campaign_id when calling putBidsForCampaign' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.putBidsForBusiness_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.putBidsForCampaign, must be bigger than or equal to 1.'); } // verify the required parameter 'put_sku_bids_request' is set if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness_1' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign' ); } - $resourcePath = '/businesses/{businessId}/bids'; + $resourcePath = '/v2/campaigns/{campaignId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -51736,10 +40805,10 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -51815,40 +40884,42 @@ class FbsApi } /** - * Operation putBidsForCampaign_1 + * Operation searchRegionChildren * - * Включение буста продаж и установка ставок для магазина + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForCampaign_1($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_1'][0]) + public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - list($response) = $this->putBidsForCampaign_1WithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); + list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); return $response; } /** - * Operation putBidsForCampaign_1WithHttpInfo + * Operation searchRegionChildrenWithHttpInfo * - * Включение буста продаж и установка ставок для магазина + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForCampaign_1WithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_1'][0]) + public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $request = $this->putBidsForCampaign_1Request($campaign_id, $put_sku_bids_request, $contentType); + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -51875,196 +40946,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52078,44 +41004,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52123,7 +41026,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52131,7 +41034,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52139,7 +41042,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52147,7 +41050,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52155,7 +41058,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52163,27 +41066,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForCampaign_1Async + * Operation searchRegionChildrenAsync * - * Включение буста продаж и установка ставок для магазина + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_1Async($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_1'][0]) + public function searchRegionChildrenAsync($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - return $this->putBidsForCampaign_1AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) + return $this->searchRegionChildrenAsyncWithHttpInfo($region_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -52192,21 +41098,22 @@ class FbsApi } /** - * Operation putBidsForCampaign_1AsyncWithHttpInfo + * Operation searchRegionChildrenAsyncWithHttpInfo * - * Включение буста продаж и установка ставок для магазина + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_1AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_1'][0]) + public function searchRegionChildrenAsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForCampaign_1Request($campaign_id, $put_sku_bids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -52245,50 +41152,64 @@ class FbsApi } /** - * Create request for operation 'putBidsForCampaign_1' + * Create request for operation 'searchRegionChildren' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForCampaign_1Request($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_1'][0]) + public function searchRegionChildrenRequest($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling putBidsForCampaign_1' + 'Missing the required parameter $region_id when calling searchRegionChildren' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.putBidsForCampaign_1, must be bigger than or equal to 1.'); + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.searchRegionChildren, must be smaller than or equal to 10000.'); } - // verify the required parameter 'put_sku_bids_request' is set - if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign_1' - ); - } - $resourcePath = '/campaigns/{campaignId}/bids'; + $resourcePath = '/v2/regions/{regionId}/children'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($region_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), $resourcePath ); } @@ -52301,14 +41222,7 @@ class FbsApi ); // for model (json/xml) - if (isset($put_sku_bids_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_sku_bids_request)); - } else { - $httpBody = $put_sku_bids_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -52356,7 +41270,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -52364,42 +41278,38 @@ class FbsApi } /** - * Operation refreshFeed_1 + * Operation searchRegionsById * - * Сообщить, что прайс-лист обновился + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function refreshFeed_1($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_1'][0]) + public function searchRegionsById($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - list($response) = $this->refreshFeed_1WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->searchRegionsByIdWithHttpInfo($region_id, $contentType); return $response; } /** - * Operation refreshFeed_1WithHttpInfo + * Operation searchRegionsByIdWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function refreshFeed_1WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_1'][0]) + public function searchRegionsByIdWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $request = $this->refreshFeed_1Request($campaign_id, $feed_id, $contentType); + $request = $this->searchRegionsByIdRequest($region_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -52426,196 +41336,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52629,52 +41388,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52682,7 +41410,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52690,7 +41418,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52698,7 +41426,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52706,7 +41434,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52714,28 +41442,28 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation refreshFeed_1Async + * Operation searchRegionsByIdAsync * - * Сообщить, что прайс-лист обновился + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_1Async($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_1'][0]) + public function searchRegionsByIdAsync($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - return $this->refreshFeed_1AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->searchRegionsByIdAsyncWithHttpInfo($region_id, $contentType) ->then( function ($response) { return $response[0]; @@ -52744,22 +41472,20 @@ class FbsApi } /** - * Operation refreshFeed_1AsyncWithHttpInfo + * Operation searchRegionsByIdAsyncWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Информация о регионе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_1AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_1'][0]) + public function searchRegionsByIdAsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->refreshFeed_1Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByIdRequest($region_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -52798,38 +41524,26 @@ class FbsApi } /** - * Create request for operation 'refreshFeed_1' + * Create request for operation 'searchRegionsById' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_1'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function refreshFeed_1Request($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_1'][0]) + public function searchRegionsByIdRequest($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling refreshFeed_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.refreshFeed_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling refreshFeed_1' + 'Missing the required parameter $region_id when calling searchRegionsById' ); } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/refresh'; + $resourcePath = '/v2/regions/{regionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -52839,18 +41553,10 @@ class FbsApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($feed_id !== null) { + if ($region_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), $resourcePath ); } @@ -52911,7 +41617,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -52919,42 +41625,42 @@ class FbsApi } /** - * Operation searchRegionChildren_1 + * Operation searchRegionsByName * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_1'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionChildren_1($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_1'][0]) + public function searchRegionsByName($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - list($response) = $this->searchRegionChildren_1WithHttpInfo($region_id, $page, $page_size, $contentType); + list($response) = $this->searchRegionsByNameWithHttpInfo($name, $page_token, $limit, $contentType); return $response; } /** - * Operation searchRegionChildren_1WithHttpInfo + * Operation searchRegionsByNameWithHttpInfo * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_1'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionChildren_1WithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_1'][0]) + public function searchRegionsByNameWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $request = $this->searchRegionChildren_1Request($region_id, $page, $page_size, $contentType); + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -52981,196 +41687,39 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -53184,52 +41733,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53237,7 +41755,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53245,15 +41763,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53261,7 +41771,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53269,28 +41779,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionChildren_1Async + * Operation searchRegionsByNameAsync * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_1'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_1Async($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_1'][0]) + public function searchRegionsByNameAsync($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - return $this->searchRegionChildren_1AsyncWithHttpInfo($region_id, $page, $page_size, $contentType) + return $this->searchRegionsByNameAsyncWithHttpInfo($name, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -53299,22 +41811,22 @@ class FbsApi } /** - * Operation searchRegionChildren_1AsyncWithHttpInfo + * Operation searchRegionsByNameAsyncWithHttpInfo * - * Информация о дочерних регионах + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_1'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_1AsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_1'][0]) + public function searchRegionsByNameAsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - $request = $this->searchRegionChildren_1Request($region_id, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -53353,33 +41865,33 @@ class FbsApi } /** - * Create request for operation 'searchRegionChildren_1' + * Create request for operation 'searchRegionsByName' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_1'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionChildren_1Request($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_1'][0]) + public function searchRegionsByNameRequest($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionChildren_1' + 'Missing the required parameter $name when calling searchRegionsByName' ); } - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbsApi.searchRegionChildren_1, must be smaller than or equal to 10000.'); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.searchRegionsByName, must be bigger than or equal to 1.'); } - - $resourcePath = '/regions/{regionId}/children'; + $resourcePath = '/v2/regions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -53388,17 +41900,26 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $name, + 'name', // param base name + 'string', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -53406,14 +41927,6 @@ class FbsApi ) ?? []); - // path params - if ($region_id !== null) { - $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -53479,38 +41992,44 @@ class FbsApi } /** - * Operation searchRegionsById_1 + * Operation searchShipments * - * Информация о регионе + * Получение информации о нескольких отгрузках * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request search_shipments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SearchShipmentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsById_1($region_id, string $contentType = self::contentTypes['searchRegionsById_1'][0]) + public function searchShipments($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments'][0]) { - list($response) = $this->searchRegionsById_1WithHttpInfo($region_id, $contentType); + list($response) = $this->searchShipmentsWithHttpInfo($campaign_id, $search_shipments_request, $page_token, $limit, $contentType); return $response; } /** - * Operation searchRegionsById_1WithHttpInfo + * Operation searchShipmentsWithHttpInfo * - * Информация о регионе + * Получение информации о нескольких отгрузках * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SearchShipmentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsById_1WithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_1'][0]) + public function searchShipmentsWithHttpInfo($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments'][0]) { - $request = $this->searchRegionsById_1Request($region_id, $contentType); + $request = $this->searchShipmentsRequest($campaign_id, $search_shipments_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -53537,169 +42056,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SearchShipmentsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -53713,44 +42114,29 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SearchShipmentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\SearchShipmentsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53758,7 +42144,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53766,7 +42152,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53774,7 +42160,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53782,7 +42168,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -53790,26 +42176,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsById_1Async + * Operation searchShipmentsAsync * - * Информация о регионе + * Получение информации о нескольких отгрузках * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_1Async($region_id, string $contentType = self::contentTypes['searchRegionsById_1'][0]) + public function searchShipmentsAsync($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments'][0]) { - return $this->searchRegionsById_1AsyncWithHttpInfo($region_id, $contentType) + return $this->searchShipmentsAsyncWithHttpInfo($campaign_id, $search_shipments_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -53818,20 +42209,23 @@ class FbsApi } /** - * Operation searchRegionsById_1AsyncWithHttpInfo + * Operation searchShipmentsAsyncWithHttpInfo * - * Информация о регионе + * Получение информации о нескольких отгрузках * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_1AsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_1'][0]) + public function searchShipmentsAsyncWithHttpInfo($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsById_1Request($region_id, $contentType); + $returnType = '\OpenAPI\Client\Model\SearchShipmentsResponse'; + $request = $this->searchShipmentsRequest($campaign_id, $search_shipments_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -53870,39 +42264,75 @@ class FbsApi } /** - * Create request for operation 'searchRegionsById_1' + * Create request for operation 'searchShipments' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsById_1Request($region_id, string $contentType = self::contentTypes['searchRegionsById_1'][0]) + public function searchShipmentsRequest($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionsById_1' + 'Missing the required parameter $campaign_id when calling searchShipments' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.searchShipments, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'search_shipments_request' is set + if ($search_shipments_request === null || (is_array($search_shipments_request) && count($search_shipments_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $search_shipments_request when calling searchShipments' ); } - $resourcePath = '/regions/{regionId}'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbsApi.searchShipments, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($region_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -53915,7 +42345,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($search_shipments_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($search_shipments_request)); + } else { + $httpBody = $search_shipments_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -53963,7 +42400,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -53971,42 +42408,42 @@ class FbsApi } /** - * Operation searchRegionsByName_1 + * Operation sendFileToChat * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsByName_1($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_1'][0]) + public function sendFileToChat($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - list($response) = $this->searchRegionsByName_1WithHttpInfo($name, $page_token, $limit, $contentType); + list($response) = $this->sendFileToChatWithHttpInfo($business_id, $chat_id, $file, $contentType); return $response; } /** - * Operation searchRegionsByName_1WithHttpInfo + * Operation sendFileToChatWithHttpInfo * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsByName_1WithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_1'][0]) + public function sendFileToChatWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $request = $this->searchRegionsByName_1Request($name, $page_token, $limit, $contentType); + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); try { $options = $this->createHttpClientOption(); @@ -54033,142 +42470,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -54182,44 +42528,29 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54227,7 +42558,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54235,7 +42566,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54243,7 +42582,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54251,28 +42590,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsByName_1Async + * Operation sendFileToChatAsync * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_1Async($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_1'][0]) + public function sendFileToChatAsync($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - return $this->searchRegionsByName_1AsyncWithHttpInfo($name, $page_token, $limit, $contentType) + return $this->sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) ->then( function ($response) { return $response[0]; @@ -54281,22 +42622,22 @@ class FbsApi } /** - * Operation searchRegionsByName_1AsyncWithHttpInfo + * Operation sendFileToChatAsyncWithHttpInfo * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_1AsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_1'][0]) + public function sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsByName_1Request($name, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -54335,30 +42676,48 @@ class FbsApi } /** - * Create request for operation 'searchRegionsByName_1' + * Create request for operation 'sendFileToChat' * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsByName_1Request($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_1'][0]) + public function sendFileToChatRequest($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling searchRegionsByName_1' + 'Missing the required parameter $business_id when calling sendFileToChat' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling sendFileToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling sendFileToChat' ); } - - - $resourcePath = '/regions'; + $resourcePath = '/v2/businesses/{businessId}/chats/file/send'; $formParams = []; $queryParams = []; $headerParams = []; @@ -54367,35 +42726,35 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $name, - 'name', // param base name - 'string', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + // form params + $formDataProcessor = new FormDataProcessor(); + + $formData = $formDataProcessor->prepare([ + 'file' => $file, + ]); + $formParams = $formDataProcessor->flatten($formData); + $multipart = $formDataProcessor->has_file; + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -54451,7 +42810,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -54459,44 +42818,42 @@ class FbsApi } /** - * Operation searchShipments_0 + * Operation sendMessageToChat * - * Получение информации о нескольких отгрузках + * Отправка сообщения в чат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SearchShipmentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchShipments_0($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments_0'][0]) + public function sendMessageToChat($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - list($response) = $this->searchShipments_0WithHttpInfo($campaign_id, $search_shipments_request, $page_token, $limit, $contentType); + list($response) = $this->sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $response; } /** - * Operation searchShipments_0WithHttpInfo + * Operation sendMessageToChatWithHttpInfo * - * Получение информации о нескольких отгрузках + * Отправка сообщения в чат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SearchShipmentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchShipments_0WithHttpInfo($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments_0'][0]) + public function sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $request = $this->searchShipments_0Request($campaign_id, $search_shipments_request, $page_token, $limit, $contentType); + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -54523,196 +42880,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SearchShipmentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SearchShipmentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SearchShipmentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -54726,44 +42938,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\SearchShipmentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SearchShipmentsResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54771,7 +42960,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54779,7 +42968,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54787,7 +42976,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54795,7 +42984,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54803,7 +42992,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -54811,29 +43000,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchShipments_0Async + * Operation sendMessageToChatAsync * - * Получение информации о нескольких отгрузках + * Отправка сообщения в чат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchShipments_0Async($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments_0'][0]) + public function sendMessageToChatAsync($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - return $this->searchShipments_0AsyncWithHttpInfo($campaign_id, $search_shipments_request, $page_token, $limit, $contentType) + return $this->sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -54842,23 +43032,22 @@ class FbsApi } /** - * Operation searchShipments_0AsyncWithHttpInfo + * Operation sendMessageToChatAsyncWithHttpInfo * - * Получение информации о нескольких отгрузках + * Отправка сообщения в чат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchShipments_0AsyncWithHttpInfo($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments_0'][0]) + public function sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\SearchShipmentsResponse'; - $request = $this->searchShipments_0Request($campaign_id, $search_shipments_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -54897,41 +43086,48 @@ class FbsApi } /** - * Create request for operation 'searchShipments_0' + * Create request for operation 'sendMessageToChat' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchShipments_0Request($campaign_id, $search_shipments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchShipments_0'][0]) + public function sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling searchShipments_0' + 'Missing the required parameter $business_id when calling sendMessageToChat' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.searchShipments_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.sendMessageToChat, must be bigger than or equal to 1.'); } - // verify the required parameter 'search_shipments_request' is set - if ($search_shipments_request === null || (is_array($search_shipments_request) && count($search_shipments_request) === 0)) { + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $search_shipments_request when calling searchShipments_0' + 'Missing the required parameter $chat_id when calling sendMessageToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.sendMessageToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'send_message_to_chat_request' is set + if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat' ); } - - - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -54940,29 +43136,20 @@ class FbsApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -54975,12 +43162,12 @@ class FbsApi ); // for model (json/xml) - if (isset($search_shipments_request)) { + if (isset($send_message_to_chat_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($search_shipments_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); } else { - $httpBody = $search_shipments_request; + $httpBody = $send_message_to_chat_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -55030,7 +43217,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -55038,42 +43225,42 @@ class FbsApi } /** - * Operation sendFileToChat_1 + * Operation setOrderBoxLayout * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function sendFileToChat_1($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_1'][0]) + public function setOrderBoxLayout($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - list($response) = $this->sendFileToChat_1WithHttpInfo($business_id, $chat_id, $file, $contentType); + list($response) = $this->setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $response; } /** - * Operation sendFileToChat_1WithHttpInfo + * Operation setOrderBoxLayoutWithHttpInfo * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendFileToChat_1WithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_1'][0]) + public function setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $request = $this->sendFileToChat_1Request($business_id, $chat_id, $file, $contentType); + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -55100,196 +43287,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -55303,44 +43345,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55348,7 +43367,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55356,7 +43375,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55364,7 +43383,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55372,7 +43391,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55380,7 +43399,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55388,28 +43407,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendFileToChat_1Async + * Operation setOrderBoxLayoutAsync * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendFileToChat_1Async($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_1'][0]) + public function setOrderBoxLayoutAsync($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - return $this->sendFileToChat_1AsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) + return $this->setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) ->then( function ($response) { return $response[0]; @@ -55418,22 +43439,22 @@ class FbsApi } /** - * Operation sendFileToChat_1AsyncWithHttpInfo + * Operation setOrderBoxLayoutAsyncWithHttpInfo * - * Отправка файла в чат + * Подготовка заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendFileToChat_1AsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_1'][0]) + public function setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendFileToChat_1Request($business_id, $chat_id, $file, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -55472,87 +43493,71 @@ class FbsApi } /** - * Create request for operation 'sendFileToChat_1' + * Create request for operation 'setOrderBoxLayout' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendFileToChat_1Request($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_1'][0]) + public function setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendFileToChat_1' + 'Missing the required parameter $campaign_id when calling setOrderBoxLayout' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.sendFileToChat_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setOrderBoxLayout, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendFileToChat_1' + 'Missing the required parameter $order_id when calling setOrderBoxLayout' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.sendFileToChat_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'file' is set - if ($file === null || (is_array($file) && count($file) === 0)) { + + // verify the required parameter 'set_order_box_layout_request' is set + if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file when calling sendFileToChat_1' + 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout' ); } - $resourcePath = '/businesses/{businessId}/chats/file/send'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } - - // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = []; - $paramFiles = is_array($file) ? $file : [$file]; - foreach ($paramFiles as $paramFile) { - $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); } + $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -55560,7 +43565,14 @@ class FbsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($set_order_box_layout_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + } else { + $httpBody = $set_order_box_layout_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -55608,7 +43620,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -55616,42 +43628,46 @@ class FbsApi } /** - * Operation sendMessageToChat_1 + * Operation setOrderShipmentBoxes * - * Отправка сообщения в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function sendMessageToChat_1($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_1'][0]) + public function setOrderShipmentBoxes($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - list($response) = $this->sendMessageToChat_1WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); + list($response) = $this->setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $response; } /** - * Operation sendMessageToChat_1WithHttpInfo + * Operation setOrderShipmentBoxesWithHttpInfo * - * Отправка сообщения в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function sendMessageToChat_1WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_1'][0]) + public function setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $request = $this->sendMessageToChat_1Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -55678,196 +43694,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -55881,44 +43752,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55926,7 +43774,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55934,7 +43782,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55942,7 +43790,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55950,7 +43798,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55958,7 +43806,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -55966,28 +43814,32 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendMessageToChat_1Async + * Operation setOrderShipmentBoxesAsync * - * Отправка сообщения в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function sendMessageToChat_1Async($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_1'][0]) + public function setOrderShipmentBoxesAsync($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - return $this->sendMessageToChat_1AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) + return $this->setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -55996,22 +43848,24 @@ class FbsApi } /** - * Operation sendMessageToChat_1AsyncWithHttpInfo + * Operation setOrderShipmentBoxesAsyncWithHttpInfo * - * Отправка сообщения в чат + * Передача количества грузовых мест в заказе * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function sendMessageToChat_1AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_1'][0]) + public function setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendMessageToChat_1Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -56050,70 +43904,83 @@ class FbsApi } /** - * Create request for operation 'sendMessageToChat_1' + * Create request for operation 'setOrderShipmentBoxes' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function sendMessageToChat_1Request($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_1'][0]) + public function setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendMessageToChat_1' + 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.sendMessageToChat_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setOrderShipmentBoxes, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendMessageToChat_1' + 'Missing the required parameter $order_id when calling setOrderShipmentBoxes' ); } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbsApi.sendMessageToChat_1, must be bigger than or equal to 1.'); + + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes' + ); } - - // verify the required parameter 'send_message_to_chat_request' is set - if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + + // verify the required parameter 'set_order_shipment_boxes_request' is set + if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat_1' + 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes' ); } - $resourcePath = '/businesses/{businessId}/chats/message'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), $resourcePath ); } @@ -56126,12 +43993,12 @@ class FbsApi ); // for model (json/xml) - if (isset($send_message_to_chat_request)) { + if (isset($set_order_shipment_boxes_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); } else { - $httpBody = $send_message_to_chat_request; + $httpBody = $set_order_shipment_boxes_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -56181,7 +44048,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -56189,44 +44056,42 @@ class FbsApi } /** - * Operation setFeedParams_1 + * Operation setShipmentPalletsCount * - * Изменение параметров прайс-листа + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $shipment_id Идентификатор отгрузки. (required) + * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request set_shipment_pallets_count_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setFeedParams_1($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_1'][0]) + public function setShipmentPalletsCount($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount'][0]) { - list($response) = $this->setFeedParams_1WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType); + list($response) = $this->setShipmentPalletsCountWithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType); return $response; } /** - * Operation setFeedParams_1WithHttpInfo + * Operation setShipmentPalletsCountWithHttpInfo * - * Изменение параметров прайс-листа + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $shipment_id Идентификатор отгрузки. (required) + * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setFeedParams_1WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_1'][0]) + public function setShipmentPalletsCountWithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount'][0]) { - $request = $this->setFeedParams_1Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->setShipmentPalletsCountRequest($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -56253,223 +44118,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -56483,34 +44176,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -56520,7 +44190,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56528,7 +44198,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56536,7 +44206,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56544,7 +44214,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56552,7 +44222,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56560,15 +44230,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -56576,29 +44238,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setFeedParams_1Async + * Operation setShipmentPalletsCountAsync * - * Изменение параметров прайс-листа + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $shipment_id Идентификатор отгрузки. (required) + * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_1Async($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_1'][0]) + public function setShipmentPalletsCountAsync($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount'][0]) { - return $this->setFeedParams_1AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType) + return $this->setShipmentPalletsCountAsyncWithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType) ->then( function ($response) { return $response[0]; @@ -56607,23 +44270,22 @@ class FbsApi } /** - * Operation setFeedParams_1AsyncWithHttpInfo + * Operation setShipmentPalletsCountAsyncWithHttpInfo * - * Изменение параметров прайс-листа + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $shipment_id Идентификатор отгрузки. (required) + * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_1AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_1'][0]) + public function setShipmentPalletsCountAsyncWithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setFeedParams_1Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->setShipmentPalletsCountRequest($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -56662,46 +44324,48 @@ class FbsApi } /** - * Create request for operation 'setFeedParams_1' + * Create request for operation 'setShipmentPalletsCount' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $shipment_id Идентификатор отгрузки. (required) + * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function setFeedParams_1Request($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_1'][0]) + public function setShipmentPalletsCountRequest($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setFeedParams_1' + 'Missing the required parameter $campaign_id when calling setShipmentPalletsCount' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setFeedParams_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setShipmentPalletsCount, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling setFeedParams_1' + 'Missing the required parameter $shipment_id when calling setShipmentPalletsCount' ); } - - // verify the required parameter 'set_feed_params_request' is set - if ($set_feed_params_request === null || (is_array($set_feed_params_request) && count($set_feed_params_request) === 0)) { + if ($shipment_id < 1) { + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.setShipmentPalletsCount, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'set_shipment_pallets_count_request' is set + if ($set_shipment_pallets_count_request === null || (is_array($set_shipment_pallets_count_request) && count($set_shipment_pallets_count_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_feed_params_request when calling setFeedParams_1' + 'Missing the required parameter $set_shipment_pallets_count_request when calling setShipmentPalletsCount' ); } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/params'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallets'; $formParams = []; $queryParams = []; $headerParams = []; @@ -56719,10 +44383,10 @@ class FbsApi ); } // path params - if ($feed_id !== null) { + if ($shipment_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), $resourcePath ); } @@ -56735,12 +44399,12 @@ class FbsApi ); // for model (json/xml) - if (isset($set_feed_params_request)) { + if (isset($set_shipment_pallets_count_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_feed_params_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_shipment_pallets_count_request)); } else { - $httpBody = $set_feed_params_request; + $httpBody = $set_shipment_pallets_count_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -56790,7 +44454,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -56798,42 +44462,40 @@ class FbsApi } /** - * Operation setOrderBoxLayout_0 + * Operation skipGoodsFeedbacksReaction * - * Подготовка заказа + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderBoxLayout_0($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_0'][0]) + public function skipGoodsFeedbacksReaction($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - list($response) = $this->setOrderBoxLayout_0WithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + list($response) = $this->skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); return $response; } /** - * Operation setOrderBoxLayout_0WithHttpInfo + * Operation skipGoodsFeedbacksReactionWithHttpInfo * - * Подготовка заказа + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderBoxLayout_0WithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_0'][0]) + public function skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - $request = $this->setOrderBoxLayout_0Request($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -56860,196 +44522,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -57063,44 +44580,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57108,7 +44602,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57116,7 +44610,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57124,7 +44618,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57132,7 +44626,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57140,7 +44634,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57148,28 +44642,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderBoxLayout_0Async + * Operation skipGoodsFeedbacksReactionAsync * - * Подготовка заказа + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderBoxLayout_0Async($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_0'][0]) + public function skipGoodsFeedbacksReactionAsync($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - return $this->setOrderBoxLayout_0AsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) + return $this->skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) ->then( function ($response) { return $response[0]; @@ -57178,22 +44673,21 @@ class FbsApi } /** - * Operation setOrderBoxLayout_0AsyncWithHttpInfo + * Operation skipGoodsFeedbacksReactionAsyncWithHttpInfo * - * Подготовка заказа + * Пропуск реакции на отзывы * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderBoxLayout_0AsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_0'][0]) + public function skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - $request = $this->setOrderBoxLayout_0Request($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -57232,45 +44726,37 @@ class FbsApi } /** - * Create request for operation 'setOrderBoxLayout_0' + * Create request for operation 'skipGoodsFeedbacksReaction' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderBoxLayout_0Request($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout_0'][0]) + public function skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderBoxLayout_0' + 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setOrderBoxLayout_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.skipGoodsFeedbacksReaction, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderBoxLayout_0' - ); - } - - // verify the required parameter 'set_order_box_layout_request' is set - if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { + // verify the required parameter 'skip_goods_feedback_reaction_request' is set + if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout_0' + 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/boxes'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/skip-reaction'; $formParams = []; $queryParams = []; $headerParams = []; @@ -57280,18 +44766,10 @@ class FbsApi // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -57304,12 +44782,12 @@ class FbsApi ); // for model (json/xml) - if (isset($set_order_box_layout_request)) { + if (isset($skip_goods_feedback_reaction_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); } else { - $httpBody = $set_order_box_layout_request; + $httpBody = $skip_goods_feedback_reaction_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -57359,7 +44837,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -57367,44 +44845,44 @@ class FbsApi } /** - * Operation setOrderShipmentBoxes_0 + * Operation submitReturnDecision * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderShipmentBoxes_0($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_0'][0]) + public function submitReturnDecision($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - list($response) = $this->setOrderShipmentBoxes_0WithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + list($response) = $this->submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $response; } /** - * Operation setOrderShipmentBoxes_0WithHttpInfo + * Operation submitReturnDecisionWithHttpInfo * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderShipmentBoxes_0WithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_0'][0]) + public function submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $request = $this->setOrderShipmentBoxes_0Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -57431,196 +44909,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -57634,44 +44967,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57679,7 +44989,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57687,7 +44997,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57695,7 +45005,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57703,7 +45013,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57711,7 +45021,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -57719,29 +45029,31 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderShipmentBoxes_0Async + * Operation submitReturnDecisionAsync * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxes_0Async($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_0'][0]) + public function submitReturnDecisionAsync($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - return $this->setOrderShipmentBoxes_0AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) + return $this->submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType) ->then( function ($response) { return $response[0]; @@ -57750,23 +45062,23 @@ class FbsApi } /** - * Operation setOrderShipmentBoxes_0AsyncWithHttpInfo + * Operation submitReturnDecisionAsyncWithHttpInfo * - * Передача количества грузовых мест в заказе + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxes_0AsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_0'][0]) + public function submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - $request = $this->setOrderShipmentBoxes_0Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -57805,53 +45117,47 @@ class FbsApi } /** - * Create request for operation 'setOrderShipmentBoxes_0' + * Create request for operation 'submitReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes_0'] to see the possible values for this operation + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderShipmentBoxes_0Request($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes_0'][0]) + public function submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes_0' + 'Missing the required parameter $campaign_id when calling submitReturnDecision' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setOrderShipmentBoxes_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.submitReturnDecision, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderShipmentBoxes_0' + 'Missing the required parameter $order_id when calling submitReturnDecision' ); } - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes_0' + 'Missing the required parameter $return_id when calling submitReturnDecision' ); } - // verify the required parameter 'set_order_shipment_boxes_request' is set - if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes_0' - ); - } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -57877,10 +45183,10 @@ class FbsApi ); } // path params - if ($shipment_id !== null) { + if ($return_id !== null) { $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), $resourcePath ); } @@ -57893,12 +45199,12 @@ class FbsApi ); // for model (json/xml) - if (isset($set_order_shipment_boxes_request)) { + if (isset($submit_return_decision_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($submit_return_decision_request)); } else { - $httpBody = $set_order_shipment_boxes_request; + $httpBody = $submit_return_decision_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -57948,7 +45254,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -57956,42 +45262,42 @@ class FbsApi } /** - * Operation setShipmentPalletsCount_0 + * Operation transferOrdersFromShipment * - * Передача количества упаковок в отгрузке + * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request set_shipment_pallets_count_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request transfer_orders_from_shipment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setShipmentPalletsCount_0($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount_0'][0]) + public function transferOrdersFromShipment($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment'][0]) { - list($response) = $this->setShipmentPalletsCount_0WithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType); + list($response) = $this->transferOrdersFromShipmentWithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType); return $response; } /** - * Operation setShipmentPalletsCount_0WithHttpInfo + * Operation transferOrdersFromShipmentWithHttpInfo * - * Передача количества упаковок в отгрузке + * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setShipmentPalletsCount_0WithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount_0'][0]) + public function transferOrdersFromShipmentWithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment'][0]) { - $request = $this->setShipmentPalletsCount_0Request($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType); + $request = $this->transferOrdersFromShipmentRequest($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -58018,196 +45324,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -58221,34 +45382,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -58258,7 +45396,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58266,7 +45404,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58274,7 +45412,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58282,7 +45420,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58290,7 +45428,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58298,7 +45436,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58306,28 +45444,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setShipmentPalletsCount_0Async + * Operation transferOrdersFromShipmentAsync * - * Передача количества упаковок в отгрузке + * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setShipmentPalletsCount_0Async($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount_0'][0]) + public function transferOrdersFromShipmentAsync($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment'][0]) { - return $this->setShipmentPalletsCount_0AsyncWithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType) + return $this->transferOrdersFromShipmentAsyncWithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -58336,22 +45476,22 @@ class FbsApi } /** - * Operation setShipmentPalletsCount_0AsyncWithHttpInfo + * Operation transferOrdersFromShipmentAsyncWithHttpInfo * - * Передача количества упаковок в отгрузке + * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setShipmentPalletsCount_0AsyncWithHttpInfo($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount_0'][0]) + public function transferOrdersFromShipmentAsyncWithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setShipmentPalletsCount_0Request($campaign_id, $shipment_id, $set_shipment_pallets_count_request, $contentType); + $request = $this->transferOrdersFromShipmentRequest($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -58390,48 +45530,48 @@ class FbsApi } /** - * Create request for operation 'setShipmentPalletsCount_0' + * Create request for operation 'transferOrdersFromShipment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setShipmentPalletsCount_0Request($campaign_id, $shipment_id, $set_shipment_pallets_count_request, string $contentType = self::contentTypes['setShipmentPalletsCount_0'][0]) + public function transferOrdersFromShipmentRequest($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setShipmentPalletsCount_0' + 'Missing the required parameter $campaign_id when calling transferOrdersFromShipment' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.setShipmentPalletsCount_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.transferOrdersFromShipment, must be bigger than or equal to 1.'); } // verify the required parameter 'shipment_id' is set if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling setShipmentPalletsCount_0' + 'Missing the required parameter $shipment_id when calling transferOrdersFromShipment' ); } if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.setShipmentPalletsCount_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.transferOrdersFromShipment, must be bigger than or equal to 1.'); } - // verify the required parameter 'set_shipment_pallets_count_request' is set - if ($set_shipment_pallets_count_request === null || (is_array($set_shipment_pallets_count_request) && count($set_shipment_pallets_count_request) === 0)) { + // verify the required parameter 'transfer_orders_from_shipment_request' is set + if ($transfer_orders_from_shipment_request === null || (is_array($transfer_orders_from_shipment_request) && count($transfer_orders_from_shipment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_shipment_pallets_count_request when calling setShipmentPalletsCount_0' + 'Missing the required parameter $transfer_orders_from_shipment_request when calling transferOrdersFromShipment' ); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallets'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/transfer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -58465,12 +45605,12 @@ class FbsApi ); // for model (json/xml) - if (isset($set_shipment_pallets_count_request)) { + if (isset($transfer_orders_from_shipment_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_shipment_pallets_count_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($transfer_orders_from_shipment_request)); } else { - $httpBody = $set_shipment_pallets_count_request; + $httpBody = $transfer_orders_from_shipment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -58520,7 +45660,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -58528,40 +45668,40 @@ class FbsApi } /** - * Operation skipGoodsFeedbacksReaction_1 + * Operation updateBusinessPrices * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function skipGoodsFeedbacksReaction_1($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_1'][0]) + public function updateBusinessPrices($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - list($response) = $this->skipGoodsFeedbacksReaction_1WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); + list($response) = $this->updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, $contentType); return $response; } /** - * Operation skipGoodsFeedbacksReaction_1WithHttpInfo + * Operation updateBusinessPricesWithHttpInfo * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function skipGoodsFeedbacksReaction_1WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_1'][0]) + public function updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - $request = $this->skipGoodsFeedbacksReaction_1Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -58588,196 +45728,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -58791,34 +45792,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -58828,7 +45806,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58836,7 +45814,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58844,7 +45822,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58852,7 +45830,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58860,7 +45838,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58868,7 +45846,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -58876,27 +45862,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation skipGoodsFeedbacksReaction_1Async + * Operation updateBusinessPricesAsync * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_1Async($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_1'][0]) + public function updateBusinessPricesAsync($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - return $this->skipGoodsFeedbacksReaction_1AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) + return $this->updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -58905,21 +45893,21 @@ class FbsApi } /** - * Operation skipGoodsFeedbacksReaction_1AsyncWithHttpInfo + * Operation updateBusinessPricesAsyncWithHttpInfo * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_1AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_1'][0]) + public function updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->skipGoodsFeedbacksReaction_1Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -58958,37 +45946,37 @@ class FbsApi } /** - * Create request for operation 'skipGoodsFeedbacksReaction_1' + * Create request for operation 'updateBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function skipGoodsFeedbacksReaction_1Request($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_1'][0]) + public function updateBusinessPricesRequest($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction_1' + 'Missing the required parameter $business_id when calling updateBusinessPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.skipGoodsFeedbacksReaction_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateBusinessPrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'skip_goods_feedback_reaction_request' is set - if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { + // verify the required parameter 'update_business_prices_request' is set + if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction_1' + 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/skip-reaction'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -59014,12 +46002,12 @@ class FbsApi ); // for model (json/xml) - if (isset($skip_goods_feedback_reaction_request)) { + if (isset($update_business_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); } else { - $httpBody = $skip_goods_feedback_reaction_request; + $httpBody = $update_business_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -59077,42 +46065,40 @@ class FbsApi } /** - * Operation transferOrdersFromShipment_0 + * Operation updateCampaignOffers * - * Перенос заказов в следующую отгрузку + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request transfer_orders_from_shipment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function transferOrdersFromShipment_0($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment_0'][0]) + public function updateCampaignOffers($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - list($response) = $this->transferOrdersFromShipment_0WithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType); + list($response) = $this->updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); return $response; } /** - * Operation transferOrdersFromShipment_0WithHttpInfo + * Operation updateCampaignOffersWithHttpInfo * - * Перенос заказов в следующую отгрузку + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function transferOrdersFromShipment_0WithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment_0'][0]) + public function updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - $request = $this->transferOrdersFromShipment_0Request($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -59139,196 +46125,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -59342,34 +46189,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -59379,7 +46203,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59387,7 +46211,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59395,7 +46219,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59403,7 +46227,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59411,7 +46235,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59419,7 +46243,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59427,28 +46259,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation transferOrdersFromShipment_0Async + * Operation updateCampaignOffersAsync * - * Перенос заказов в следующую отгрузку + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferOrdersFromShipment_0Async($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment_0'][0]) + public function updateCampaignOffersAsync($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - return $this->transferOrdersFromShipment_0AsyncWithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType) + return $this->updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -59457,22 +46290,21 @@ class FbsApi } /** - * Operation transferOrdersFromShipment_0AsyncWithHttpInfo + * Operation updateCampaignOffersAsyncWithHttpInfo * - * Перенос заказов в следующую отгрузку + * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferOrdersFromShipment_0AsyncWithHttpInfo($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment_0'][0]) + public function updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->transferOrdersFromShipment_0Request($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -59511,48 +46343,37 @@ class FbsApi } /** - * Create request for operation 'transferOrdersFromShipment_0' + * Create request for operation 'updateCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function transferOrdersFromShipment_0Request($campaign_id, $shipment_id, $transfer_orders_from_shipment_request, string $contentType = self::contentTypes['transferOrdersFromShipment_0'][0]) + public function updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling transferOrdersFromShipment_0' + 'Missing the required parameter $campaign_id when calling updateCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.transferOrdersFromShipment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling transferOrdersFromShipment_0' - ); - } - if ($shipment_id < 1) { - throw new \InvalidArgumentException('invalid value for "$shipment_id" when calling FbsApi.transferOrdersFromShipment_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'transfer_orders_from_shipment_request' is set - if ($transfer_orders_from_shipment_request === null || (is_array($transfer_orders_from_shipment_request) && count($transfer_orders_from_shipment_request) === 0)) { + // verify the required parameter 'update_campaign_offers_request' is set + if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transfer_orders_from_shipment_request when calling transferOrdersFromShipment_0' + 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers' ); } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/transfer'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -59569,14 +46390,6 @@ class FbsApi $resourcePath ); } - // path params - if ($shipment_id !== null) { - $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -59586,12 +46399,12 @@ class FbsApi ); // for model (json/xml) - if (isset($transfer_orders_from_shipment_request)) { + if (isset($update_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($transfer_orders_from_shipment_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); } else { - $httpBody = $transfer_orders_from_shipment_request; + $httpBody = $update_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -59649,40 +46462,42 @@ class FbsApi } /** - * Operation updateBusinessPrices_1 + * Operation updateExternalOrderId * - * Установка цен на товары во всех магазинах + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateBusinessPrices_1($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_1'][0]) + public function updateExternalOrderId($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - list($response) = $this->updateBusinessPrices_1WithHttpInfo($business_id, $update_business_prices_request, $contentType); + list($response) = $this->updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $response; } /** - * Operation updateBusinessPrices_1WithHttpInfo + * Operation updateExternalOrderIdWithHttpInfo * - * Установка цен на товары во всех магазинах + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateBusinessPrices_1WithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_1'][0]) + public function updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - $request = $this->updateBusinessPrices_1Request($business_id, $update_business_prices_request, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -59709,223 +46524,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -59939,34 +46582,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -59976,7 +46596,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59984,7 +46604,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -59992,7 +46612,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60000,7 +46620,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60008,7 +46628,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60016,15 +46636,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60032,27 +46644,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateBusinessPrices_1Async + * Operation updateExternalOrderIdAsync * - * Установка цен на товары во всех магазинах + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_1Async($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_1'][0]) + public function updateExternalOrderIdAsync($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - return $this->updateBusinessPrices_1AsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) + return $this->updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType) ->then( function ($response) { return $response[0]; @@ -60061,21 +46676,22 @@ class FbsApi } /** - * Operation updateBusinessPrices_1AsyncWithHttpInfo + * Operation updateExternalOrderIdAsyncWithHttpInfo * - * Установка цен на товары во всех магазинах + * Передача внешнего идентификатора заказа * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_1AsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_1'][0]) + public function updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateBusinessPrices_1Request($business_id, $update_business_prices_request, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -60114,37 +46730,45 @@ class FbsApi } /** - * Create request for operation 'updateBusinessPrices_1' + * Create request for operation 'updateExternalOrderId' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateBusinessPrices_1Request($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_1'][0]) + public function updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateBusinessPrices_1' + 'Missing the required parameter $campaign_id when calling updateExternalOrderId' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateBusinessPrices_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateExternalOrderId, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_business_prices_request' is set - if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices_1' + 'Missing the required parameter $order_id when calling updateExternalOrderId' + ); + } + + // verify the required parameter 'update_external_order_id_request' is set + if ($update_external_order_id_request === null || (is_array($update_external_order_id_request) && count($update_external_order_id_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_external_order_id_request when calling updateExternalOrderId' ); } - $resourcePath = '/businesses/{businessId}/offer-prices/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/external-id'; $formParams = []; $queryParams = []; $headerParams = []; @@ -60154,10 +46778,18 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -60170,12 +46802,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_business_prices_request)) { + if (isset($update_external_order_id_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_external_order_id_request)); } else { - $httpBody = $update_business_prices_request; + $httpBody = $update_external_order_id_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -60233,40 +46865,40 @@ class FbsApi } /** - * Operation updateCampaignOffers_2 + * Operation updateGoodsFeedbackComment * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateCampaignOffers_2($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_2'][0]) + public function updateGoodsFeedbackComment($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - list($response) = $this->updateCampaignOffers_2WithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); + list($response) = $this->updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation updateCampaignOffers_2WithHttpInfo + * Operation updateGoodsFeedbackCommentWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateCampaignOffers_2WithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_2'][0]) + public function updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $request = $this->updateCampaignOffers_2Request($campaign_id, $update_campaign_offers_request, $contentType); + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -60293,223 +46925,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -60523,44 +46983,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60568,7 +47005,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60576,7 +47013,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60584,7 +47021,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60592,7 +47029,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60600,15 +47037,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -60616,27 +47045,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateCampaignOffers_2Async + * Operation updateGoodsFeedbackCommentAsync * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_2Async($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_2'][0]) + public function updateGoodsFeedbackCommentAsync($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - return $this->updateCampaignOffers_2AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) + return $this->updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -60645,21 +47076,21 @@ class FbsApi } /** - * Operation updateCampaignOffers_2AsyncWithHttpInfo + * Operation updateGoodsFeedbackCommentAsyncWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_2AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_2'][0]) + public function updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateCampaignOffers_2Request($campaign_id, $update_campaign_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -60698,37 +47129,37 @@ class FbsApi } /** - * Create request for operation 'updateCampaignOffers_2' + * Create request for operation 'updateGoodsFeedbackComment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCampaignOffers_2Request($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_2'][0]) + public function updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateCampaignOffers_2' + 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateCampaignOffers_2, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateGoodsFeedbackComment, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_campaign_offers_request' is set - if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { + // verify the required parameter 'update_goods_feedback_comment_request' is set + if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers_2' + 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment' ); } - $resourcePath = '/campaigns/{campaignId}/offers/update'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -60738,10 +47169,10 @@ class FbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -60754,12 +47185,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_campaign_offers_request)) { + if (isset($update_goods_feedback_comment_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); } else { - $httpBody = $update_campaign_offers_request; + $httpBody = $update_goods_feedback_comment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -60817,40 +47248,40 @@ class FbsApi } /** - * Operation updateGoodsFeedbackComment_1 + * Operation updateGoodsQuestionTextEntity * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateGoodsFeedbackComment_1($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_1'][0]) + public function updateGoodsQuestionTextEntity($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - list($response) = $this->updateGoodsFeedbackComment_1WithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); + list($response) = $this->updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType); return $response; } /** - * Operation updateGoodsFeedbackComment_1WithHttpInfo + * Operation updateGoodsQuestionTextEntityWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateGoodsFeedbackComment_1WithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_1'][0]) + public function updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $request = $this->updateGoodsFeedbackComment_1Request($business_id, $update_goods_feedback_comment_request, $contentType); + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -60877,196 +47308,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -61080,44 +47366,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61125,7 +47388,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61133,7 +47396,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61141,7 +47404,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61149,7 +47412,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61157,7 +47420,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61165,27 +47428,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateGoodsFeedbackComment_1Async + * Operation updateGoodsQuestionTextEntityAsync * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_1Async($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_1'][0]) + public function updateGoodsQuestionTextEntityAsync($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - return $this->updateGoodsFeedbackComment_1AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) + return $this->updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType) ->then( function ($response) { return $response[0]; @@ -61194,21 +47459,21 @@ class FbsApi } /** - * Operation updateGoodsFeedbackComment_1AsyncWithHttpInfo + * Operation updateGoodsQuestionTextEntityAsyncWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_1AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_1'][0]) + public function updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - $request = $this->updateGoodsFeedbackComment_1Request($business_id, $update_goods_feedback_comment_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse'; + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -61247,37 +47512,37 @@ class FbsApi } /** - * Create request for operation 'updateGoodsFeedbackComment_1' + * Create request for operation 'updateGoodsQuestionTextEntity' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGoodsFeedbackComment_1Request($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_1'][0]) + public function updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment_1' + 'Missing the required parameter $business_id when calling updateGoodsQuestionTextEntity' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateGoodsFeedbackComment_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateGoodsQuestionTextEntity, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_goods_feedback_comment_request' is set - if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { + // verify the required parameter 'update_goods_question_text_entity_request' is set + if ($update_goods_question_text_entity_request === null || (is_array($update_goods_question_text_entity_request) && count($update_goods_question_text_entity_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment_1' + 'Missing the required parameter $update_goods_question_text_entity_request when calling updateGoodsQuestionTextEntity' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/update'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -61303,12 +47568,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_goods_feedback_comment_request)) { + if (isset($update_goods_question_text_entity_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_question_text_entity_request)); } else { - $httpBody = $update_goods_feedback_comment_request; + $httpBody = $update_goods_question_text_entity_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -61366,40 +47631,40 @@ class FbsApi } /** - * Operation updateOfferContent_2 + * Operation updateOfferContent * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferContent_2($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_2'][0]) + public function updateOfferContent($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - list($response) = $this->updateOfferContent_2WithHttpInfo($business_id, $update_offer_content_request, $contentType); + list($response) = $this->updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, $contentType); return $response; } /** - * Operation updateOfferContent_2WithHttpInfo + * Operation updateOfferContentWithHttpInfo * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferContent_2WithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_2'][0]) + public function updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - $request = $this->updateOfferContent_2Request($business_id, $update_offer_content_request, $contentType); + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -61426,223 +47691,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferContentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -61656,34 +47755,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -61693,7 +47769,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61701,7 +47777,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61709,7 +47785,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61717,7 +47793,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61725,7 +47801,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61733,7 +47809,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61741,7 +47817,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -61749,27 +47825,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferContent_2Async + * Operation updateOfferContentAsync * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferContent_2Async($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_2'][0]) + public function updateOfferContentAsync($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - return $this->updateOfferContent_2AsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) + return $this->updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) ->then( function ($response) { return $response[0]; @@ -61778,21 +47856,21 @@ class FbsApi } /** - * Operation updateOfferContent_2AsyncWithHttpInfo + * Operation updateOfferContentAsyncWithHttpInfo * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferContent_2AsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_2'][0]) + public function updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - $request = $this->updateOfferContent_2Request($business_id, $update_offer_content_request, $contentType); + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -61831,37 +47909,37 @@ class FbsApi } /** - * Create request for operation 'updateOfferContent_2' + * Create request for operation 'updateOfferContent' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferContent_2Request($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_2'][0]) + public function updateOfferContentRequest($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferContent_2' + 'Missing the required parameter $business_id when calling updateOfferContent' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateOfferContent_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateOfferContent, must be bigger than or equal to 1.'); } // verify the required parameter 'update_offer_content_request' is set if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_content_request when calling updateOfferContent_2' + 'Missing the required parameter $update_offer_content_request when calling updateOfferContent' ); } - $resourcePath = '/businesses/{businessId}/offer-cards/update'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -61950,42 +48028,42 @@ class FbsApi } /** - * Operation updateOfferMappingEntries_1 + * Operation updateOfferMappingEntries * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function updateOfferMappingEntries_1($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_1'][0]) + public function updateOfferMappingEntries($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - list($response) = $this->updateOfferMappingEntries_1WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); + list($response) = $this->updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); return $response; } /** - * Operation updateOfferMappingEntries_1WithHttpInfo + * Operation updateOfferMappingEntriesWithHttpInfo * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function updateOfferMappingEntries_1WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_1'][0]) + public function updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - $request = $this->updateOfferMappingEntries_1Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -62012,223 +48090,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -62242,34 +48154,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -62279,7 +48168,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62287,7 +48176,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62295,7 +48184,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62303,7 +48192,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62311,7 +48200,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62319,7 +48208,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62327,7 +48216,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62335,28 +48224,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappingEntries_1Async + * Operation updateOfferMappingEntriesAsync * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function updateOfferMappingEntries_1Async($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_1'][0]) + public function updateOfferMappingEntriesAsync($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - return $this->updateOfferMappingEntries_1AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) + return $this->updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) ->then( function ($response) { return $response[0]; @@ -62365,22 +48256,22 @@ class FbsApi } /** - * Operation updateOfferMappingEntries_1AsyncWithHttpInfo + * Operation updateOfferMappingEntriesAsyncWithHttpInfo * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function updateOfferMappingEntries_1AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_1'][0]) + public function updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOfferMappingEntries_1Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -62419,38 +48310,38 @@ class FbsApi } /** - * Create request for operation 'updateOfferMappingEntries_1' + * Create request for operation 'updateOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function updateOfferMappingEntries_1Request($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_1'][0]) + public function updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries_1' + 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOfferMappingEntries_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOfferMappingEntries, must be bigger than or equal to 1.'); } // verify the required parameter 'update_offer_mapping_entry_request' is set if ($update_offer_mapping_entry_request === null || (is_array($update_offer_mapping_entry_request) && count($update_offer_mapping_entry_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries_1' + 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries' ); } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -62539,40 +48430,42 @@ class FbsApi } /** - * Operation updateOfferMappings_2 + * Operation updateOfferMappings * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferMappings_2($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_2'][0]) + public function updateOfferMappings($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - list($response) = $this->updateOfferMappings_2WithHttpInfo($business_id, $update_offer_mappings_request, $contentType); + list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType); return $response; } /** - * Operation updateOfferMappings_2WithHttpInfo + * Operation updateOfferMappingsWithHttpInfo * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappings_2WithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_2'][0]) + public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $request = $this->updateOfferMappings_2Request($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -62599,223 +48492,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -62829,34 +48556,11 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -62866,7 +48570,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62874,7 +48578,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62882,7 +48586,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62890,7 +48594,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62898,7 +48602,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62906,7 +48610,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62914,7 +48618,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -62922,27 +48626,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappings_2Async + * Operation updateOfferMappingsAsync * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_2Async($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_2'][0]) + public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - return $this->updateOfferMappings_2AsyncWithHttpInfo($business_id, $update_offer_mappings_request, $contentType) + return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -62951,21 +48658,22 @@ class FbsApi } /** - * Operation updateOfferMappings_2AsyncWithHttpInfo + * Operation updateOfferMappingsAsyncWithHttpInfo * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_2AsyncWithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_2'][0]) + public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - $request = $this->updateOfferMappings_2Request($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -63004,43 +48712,54 @@ class FbsApi } /** - * Create request for operation 'updateOfferMappings_2' + * Create request for operation 'updateOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferMappings_2Request($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_2'][0]) + public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferMappings_2' + 'Missing the required parameter $business_id when calling updateOfferMappings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateOfferMappings_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updateOfferMappings, must be bigger than or equal to 1.'); } // verify the required parameter 'update_offer_mappings_request' is set if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings_2' + 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/update'; + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/update'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -63115,7 +48834,324 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOrderItems + * + * Удаление товаров из заказа или уменьшение их числа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function updateOrderItems($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) + { + $this->updateOrderItemsWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType); + } + + /** + * Operation updateOrderItemsWithHttpInfo + * + * Удаление товаров из заказа или уменьшение их числа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOrderItemsWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) + { + $request = $this->updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateOrderItemsAsync + * + * Удаление товаров из заказа или уменьшение их числа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOrderItemsAsync($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) + { + return $this->updateOrderItemsAsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOrderItemsAsyncWithHttpInfo + * + * Удаление товаров из заказа или уменьшение их числа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOrderItemsAsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) + { + $returnType = ''; + $request = $this->updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOrderItems' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOrderItemsRequest($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling updateOrderItems' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOrderItems, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling updateOrderItems' + ); + } + + // verify the required parameter 'update_order_item_request' is set + if ($update_order_item_request === null || (is_array($update_order_item_request) && count($update_order_item_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_order_item_request when calling updateOrderItems' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/items'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_order_item_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_item_request)); + } else { + $httpBody = $update_order_item_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -63123,41 +49159,42 @@ class FbsApi } /** - * Operation updateOrderItems_0 + * Operation updateOrderStatus * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderItems_0($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_0'][0]) + public function updateOrderStatus($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $this->updateOrderItems_0WithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType); + list($response) = $this->updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + return $response; } /** - * Operation updateOrderItems_0WithHttpInfo + * Operation updateOrderStatusWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderItems_0WithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_0'][0]) + public function updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $request = $this->updateOrderItems_0Request($campaign_id, $order_id, $update_order_item_request, $contentType); + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -63182,10 +49219,81 @@ class FbsApi $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63193,7 +49301,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63201,7 +49309,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63209,7 +49317,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63217,7 +49325,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63225,7 +49333,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63233,28 +49341,30 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderItems_0Async + * Operation updateOrderStatusAsync * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderItems_0Async($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_0'][0]) + public function updateOrderStatusAsync($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - return $this->updateOrderItems_0AsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, $contentType) + return $this->updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -63263,28 +49373,41 @@ class FbsApi } /** - * Operation updateOrderItems_0AsyncWithHttpInfo + * Operation updateOrderStatusAsyncWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderItems_0AsyncWithHttpInfo($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_0'][0]) + public function updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { - $returnType = ''; - $request = $this->updateOrderItems_0Request($campaign_id, $order_id, $update_order_item_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -63304,45 +49427,45 @@ class FbsApi } /** - * Create request for operation 'updateOrderItems_0' + * Create request for operation 'updateOrderStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderItems_0Request($campaign_id, $order_id, $update_order_item_request, string $contentType = self::contentTypes['updateOrderItems_0'][0]) + public function updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderItems_0' + 'Missing the required parameter $campaign_id when calling updateOrderStatus' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOrderItems_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOrderStatus, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderItems_0' + 'Missing the required parameter $order_id when calling updateOrderStatus' ); } - // verify the required parameter 'update_order_item_request' is set - if ($update_order_item_request === null || (is_array($update_order_item_request) && count($update_order_item_request) === 0)) { + // verify the required parameter 'update_order_status_request' is set + if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_item_request when calling updateOrderItems_0' + 'Missing the required parameter $update_order_status_request when calling updateOrderStatus' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/items'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -63376,12 +49499,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_order_item_request)) { + if (isset($update_order_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_item_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); } else { - $httpBody = $update_order_item_request; + $httpBody = $update_order_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -63439,42 +49562,40 @@ class FbsApi } /** - * Operation updateOrderStatus_0 + * Operation updateOrderStatuses * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStatus_0($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_0'][0]) + public function updateOrderStatuses($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - list($response) = $this->updateOrderStatus_0WithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + list($response) = $this->updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); return $response; } /** - * Operation updateOrderStatus_0WithHttpInfo + * Operation updateOrderStatusesWithHttpInfo * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStatus_0WithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_0'][0]) + public function updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - $request = $this->updateOrderStatus_0Request($campaign_id, $order_id, $update_order_status_request, $contentType); + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -63501,196 +49622,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -63704,44 +49680,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63749,7 +49702,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63757,7 +49710,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63765,7 +49718,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63773,7 +49726,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63781,7 +49734,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -63789,28 +49742,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStatus_0Async + * Operation updateOrderStatusesAsync * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatus_0Async($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_0'][0]) + public function updateOrderStatusesAsync($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - return $this->updateOrderStatus_0AsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) + return $this->updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) ->then( function ($response) { return $response[0]; @@ -63819,22 +49773,21 @@ class FbsApi } /** - * Operation updateOrderStatus_0AsyncWithHttpInfo + * Operation updateOrderStatusesAsyncWithHttpInfo * - * Изменение статуса одного заказа + * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatus_0AsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_0'][0]) + public function updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - $request = $this->updateOrderStatus_0Request($campaign_id, $order_id, $update_order_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -63873,45 +49826,37 @@ class FbsApi } /** - * Create request for operation 'updateOrderStatus_0' + * Create request for operation 'updateOrderStatuses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStatus_0Request($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus_0'][0]) + public function updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStatus_0' + 'Missing the required parameter $campaign_id when calling updateOrderStatuses' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOrderStatus_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOrderStatuses, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling updateOrderStatus_0' - ); - } - - // verify the required parameter 'update_order_status_request' is set - if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { + // verify the required parameter 'update_order_statuses_request' is set + if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_status_request when calling updateOrderStatus_0' + 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/status'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/status-update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -63928,14 +49873,6 @@ class FbsApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -63945,12 +49882,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_order_status_request)) { + if (isset($update_order_statuses_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); } else { - $httpBody = $update_order_status_request; + $httpBody = $update_order_statuses_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -64000,7 +49937,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -64008,40 +49945,40 @@ class FbsApi } /** - * Operation updateOrderStatuses_0 + * Operation updatePrices * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOrderStatuses_0($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_0'][0]) + public function updatePrices($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - list($response) = $this->updateOrderStatuses_0WithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); + list($response) = $this->updatePricesWithHttpInfo($campaign_id, $update_prices_request, $contentType); return $response; } /** - * Operation updateOrderStatuses_0WithHttpInfo + * Operation updatePricesWithHttpInfo * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrderStatuses_0WithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_0'][0]) + public function updatePricesWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - $request = $this->updateOrderStatuses_0Request($campaign_id, $update_order_statuses_request, $contentType); + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -64068,196 +50005,57 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -64271,44 +50069,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64316,7 +50091,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64324,7 +50099,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64332,7 +50107,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64340,7 +50115,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64348,7 +50123,15 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64356,27 +50139,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOrderStatuses_0Async + * Operation updatePricesAsync * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatuses_0Async($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_0'][0]) + public function updatePricesAsync($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - return $this->updateOrderStatuses_0AsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) + return $this->updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -64385,21 +50170,21 @@ class FbsApi } /** - * Operation updateOrderStatuses_0AsyncWithHttpInfo + * Operation updatePricesAsyncWithHttpInfo * - * Изменение статусов нескольких заказов + * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOrderStatuses_0AsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_0'][0]) + public function updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - $request = $this->updateOrderStatuses_0Request($campaign_id, $update_order_statuses_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -64438,37 +50223,37 @@ class FbsApi } /** - * Create request for operation 'updateOrderStatuses_0' + * Create request for operation 'updatePrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOrderStatuses_0Request($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses_0'][0]) + public function updatePricesRequest($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOrderStatuses_0' + 'Missing the required parameter $campaign_id when calling updatePrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateOrderStatuses_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updatePrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_order_statuses_request' is set - if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { + // verify the required parameter 'update_prices_request' is set + if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses_0' + 'Missing the required parameter $update_prices_request when calling updatePrices' ); } - $resourcePath = '/campaigns/{campaignId}/orders/status-update'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -64494,12 +50279,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_order_statuses_request)) { + if (isset($update_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); } else { - $httpBody = $update_order_statuses_request; + $httpBody = $update_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -64557,40 +50342,40 @@ class FbsApi } /** - * Operation updatePrices_1 + * Operation updatePromoOffers * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePrices_1($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_1'][0]) + public function updatePromoOffers($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - list($response) = $this->updatePrices_1WithHttpInfo($campaign_id, $update_prices_request, $contentType); + list($response) = $this->updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, $contentType); return $response; } /** - * Operation updatePrices_1WithHttpInfo + * Operation updatePromoOffersWithHttpInfo * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePrices_1WithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_1'][0]) + public function updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $request = $this->updatePrices_1Request($campaign_id, $update_prices_request, $contentType); + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -64617,223 +50402,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -64847,44 +50460,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64892,7 +50482,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64900,7 +50490,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64908,7 +50498,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64916,7 +50506,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64924,15 +50514,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -64940,27 +50522,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePrices_1Async + * Operation updatePromoOffersAsync * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_1Async($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_1'][0]) + public function updatePromoOffersAsync($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - return $this->updatePrices_1AsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) + return $this->updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -64969,21 +50553,21 @@ class FbsApi } /** - * Operation updatePrices_1AsyncWithHttpInfo + * Operation updatePromoOffersAsyncWithHttpInfo * - * Установка цен на товары в конкретном магазине + * Добавление товаров в акцию или изменение их цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_1AsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_1'][0]) + public function updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updatePrices_1Request($campaign_id, $update_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -65022,37 +50606,37 @@ class FbsApi } /** - * Create request for operation 'updatePrices_1' + * Create request for operation 'updatePromoOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePrices_1Request($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_1'][0]) + public function updatePromoOffersRequest($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updatePrices_1' + 'Missing the required parameter $business_id when calling updatePromoOffers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updatePrices_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updatePromoOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_prices_request' is set - if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { + // verify the required parameter 'update_promo_offers_request' is set + if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_prices_request when calling updatePrices_1' + 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offer-prices/updates'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -65062,10 +50646,10 @@ class FbsApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -65078,12 +50662,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_prices_request)) { + if (isset($update_promo_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_promo_offers_request)); } else { - $httpBody = $update_prices_request; + $httpBody = $update_promo_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -65141,40 +50725,40 @@ class FbsApi } /** - * Operation updatePromoOffers_1 + * Operation updateStocks * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePromoOffers_1($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_1'][0]) + public function updateStocks($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - list($response) = $this->updatePromoOffers_1WithHttpInfo($business_id, $update_promo_offers_request, $contentType); + list($response) = $this->updateStocksWithHttpInfo($campaign_id, $update_stocks_request, $contentType); return $response; } /** - * Operation updatePromoOffers_1WithHttpInfo + * Operation updateStocksWithHttpInfo * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePromoOffers_1WithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_1'][0]) + public function updateStocksWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - $request = $this->updatePromoOffers_1Request($business_id, $update_promo_offers_request, $contentType); + $request = $this->updateStocksRequest($campaign_id, $update_stocks_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -65201,196 +50785,51 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdatePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -65404,44 +50843,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65449,7 +50865,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65457,7 +50873,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65465,7 +50881,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65473,7 +50889,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65481,7 +50897,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65489,27 +50905,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePromoOffers_1Async + * Operation updateStocksAsync * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_1Async($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_1'][0]) + public function updateStocksAsync($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - return $this->updatePromoOffers_1AsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) + return $this->updateStocksAsyncWithHttpInfo($campaign_id, $update_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -65518,21 +50936,21 @@ class FbsApi } /** - * Operation updatePromoOffers_1AsyncWithHttpInfo + * Operation updateStocksAsyncWithHttpInfo * - * Добавление товаров в акцию или изменение их цен + * Передача информации об остатках * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_1AsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_1'][0]) + public function updateStocksAsyncWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - $request = $this->updatePromoOffers_1Request($business_id, $update_promo_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateStocksRequest($campaign_id, $update_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -65571,37 +50989,37 @@ class FbsApi } /** - * Create request for operation 'updatePromoOffers_1' + * Create request for operation 'updateStocks' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePromoOffers_1Request($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_1'][0]) + public function updateStocksRequest($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updatePromoOffers_1' + 'Missing the required parameter $campaign_id when calling updateStocks' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbsApi.updatePromoOffers_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateStocks, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_promo_offers_request' is set - if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { + // verify the required parameter 'update_stocks_request' is set + if ($update_stocks_request === null || (is_array($update_stocks_request) && count($update_stocks_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers_1' + 'Missing the required parameter $update_stocks_request when calling updateStocks' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/update'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -65611,10 +51029,10 @@ class FbsApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -65627,12 +51045,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_promo_offers_request)) { + if (isset($update_stocks_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_promo_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stocks_request)); } else { - $httpBody = $update_promo_offers_request; + $httpBody = $update_stocks_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -65682,7 +51100,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -65690,40 +51108,40 @@ class FbsApi } /** - * Operation updateStocks_0 + * Operation updateWarehouseStatus * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateStocks_0($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_0'][0]) + public function updateWarehouseStatus($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - list($response) = $this->updateStocks_0WithHttpInfo($campaign_id, $update_stocks_request, $contentType); + list($response) = $this->updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType); return $response; } /** - * Operation updateStocks_0WithHttpInfo + * Operation updateWarehouseStatusWithHttpInfo * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateStocks_0WithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_0'][0]) + public function updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - $request = $this->updateStocks_0Request($campaign_id, $update_stocks_request, $contentType); + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -65750,196 +51168,45 @@ class FbsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -65953,44 +51220,21 @@ class FbsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -65998,7 +51242,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66006,7 +51250,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66014,15 +51258,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66030,7 +51266,7 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -66038,27 +51274,29 @@ class FbsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateStocks_0Async + * Operation updateWarehouseStatusAsync * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStocks_0Async($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_0'][0]) + public function updateWarehouseStatusAsync($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - return $this->updateStocks_0AsyncWithHttpInfo($campaign_id, $update_stocks_request, $contentType) + return $this->updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -66067,21 +51305,21 @@ class FbsApi } /** - * Operation updateStocks_0AsyncWithHttpInfo + * Operation updateWarehouseStatusAsyncWithHttpInfo * - * Передача информации об остатках + * Изменение статуса склада * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStocks_0AsyncWithHttpInfo($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_0'][0]) + public function updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateStocks_0Request($campaign_id, $update_stocks_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse'; + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -66120,37 +51358,37 @@ class FbsApi } /** - * Create request for operation 'updateStocks_0' + * Create request for operation 'updateWarehouseStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateStocks_0Request($campaign_id, $update_stocks_request, string $contentType = self::contentTypes['updateStocks_0'][0]) + public function updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateStocks_0' + 'Missing the required parameter $campaign_id when calling updateWarehouseStatus' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateStocks_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbsApi.updateWarehouseStatus, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_stocks_request' is set - if ($update_stocks_request === null || (is_array($update_stocks_request) && count($update_stocks_request) === 0)) { + // verify the required parameter 'update_warehouse_status_request' is set + if ($update_warehouse_status_request === null || (is_array($update_warehouse_status_request) && count($update_warehouse_status_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_stocks_request when calling updateStocks_0' + 'Missing the required parameter $update_warehouse_status_request when calling updateWarehouseStatus' ); } - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/warehouse/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -66176,12 +51414,12 @@ class FbsApi ); // for model (json/xml) - if (isset($update_stocks_request)) { + if (isset($update_warehouse_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stocks_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_warehouse_status_request)); } else { - $httpBody = $update_stocks_request; + $httpBody = $update_warehouse_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -66231,7 +51469,7 @@ class FbsApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -66254,6 +51492,57 @@ class FbsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/FbyApi.php b/erp24/lib/yandex_market_api/Api/FbyApi.php index b4b89a6a..41b529c3 100644 --- a/erp24/lib/yandex_market_api/Api/FbyApi.php +++ b/erp24/lib/yandex_market_api/Api/FbyApi.php @@ -1,7 +1,7 @@ [ + 'addHiddenOffers' => [ 'application/json', ], - 'addOffersToArchive_1' => [ + 'addOffersToArchive' => [ 'application/json', ], - 'calculateTariffs_1' => [ + 'calculateTariffs' => [ 'application/json', ], - 'confirmBusinessPrices_1' => [ + 'confirmBusinessPrices' => [ 'application/json', ], - 'confirmCampaignPrices_1' => [ + 'confirmCampaignPrices' => [ 'application/json', ], - 'createChat_2' => [ + 'createChat' => [ 'application/json', ], - 'deleteCampaignOffers_1' => [ + 'deleteCampaignOffers' => [ 'application/json', ], - 'deleteGoodsFeedbackComment_0' => [ + 'deleteGoodsFeedbackComment' => [ 'application/json', ], - 'deleteHiddenOffers_0' => [ + 'deleteHiddenOffers' => [ 'application/json', ], - 'deleteOffersFromArchive_1' => [ + 'deleteOffers' => [ 'application/json', ], - 'deleteOffers_1' => [ + 'deleteOffersFromArchive' => [ 'application/json', ], - 'deletePromoOffers_0' => [ + 'deletePromoOffers' => [ 'application/json', ], - 'generateBoostConsolidatedReport_0' => [ + 'generateBannersStatisticsReport' => [ 'application/json', ], - 'generateCompetitorsPositionReport_0' => [ + 'generateBarcodesReport' => [ 'application/json', ], - 'generateGoodsFeedbackReport_0' => [ + 'generateBoostConsolidatedReport' => [ 'application/json', ], - 'generateGoodsMovementReport_0' => [ + 'generateClosureDocumentsDetalizationReport' => [ 'application/json', ], - 'generateGoodsRealizationReport_0' => [ + 'generateClosureDocumentsReport' => [ 'application/json', ], - 'generateGoodsTurnoverReport_0' => [ + 'generateCompetitorsPositionReport' => [ 'application/json', ], - 'generatePricesReport_0' => [ + 'generateGoodsFeedbackReport' => [ 'application/json', ], - 'generateShelfsStatisticsReport_0' => [ + 'generateGoodsMovementReport' => [ 'application/json', ], - 'generateShowsSalesReport_0' => [ + 'generateGoodsPricesReport' => [ 'application/json', ], - 'generateStocksOnWarehousesReport_0' => [ + 'generateGoodsRealizationReport' => [ 'application/json', ], - 'generateUnitedMarketplaceServicesReport_0' => [ + 'generateGoodsTurnoverReport' => [ 'application/json', ], - 'generateUnitedNettingReport_0' => [ + 'generateJewelryFiscalReport' => [ 'application/json', ], - 'generateUnitedOrdersReport_0' => [ + 'generateKeyIndicatorsReport' => [ 'application/json', ], - 'getAllOffers_3' => [ + 'generateOfferBarcodes' => [ 'application/json', ], - 'getBidsInfoForBusiness_2' => [ + 'generatePricesReport' => [ 'application/json', ], - 'getBidsRecommendations_2' => [ + 'generateSalesGeographyReport' => [ 'application/json', ], - 'getBusinessQuarantineOffers_1' => [ + 'generateShelfsStatisticsReport' => [ 'application/json', ], - 'getBusinessSettings_2' => [ + 'generateShowsBoostReport' => [ 'application/json', ], - 'getCampaignLogins_3' => [ + 'generateShowsSalesReport' => [ 'application/json', ], - 'getCampaignOffers_1' => [ + 'generateStocksOnWarehousesReport' => [ 'application/json', ], - 'getCampaignQuarantineOffers_1' => [ + 'generateUnitedMarketplaceServicesReport' => [ 'application/json', ], - 'getCampaignRegion_1' => [ + 'generateUnitedNettingReport' => [ 'application/json', ], - 'getCampaignSettings_3' => [ + 'generateUnitedOrdersReport' => [ 'application/json', ], - 'getCampaign_3' => [ + 'generateUnitedReturnsReport' => [ 'application/json', ], - 'getCampaignsByLogin_3' => [ + 'getAuthTokenInfo' => [ 'application/json', ], - 'getCampaigns_3' => [ + 'getBidsInfoForBusiness' => [ 'application/json', ], - 'getCategoriesMaxSaleQuantum_0' => [ + 'getBidsRecommendations' => [ 'application/json', ], - 'getCategoriesTree_0' => [ + 'getBusinessOrders' => [ 'application/json', ], - 'getCategoryContentParameters_1' => [ + 'getBusinessQuarantineOffers' => [ 'application/json', ], - 'getChatHistory_2' => [ + 'getBusinessSettings' => [ 'application/json', ], - 'getChats_2' => [ + 'getCampaign' => [ 'application/json', ], - 'getFeedIndexLogs_3' => [ + 'getCampaignOffers' => [ 'application/json', ], - 'getFeed_3' => [ + 'getCampaignQuarantineOffers' => [ 'application/json', ], - 'getFeedbackAndCommentUpdates_1' => [ + 'getCampaignSettings' => [ 'application/json', ], - 'getFeeds_3' => [ + 'getCampaigns' => [ 'application/json', ], - 'getFulfillmentWarehouses_0' => [ + 'getCategoriesMaxSaleQuantum' => [ 'application/json', ], - 'getGoodsFeedbackComments_0' => [ + 'getCategoriesTree' => [ 'application/json', ], - 'getGoodsFeedbacks_0' => [ + 'getCategoryContentParameters' => [ 'application/json', ], - 'getGoodsStats_0' => [ + 'getChat' => [ 'application/json', ], - 'getHiddenOffers_0' => [ + 'getChatHistory' => [ 'application/json', ], - 'getOfferCardsContentStatus_1' => [ + 'getChatMessage' => [ 'application/json', ], - 'getOfferMappingEntries_0' => [ + 'getChats' => [ 'application/json', ], - 'getOfferMappings_1' => [ + 'getDefaultPrices' => [ 'application/json', ], - 'getOfferRecommendations_1' => [ + 'getFulfillmentWarehouses' => [ 'application/json', ], - 'getOffers_3' => [ + 'getGoodsFeedbackComments' => [ 'application/json', ], - 'getOrderBusinessBuyerInfo_1' => [ + 'getGoodsFeedbacks' => [ 'application/json', ], - 'getOrderBusinessDocumentsInfo_1' => [ + 'getGoodsQuestionAnswers' => [ 'application/json', ], - 'getOrder_0' => [ + 'getGoodsQuestions' => [ 'application/json', ], - 'getOrdersStats_0' => [ + 'getGoodsStats' => [ 'application/json', ], - 'getOrders_2' => [ + 'getHiddenOffers' => [ 'application/json', ], - 'getPricesByOfferIds_0' => [ + 'getOfferCardsContentStatus' => [ 'application/json', ], - 'getPrices_0' => [ + 'getOfferMappingEntries' => [ 'application/json', ], - 'getPromoOffers_0' => [ + 'getOfferMappings' => [ 'application/json', ], - 'getPromos_0' => [ + 'getOfferRecommendations' => [ 'application/json', ], - 'getQualityRatings_0' => [ + 'getOrder' => [ 'application/json', ], - 'getReportInfo_0' => [ + 'getOrderBusinessBuyerInfo' => [ 'application/json', ], - 'getReturnPhoto_3' => [ + 'getOrderBusinessDocumentsInfo' => [ 'application/json', ], - 'getReturn_3' => [ + 'getOrders' => [ 'application/json', ], - 'getReturns_3' => [ + 'getOrdersStats' => [ 'application/json', ], - 'getStocks_0' => [ + 'getPrices' => [ 'application/json', ], - 'getSuggestedOfferMappingEntries_0' => [ + 'getPricesByOfferIds' => [ 'application/json', ], - 'getSuggestedOfferMappings_1' => [ + 'getPromoOffers' => [ 'application/json', ], - 'getSuggestedPrices_0' => [ + 'getPromos' => [ 'application/json', ], - 'putBidsForBusiness_2' => [ + 'getQualityRatings' => [ 'application/json', ], - 'putBidsForCampaign_3' => [ + 'getRegionsCodes' => [ 'application/json', ], - 'refreshFeed_3' => [ + 'getReportInfo' => [ 'application/json', ], - 'searchRegionChildren_0' => [ + 'getReturn' => [ 'application/json', ], - 'searchRegionsById_0' => [ + 'getReturnApplication' => [ 'application/json', ], - 'searchRegionsByName_0' => [ + 'getReturnPhoto' => [ 'application/json', ], - 'sendFileToChat_2' => [ + 'getReturns' => [ + 'application/json', + ], + 'getStocks' => [ + 'application/json', + ], + 'getSuggestedOfferMappingEntries' => [ + 'application/json', + ], + 'getSuggestedOfferMappings' => [ + 'application/json', + ], + 'getSupplyRequestDocuments' => [ + 'application/json', + ], + 'getSupplyRequestItems' => [ + 'application/json', + ], + 'getSupplyRequests' => [ + 'application/json', + ], + 'putBidsForBusiness' => [ + 'application/json', + ], + 'putBidsForCampaign' => [ + 'application/json', + ], + 'searchRegionChildren' => [ + 'application/json', + ], + 'searchRegionsById' => [ + 'application/json', + ], + 'searchRegionsByName' => [ + 'application/json', + ], + 'sendFileToChat' => [ 'multipart/form-data', ], - 'sendMessageToChat_2' => [ + 'sendMessageToChat' => [ + 'application/json', + ], + 'skipGoodsFeedbacksReaction' => [ 'application/json', ], - 'setFeedParams_3' => [ + 'submitReturnDecision' => [ 'application/json', ], - 'skipGoodsFeedbacksReaction_0' => [ + 'updateBusinessPrices' => [ 'application/json', ], - 'updateBusinessPrices_0' => [ + 'updateCampaignOffers' => [ 'application/json', ], - 'updateCampaignOffers_1' => [ + 'updateGoodsFeedbackComment' => [ 'application/json', ], - 'updateGoodsFeedbackComment_0' => [ + 'updateGoodsQuestionTextEntity' => [ 'application/json', ], - 'updateOfferContent_1' => [ + 'updateOfferContent' => [ 'application/json', ], - 'updateOfferMappingEntries_0' => [ + 'updateOfferMappingEntries' => [ 'application/json', ], - 'updateOfferMappings_1' => [ + 'updateOfferMappings' => [ 'application/json', ], - 'updatePrices_0' => [ + 'updatePrices' => [ 'application/json', ], - 'updatePromoOffers_0' => [ + 'updatePromoOffers' => [ 'application/json', ], ]; @@ -359,10 +401,10 @@ class FbyApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -399,40 +441,40 @@ class FbyApi } /** - * Operation addHiddenOffers_0 + * Operation addHiddenOffers * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addHiddenOffers_0($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_0'][0]) + public function addHiddenOffers($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - list($response) = $this->addHiddenOffers_0WithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); + list($response) = $this->addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType); return $response; } /** - * Operation addHiddenOffers_0WithHttpInfo + * Operation addHiddenOffersWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addHiddenOffers_0WithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_0'][0]) + public function addHiddenOffersWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - $request = $this->addHiddenOffers_0Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -459,196 +501,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -662,34 +559,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -699,7 +573,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -707,7 +581,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -715,7 +589,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -723,7 +597,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -731,7 +605,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -739,7 +613,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -747,27 +621,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addHiddenOffers_0Async + * Operation addHiddenOffersAsync * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_0Async($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_0'][0]) + public function addHiddenOffersAsync($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { - return $this->addHiddenOffers_0AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) + return $this->addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -776,21 +652,21 @@ class FbyApi } /** - * Operation addHiddenOffers_0AsyncWithHttpInfo + * Operation addHiddenOffersAsyncWithHttpInfo * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addHiddenOffers_0AsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_0'][0]) + public function addHiddenOffersAsyncWithHttpInfo($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->addHiddenOffers_0Request($campaign_id, $add_hidden_offers_request, $contentType); + $request = $this->addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -829,37 +705,37 @@ class FbyApi } /** - * Create request for operation 'addHiddenOffers_0' + * Create request for operation 'addHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addHiddenOffers_0Request($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers_0'][0]) + public function addHiddenOffersRequest($campaign_id, $add_hidden_offers_request, string $contentType = self::contentTypes['addHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling addHiddenOffers_0' + 'Missing the required parameter $campaign_id when calling addHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.addHiddenOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.addHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'add_hidden_offers_request' is set if ($add_hidden_offers_request === null || (is_array($add_hidden_offers_request) && count($add_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers_0' + 'Missing the required parameter $add_hidden_offers_request when calling addHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -948,40 +824,40 @@ class FbyApi } /** - * Operation addOffersToArchive_1 + * Operation addOffersToArchive * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function addOffersToArchive_1($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_1'][0]) + public function addOffersToArchive($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - list($response) = $this->addOffersToArchive_1WithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); + list($response) = $this->addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType); return $response; } /** - * Operation addOffersToArchive_1WithHttpInfo + * Operation addOffersToArchiveWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AddOffersToArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addOffersToArchive_1WithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_1'][0]) + public function addOffersToArchiveWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - $request = $this->addOffersToArchive_1Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1008,223 +884,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\AddOffersToArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AddOffersToArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1238,34 +948,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\AddOffersToArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1275,7 +962,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1283,7 +970,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1291,7 +978,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1299,7 +986,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1307,7 +994,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1315,7 +1002,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1323,7 +1010,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1331,27 +1018,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation addOffersToArchive_1Async + * Operation addOffersToArchiveAsync * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_1Async($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_1'][0]) + public function addOffersToArchiveAsync($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { - return $this->addOffersToArchive_1AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) + return $this->addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1360,21 +1049,21 @@ class FbyApi } /** - * Operation addOffersToArchive_1AsyncWithHttpInfo + * Operation addOffersToArchiveAsyncWithHttpInfo * * Добавление товаров в архив * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addOffersToArchive_1AsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_1'][0]) + public function addOffersToArchiveAsyncWithHttpInfo($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { $returnType = '\OpenAPI\Client\Model\AddOffersToArchiveResponse'; - $request = $this->addOffersToArchive_1Request($business_id, $add_offers_to_archive_request, $contentType); + $request = $this->addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1413,37 +1102,37 @@ class FbyApi } /** - * Create request for operation 'addOffersToArchive_1' + * Create request for operation 'addOffersToArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\AddOffersToArchiveRequest $add_offers_to_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addOffersToArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addOffersToArchive_1Request($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive_1'][0]) + public function addOffersToArchiveRequest($business_id, $add_offers_to_archive_request, string $contentType = self::contentTypes['addOffersToArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling addOffersToArchive_1' + 'Missing the required parameter $business_id when calling addOffersToArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.addOffersToArchive_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.addOffersToArchive, must be bigger than or equal to 1.'); } // verify the required parameter 'add_offers_to_archive_request' is set if ($add_offers_to_archive_request === null || (is_array($add_offers_to_archive_request) && count($add_offers_to_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive_1' + 'Missing the required parameter $add_offers_to_archive_request when calling addOffersToArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/archive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1532,38 +1221,38 @@ class FbyApi } /** - * Operation calculateTariffs_1 + * Operation calculateTariffs * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function calculateTariffs_1($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_1'][0]) + public function calculateTariffs($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - list($response) = $this->calculateTariffs_1WithHttpInfo($calculate_tariffs_request, $contentType); + list($response) = $this->calculateTariffsWithHttpInfo($calculate_tariffs_request, $contentType); return $response; } /** - * Operation calculateTariffs_1WithHttpInfo + * Operation calculateTariffsWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CalculateTariffsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function calculateTariffs_1WithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_1'][0]) + public function calculateTariffsWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - $request = $this->calculateTariffs_1Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1590,196 +1279,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CalculateTariffsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1793,34 +1337,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1830,7 +1351,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1838,7 +1359,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1846,7 +1367,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1854,7 +1375,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1862,7 +1383,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1870,7 +1391,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1878,26 +1399,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation calculateTariffs_1Async + * Operation calculateTariffsAsync * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_1Async($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_1'][0]) + public function calculateTariffsAsync($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { - return $this->calculateTariffs_1AsyncWithHttpInfo($calculate_tariffs_request, $contentType) + return $this->calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1906,20 +1429,20 @@ class FbyApi } /** - * Operation calculateTariffs_1AsyncWithHttpInfo + * Operation calculateTariffsAsyncWithHttpInfo * * Калькулятор стоимости услуг * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function calculateTariffs_1AsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_1'][0]) + public function calculateTariffsAsyncWithHttpInfo($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - $request = $this->calculateTariffs_1Request($calculate_tariffs_request, $contentType); + $request = $this->calculateTariffsRequest($calculate_tariffs_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1958,26 +1481,26 @@ class FbyApi } /** - * Create request for operation 'calculateTariffs_1' + * Create request for operation 'calculateTariffs' * * @param \OpenAPI\Client\Model\CalculateTariffsRequest $calculate_tariffs_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateTariffs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function calculateTariffs_1Request($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs_1'][0]) + public function calculateTariffsRequest($calculate_tariffs_request, string $contentType = self::contentTypes['calculateTariffs'][0]) { // verify the required parameter 'calculate_tariffs_request' is set if ($calculate_tariffs_request === null || (is_array($calculate_tariffs_request) && count($calculate_tariffs_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs_1' + 'Missing the required parameter $calculate_tariffs_request when calling calculateTariffs' ); } - $resourcePath = '/tariffs/calculate'; + $resourcePath = '/v2/tariffs/calculate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2058,40 +1581,40 @@ class FbyApi } /** - * Operation confirmBusinessPrices_1 + * Operation confirmBusinessPrices * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmBusinessPrices_1($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_1'][0]) + public function confirmBusinessPrices($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - list($response) = $this->confirmBusinessPrices_1WithHttpInfo($business_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmBusinessPrices_1WithHttpInfo + * Operation confirmBusinessPricesWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmBusinessPrices_1WithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_1'][0]) + public function confirmBusinessPricesWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - $request = $this->confirmBusinessPrices_1Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2118,223 +1641,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2348,34 +1705,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2385,7 +1719,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2393,7 +1727,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2401,7 +1735,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2409,7 +1743,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2417,7 +1751,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2425,7 +1759,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2433,7 +1767,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2441,27 +1775,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmBusinessPrices_1Async + * Operation confirmBusinessPricesAsync * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_1Async($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_1'][0]) + public function confirmBusinessPricesAsync($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { - return $this->confirmBusinessPrices_1AsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) + return $this->confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2470,21 +1806,21 @@ class FbyApi } /** - * Operation confirmBusinessPrices_1AsyncWithHttpInfo + * Operation confirmBusinessPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmBusinessPrices_1AsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_1'][0]) + public function confirmBusinessPricesAsyncWithHttpInfo($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmBusinessPrices_1Request($business_id, $confirm_prices_request, $contentType); + $request = $this->confirmBusinessPricesRequest($business_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2523,37 +1859,37 @@ class FbyApi } /** - * Create request for operation 'confirmBusinessPrices_1' + * Create request for operation 'confirmBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmBusinessPrices_1Request($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices_1'][0]) + public function confirmBusinessPricesRequest($business_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmBusinessPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling confirmBusinessPrices_1' + 'Missing the required parameter $business_id when calling confirmBusinessPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.confirmBusinessPrices_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.confirmBusinessPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices_1' + 'Missing the required parameter $confirm_prices_request when calling confirmBusinessPrices' ); } - $resourcePath = '/businesses/{businessId}/price-quarantine/confirm'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2642,40 +1978,40 @@ class FbyApi } /** - * Operation confirmCampaignPrices_1 + * Operation confirmCampaignPrices * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function confirmCampaignPrices_1($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_1'][0]) + public function confirmCampaignPrices($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - list($response) = $this->confirmCampaignPrices_1WithHttpInfo($campaign_id, $confirm_prices_request, $contentType); + list($response) = $this->confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, $contentType); return $response; } /** - * Operation confirmCampaignPrices_1WithHttpInfo + * Operation confirmCampaignPricesWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function confirmCampaignPrices_1WithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_1'][0]) + public function confirmCampaignPricesWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - $request = $this->confirmCampaignPrices_1Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2702,223 +2038,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2932,34 +2102,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2969,7 +2116,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2977,7 +2124,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2985,7 +2132,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2993,7 +2140,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3001,7 +2148,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3009,7 +2156,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3017,7 +2164,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3025,27 +2172,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation confirmCampaignPrices_1Async + * Operation confirmCampaignPricesAsync * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_1Async($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_1'][0]) + public function confirmCampaignPricesAsync($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { - return $this->confirmCampaignPrices_1AsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) + return $this->confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3054,21 +2203,21 @@ class FbyApi } /** - * Operation confirmCampaignPrices_1AsyncWithHttpInfo + * Operation confirmCampaignPricesAsyncWithHttpInfo * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function confirmCampaignPrices_1AsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_1'][0]) + public function confirmCampaignPricesAsyncWithHttpInfo($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->confirmCampaignPrices_1Request($campaign_id, $confirm_prices_request, $contentType); + $request = $this->confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3107,37 +2256,37 @@ class FbyApi } /** - * Create request for operation 'confirmCampaignPrices_1' + * Create request for operation 'confirmCampaignPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function confirmCampaignPrices_1Request($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices_1'][0]) + public function confirmCampaignPricesRequest($campaign_id, $confirm_prices_request, string $contentType = self::contentTypes['confirmCampaignPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling confirmCampaignPrices_1' + 'Missing the required parameter $campaign_id when calling confirmCampaignPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.confirmCampaignPrices_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.confirmCampaignPrices, must be bigger than or equal to 1.'); } // verify the required parameter 'confirm_prices_request' is set if ($confirm_prices_request === null || (is_array($confirm_prices_request) && count($confirm_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices_1' + 'Missing the required parameter $confirm_prices_request when calling confirmCampaignPrices' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3226,40 +2375,40 @@ class FbyApi } /** - * Operation createChat_2 + * Operation createChat * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function createChat_2($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_2'][0]) + public function createChat($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - list($response) = $this->createChat_2WithHttpInfo($business_id, $create_chat_request, $contentType); + list($response) = $this->createChatWithHttpInfo($business_id, $create_chat_request, $contentType); return $response; } /** - * Operation createChat_2WithHttpInfo + * Operation createChatWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\CreateChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createChat_2WithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_2'][0]) + public function createChatWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - $request = $this->createChat_2Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3286,196 +2435,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateChatResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateChatResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateChatResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3489,34 +2493,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3526,7 +2507,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3534,7 +2515,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3542,7 +2523,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3550,7 +2531,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3558,7 +2539,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3566,7 +2547,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3574,27 +2555,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation createChat_2Async + * Operation createChatAsync * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_2Async($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_2'][0]) + public function createChatAsync($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { - return $this->createChat_2AsyncWithHttpInfo($business_id, $create_chat_request, $contentType) + return $this->createChatAsyncWithHttpInfo($business_id, $create_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3603,21 +2586,21 @@ class FbyApi } /** - * Operation createChat_2AsyncWithHttpInfo + * Operation createChatAsyncWithHttpInfo * * Создание нового чата с покупателем * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createChat_2AsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_2'][0]) + public function createChatAsyncWithHttpInfo($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { $returnType = '\OpenAPI\Client\Model\CreateChatResponse'; - $request = $this->createChat_2Request($business_id, $create_chat_request, $contentType); + $request = $this->createChatRequest($business_id, $create_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3656,37 +2639,37 @@ class FbyApi } /** - * Create request for operation 'createChat_2' + * Create request for operation 'createChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\CreateChatRequest $create_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createChat_2Request($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat_2'][0]) + public function createChatRequest($business_id, $create_chat_request, string $contentType = self::contentTypes['createChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling createChat_2' + 'Missing the required parameter $business_id when calling createChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.createChat_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.createChat, must be bigger than or equal to 1.'); } // verify the required parameter 'create_chat_request' is set if ($create_chat_request === null || (is_array($create_chat_request) && count($create_chat_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_chat_request when calling createChat_2' + 'Missing the required parameter $create_chat_request when calling createChat' ); } - $resourcePath = '/businesses/{businessId}/chats/new'; + $resourcePath = '/v2/businesses/{businessId}/chats/new'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3775,40 +2758,40 @@ class FbyApi } /** - * Operation deleteCampaignOffers_1 + * Operation deleteCampaignOffers * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteCampaignOffers_1($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_1'][0]) + public function deleteCampaignOffers($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - list($response) = $this->deleteCampaignOffers_1WithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); + list($response) = $this->deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); return $response; } /** - * Operation deleteCampaignOffers_1WithHttpInfo + * Operation deleteCampaignOffersWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteCampaignOffers_1WithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_1'][0]) + public function deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - $request = $this->deleteCampaignOffers_1Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3835,223 +2818,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4065,34 +2882,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4102,7 +2896,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4110,7 +2904,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4118,7 +2912,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4126,7 +2920,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4134,7 +2928,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4142,7 +2936,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4150,7 +2944,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4158,27 +2952,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteCampaignOffers_1Async + * Operation deleteCampaignOffersAsync * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_1Async($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_1'][0]) + public function deleteCampaignOffersAsync($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { - return $this->deleteCampaignOffers_1AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) + return $this->deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4187,21 +2983,21 @@ class FbyApi } /** - * Operation deleteCampaignOffers_1AsyncWithHttpInfo + * Operation deleteCampaignOffersAsyncWithHttpInfo * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteCampaignOffers_1AsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_1'][0]) + public function deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - $request = $this->deleteCampaignOffers_1Request($campaign_id, $delete_campaign_offers_request, $contentType); + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4240,37 +3036,37 @@ class FbyApi } /** - * Create request for operation 'deleteCampaignOffers_1' + * Create request for operation 'deleteCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteCampaignOffers_1Request($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers_1'][0]) + public function deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteCampaignOffers_1' + 'Missing the required parameter $campaign_id when calling deleteCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.deleteCampaignOffers_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.deleteCampaignOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_campaign_offers_request' is set if ($delete_campaign_offers_request === null || (is_array($delete_campaign_offers_request) && count($delete_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers_1' + 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers' ); } - $resourcePath = '/campaigns/{campaignId}/offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4359,40 +3155,40 @@ class FbyApi } /** - * Operation deleteGoodsFeedbackComment_0 + * Operation deleteGoodsFeedbackComment * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteGoodsFeedbackComment_0($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_0'][0]) + public function deleteGoodsFeedbackComment($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - list($response) = $this->deleteGoodsFeedbackComment_0WithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); + list($response) = $this->deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation deleteGoodsFeedbackComment_0WithHttpInfo + * Operation deleteGoodsFeedbackCommentWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteGoodsFeedbackComment_0WithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_0'][0]) + public function deleteGoodsFeedbackCommentWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - $request = $this->deleteGoodsFeedbackComment_0Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4419,196 +3215,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4622,34 +3273,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4659,7 +3287,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4667,7 +3295,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4675,7 +3303,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4683,7 +3311,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4691,7 +3319,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4699,7 +3327,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4707,27 +3335,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteGoodsFeedbackComment_0Async + * Operation deleteGoodsFeedbackCommentAsync * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_0Async($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_0'][0]) + public function deleteGoodsFeedbackCommentAsync($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { - return $this->deleteGoodsFeedbackComment_0AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) + return $this->deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4736,21 +3366,21 @@ class FbyApi } /** - * Operation deleteGoodsFeedbackComment_0AsyncWithHttpInfo + * Operation deleteGoodsFeedbackCommentAsyncWithHttpInfo * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteGoodsFeedbackComment_0AsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_0'][0]) + public function deleteGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteGoodsFeedbackComment_0Request($business_id, $delete_goods_feedback_comment_request, $contentType); + $request = $this->deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4789,37 +3419,37 @@ class FbyApi } /** - * Create request for operation 'deleteGoodsFeedbackComment_0' + * Create request for operation 'deleteGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteGoodsFeedbackComment_0Request($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment_0'][0]) + public function deleteGoodsFeedbackCommentRequest($business_id, $delete_goods_feedback_comment_request, string $contentType = self::contentTypes['deleteGoodsFeedbackComment'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment_0' + 'Missing the required parameter $business_id when calling deleteGoodsFeedbackComment' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deleteGoodsFeedbackComment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deleteGoodsFeedbackComment, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_goods_feedback_comment_request' is set if ($delete_goods_feedback_comment_request === null || (is_array($delete_goods_feedback_comment_request) && count($delete_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment_0' + 'Missing the required parameter $delete_goods_feedback_comment_request when calling deleteGoodsFeedbackComment' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/delete'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4908,40 +3538,40 @@ class FbyApi } /** - * Operation deleteHiddenOffers_0 + * Operation deleteHiddenOffers * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteHiddenOffers_0($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_0'][0]) + public function deleteHiddenOffers($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - list($response) = $this->deleteHiddenOffers_0WithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); + list($response) = $this->deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType); return $response; } /** - * Operation deleteHiddenOffers_0WithHttpInfo + * Operation deleteHiddenOffersWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteHiddenOffers_0WithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_0'][0]) + public function deleteHiddenOffersWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - $request = $this->deleteHiddenOffers_0Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4968,223 +3598,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5198,34 +3662,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5235,7 +3676,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5243,7 +3684,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5251,7 +3692,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5259,7 +3700,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5267,7 +3708,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5275,7 +3716,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5283,7 +3724,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5291,27 +3732,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteHiddenOffers_0Async + * Operation deleteHiddenOffersAsync * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_0Async($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_0'][0]) + public function deleteHiddenOffersAsync($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { - return $this->deleteHiddenOffers_0AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) + return $this->deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5320,21 +3763,21 @@ class FbyApi } /** - * Operation deleteHiddenOffers_0AsyncWithHttpInfo + * Operation deleteHiddenOffersAsyncWithHttpInfo * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteHiddenOffers_0AsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_0'][0]) + public function deleteHiddenOffersAsyncWithHttpInfo($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->deleteHiddenOffers_0Request($campaign_id, $delete_hidden_offers_request, $contentType); + $request = $this->deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5373,37 +3816,37 @@ class FbyApi } /** - * Create request for operation 'deleteHiddenOffers_0' + * Create request for operation 'deleteHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteHiddenOffers_0Request($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers_0'][0]) + public function deleteHiddenOffersRequest($campaign_id, $delete_hidden_offers_request, string $contentType = self::contentTypes['deleteHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling deleteHiddenOffers_0' + 'Missing the required parameter $campaign_id when calling deleteHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.deleteHiddenOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.deleteHiddenOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_hidden_offers_request' is set if ($delete_hidden_offers_request === null || (is_array($delete_hidden_offers_request) && count($delete_hidden_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers_0' + 'Missing the required parameter $delete_hidden_offers_request when calling deleteHiddenOffers' ); } - $resourcePath = '/campaigns/{campaignId}/hidden-offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5492,40 +3935,40 @@ class FbyApi } /** - * Operation deleteOffersFromArchive_1 + * Operation deleteOffers * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffersFromArchive_1($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_1'][0]) + public function deleteOffers($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - list($response) = $this->deleteOffersFromArchive_1WithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); + list($response) = $this->deleteOffersWithHttpInfo($business_id, $delete_offers_request, $contentType); return $response; } /** - * Operation deleteOffersFromArchive_1WithHttpInfo + * Operation deleteOffersWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffersFromArchive_1WithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_1'][0]) + public function deleteOffersWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $request = $this->deleteOffersFromArchive_1Request($business_id, $delete_offers_from_archive_request, $contentType); + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -5552,223 +3995,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5782,44 +4059,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + '\OpenAPI\Client\Model\DeleteOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5827,7 +4081,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5835,7 +4089,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5843,7 +4097,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5851,7 +4105,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5859,7 +4113,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5867,7 +4121,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5875,27 +4129,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffersFromArchive_1Async + * Operation deleteOffersAsync * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_1Async($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_1'][0]) + public function deleteOffersAsync($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - return $this->deleteOffersFromArchive_1AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) + return $this->deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -5904,21 +4160,21 @@ class FbyApi } /** - * Operation deleteOffersFromArchive_1AsyncWithHttpInfo + * Operation deleteOffersAsyncWithHttpInfo * - * Удаление товаров из архива + * Удаление товаров из каталога * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffersFromArchive_1AsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_1'][0]) + public function deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; - $request = $this->deleteOffersFromArchive_1Request($business_id, $delete_offers_from_archive_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5957,37 +4213,37 @@ class FbyApi } /** - * Create request for operation 'deleteOffersFromArchive_1' + * Create request for operation 'deleteOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffersFromArchive_1Request($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive_1'][0]) + public function deleteOffersRequest($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffersFromArchive_1' + 'Missing the required parameter $business_id when calling deleteOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deleteOffersFromArchive_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deleteOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_from_archive_request' is set - if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { + // verify the required parameter 'delete_offers_request' is set + if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive_1' + 'Missing the required parameter $delete_offers_request when calling deleteOffers' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/unarchive'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6013,12 +4269,12 @@ class FbyApi ); // for model (json/xml) - if (isset($delete_offers_from_archive_request)) { + if (isset($delete_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); } else { - $httpBody = $delete_offers_from_archive_request; + $httpBody = $delete_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6076,40 +4332,40 @@ class FbyApi } /** - * Operation deleteOffers_1 + * Operation deleteOffersFromArchive * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deleteOffers_1($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_1'][0]) + public function deleteOffersFromArchive($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - list($response) = $this->deleteOffers_1WithHttpInfo($business_id, $delete_offers_request, $contentType); + list($response) = $this->deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType); return $response; } /** - * Operation deleteOffers_1WithHttpInfo + * Operation deleteOffersFromArchiveWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\DeleteOffersFromArchiveResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOffers_1WithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_1'][0]) + public function deleteOffersFromArchiveWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $request = $this->deleteOffers_1Request($business_id, $delete_offers_request, $contentType); + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6136,223 +4392,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6366,44 +4456,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\DeleteOffersResponse', + '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6411,7 +4478,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6419,7 +4486,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6427,7 +4494,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6435,7 +4502,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6443,7 +4510,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6451,7 +4518,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6459,27 +4526,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deleteOffers_1Async + * Operation deleteOffersFromArchiveAsync * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_1Async($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_1'][0]) + public function deleteOffersFromArchiveAsync($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - return $this->deleteOffers_1AsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) + return $this->deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, $contentType) ->then( function ($response) { return $response[0]; @@ -6488,21 +4557,21 @@ class FbyApi } /** - * Operation deleteOffers_1AsyncWithHttpInfo + * Operation deleteOffersFromArchiveAsyncWithHttpInfo * - * Удаление товаров из каталога + * Удаление товаров из архива * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOffers_1AsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_1'][0]) + public function deleteOffersFromArchiveAsyncWithHttpInfo($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { - $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; - $request = $this->deleteOffers_1Request($business_id, $delete_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\DeleteOffersFromArchiveResponse'; + $request = $this->deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6541,37 +4610,37 @@ class FbyApi } /** - * Create request for operation 'deleteOffers_1' + * Create request for operation 'deleteOffersFromArchive' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersFromArchiveRequest $delete_offers_from_archive_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffersFromArchive'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOffers_1Request($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers_1'][0]) + public function deleteOffersFromArchiveRequest($business_id, $delete_offers_from_archive_request, string $contentType = self::contentTypes['deleteOffersFromArchive'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deleteOffers_1' + 'Missing the required parameter $business_id when calling deleteOffersFromArchive' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deleteOffers_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deleteOffersFromArchive, must be bigger than or equal to 1.'); } - // verify the required parameter 'delete_offers_request' is set - if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { + // verify the required parameter 'delete_offers_from_archive_request' is set + if ($delete_offers_from_archive_request === null || (is_array($delete_offers_from_archive_request) && count($delete_offers_from_archive_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_offers_request when calling deleteOffers_1' + 'Missing the required parameter $delete_offers_from_archive_request when calling deleteOffersFromArchive' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/delete'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/unarchive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6597,12 +4666,12 @@ class FbyApi ); // for model (json/xml) - if (isset($delete_offers_request)) { + if (isset($delete_offers_from_archive_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_from_archive_request)); } else { - $httpBody = $delete_offers_request; + $httpBody = $delete_offers_from_archive_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6660,40 +4729,40 @@ class FbyApi } /** - * Operation deletePromoOffers_0 + * Operation deletePromoOffers * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function deletePromoOffers_0($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_0'][0]) + public function deletePromoOffers($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - list($response) = $this->deletePromoOffers_0WithHttpInfo($business_id, $delete_promo_offers_request, $contentType); + list($response) = $this->deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, $contentType); return $response; } /** - * Operation deletePromoOffers_0WithHttpInfo + * Operation deletePromoOffersWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DeletePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deletePromoOffers_0WithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_0'][0]) + public function deletePromoOffersWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - $request = $this->deletePromoOffers_0Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -6720,196 +4789,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeletePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6923,34 +4847,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -6960,7 +4861,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6968,7 +4869,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6976,7 +4877,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6984,7 +4885,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6992,7 +4893,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7000,7 +4901,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7008,27 +4909,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation deletePromoOffers_0Async + * Operation deletePromoOffersAsync * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_0Async($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_0'][0]) + public function deletePromoOffersAsync($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { - return $this->deletePromoOffers_0AsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) + return $this->deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -7037,21 +4940,21 @@ class FbyApi } /** - * Operation deletePromoOffers_0AsyncWithHttpInfo + * Operation deletePromoOffersAsyncWithHttpInfo * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePromoOffers_0AsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_0'][0]) + public function deletePromoOffersAsyncWithHttpInfo($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - $request = $this->deletePromoOffers_0Request($business_id, $delete_promo_offers_request, $contentType); + $request = $this->deletePromoOffersRequest($business_id, $delete_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7090,37 +4993,37 @@ class FbyApi } /** - * Create request for operation 'deletePromoOffers_0' + * Create request for operation 'deletePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deletePromoOffers_0Request($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers_0'][0]) + public function deletePromoOffersRequest($business_id, $delete_promo_offers_request, string $contentType = self::contentTypes['deletePromoOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling deletePromoOffers_0' + 'Missing the required parameter $business_id when calling deletePromoOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deletePromoOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.deletePromoOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'delete_promo_offers_request' is set if ($delete_promo_offers_request === null || (is_array($delete_promo_offers_request) && count($delete_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers_0' + 'Missing the required parameter $delete_promo_offers_request when calling deletePromoOffers' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/delete'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7209,40 +5112,40 @@ class FbyApi } /** - * Operation generateBoostConsolidatedReport_0 + * Operation generateBannersStatisticsReport * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateBoostConsolidatedReport_0($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_0'][0]) + public function generateBannersStatisticsReport($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - list($response) = $this->generateBoostConsolidatedReport_0WithHttpInfo($generate_boost_consolidated_request, $format, $contentType); + list($response) = $this->generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format, $contentType); return $response; } /** - * Operation generateBoostConsolidatedReport_0WithHttpInfo + * Operation generateBannersStatisticsReportWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateBoostConsolidatedReport_0WithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_0'][0]) + public function generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - $request = $this->generateBoostConsolidatedReport_0Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -7269,169 +5172,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7445,34 +5224,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -7482,7 +5238,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7490,7 +5246,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7498,7 +5254,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7506,7 +5262,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7514,7 +5270,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7522,27 +5278,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateBoostConsolidatedReport_0Async + * Operation generateBannersStatisticsReportAsync * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_0Async($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_0'][0]) + public function generateBannersStatisticsReportAsync($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - return $this->generateBoostConsolidatedReport_0AsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) + return $this->generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -7551,21 +5309,21 @@ class FbyApi } /** - * Operation generateBoostConsolidatedReport_0AsyncWithHttpInfo + * Operation generateBannersStatisticsReportAsyncWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReport_0AsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_0'][0]) + public function generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateBoostConsolidatedReport_0Request($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7604,28 +5362,28 @@ class FbyApi } /** - * Create request for operation 'generateBoostConsolidatedReport_0' + * Create request for operation 'generateBannersStatisticsReport' * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateBoostConsolidatedReport_0Request($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport_0'][0]) + public function generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - // verify the required parameter 'generate_boost_consolidated_request' is set - if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { + // verify the required parameter 'generate_banners_statistics_request' is set + if ($generate_banners_statistics_request === null || (is_array($generate_banners_statistics_request) && count($generate_banners_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport_0' + 'Missing the required parameter $generate_banners_statistics_request when calling generateBannersStatisticsReport' ); } - $resourcePath = '/reports/boost-consolidated/generate'; + $resourcePath = '/v2/reports/banners-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7652,12 +5410,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_boost_consolidated_request)) { + if (isset($generate_banners_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_banners_statistics_request)); } else { - $httpBody = $generate_boost_consolidated_request; + $httpBody = $generate_banners_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7715,40 +5473,38 @@ class FbyApi } /** - * Operation generateCompetitorsPositionReport_0 + * Operation generateBarcodesReport * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateCompetitorsPositionReport_0($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_0'][0]) + public function generateBarcodesReport($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - list($response) = $this->generateCompetitorsPositionReport_0WithHttpInfo($generate_competitors_position_report_request, $format, $contentType); + list($response) = $this->generateBarcodesReportWithHttpInfo($generate_barcodes_report_request, $contentType); return $response; } /** - * Operation generateCompetitorsPositionReport_0WithHttpInfo + * Operation generateBarcodesReportWithHttpInfo * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateCompetitorsPositionReport_0WithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_0'][0]) + public function generateBarcodesReportWithHttpInfo($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - $request = $this->generateCompetitorsPositionReport_0Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBarcodesReportRequest($generate_barcodes_report_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -7775,169 +5531,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7951,34 +5583,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -7988,7 +5597,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7996,7 +5605,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8004,7 +5613,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8012,7 +5621,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8020,7 +5629,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8028,27 +5637,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateCompetitorsPositionReport_0Async + * Operation generateBarcodesReportAsync * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_0Async($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_0'][0]) + public function generateBarcodesReportAsync($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - return $this->generateCompetitorsPositionReport_0AsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) + return $this->generateBarcodesReportAsyncWithHttpInfo($generate_barcodes_report_request, $contentType) ->then( function ($response) { return $response[0]; @@ -8057,21 +5667,20 @@ class FbyApi } /** - * Operation generateCompetitorsPositionReport_0AsyncWithHttpInfo + * Operation generateBarcodesReportAsyncWithHttpInfo * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReport_0AsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_0'][0]) + public function generateBarcodesReportAsyncWithHttpInfo($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateCompetitorsPositionReport_0Request($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBarcodesReportRequest($generate_barcodes_report_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8110,43 +5719,32 @@ class FbyApi } /** - * Create request for operation 'generateCompetitorsPositionReport_0' + * Create request for operation 'generateBarcodesReport' * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateCompetitorsPositionReport_0Request($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport_0'][0]) + public function generateBarcodesReportRequest($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - // verify the required parameter 'generate_competitors_position_report_request' is set - if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { + // verify the required parameter 'generate_barcodes_report_request' is set + if ($generate_barcodes_report_request === null || (is_array($generate_barcodes_report_request) && count($generate_barcodes_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport_0' + 'Missing the required parameter $generate_barcodes_report_request when calling generateBarcodesReport' ); } - - $resourcePath = '/reports/competitors-position/generate'; + $resourcePath = '/v1/reports/documents/barcodes/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -8158,12 +5756,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_competitors_position_report_request)) { + if (isset($generate_barcodes_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_barcodes_report_request)); } else { - $httpBody = $generate_competitors_position_report_request; + $httpBody = $generate_barcodes_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8221,40 +5819,40 @@ class FbyApi } /** - * Operation generateGoodsFeedbackReport_0 + * Operation generateBoostConsolidatedReport * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsFeedbackReport_0($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_0'][0]) + public function generateBoostConsolidatedReport($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - list($response) = $this->generateGoodsFeedbackReport_0WithHttpInfo($generate_goods_feedback_request, $format, $contentType); + list($response) = $this->generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format, $contentType); return $response; } /** - * Operation generateGoodsFeedbackReport_0WithHttpInfo + * Operation generateBoostConsolidatedReportWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsFeedbackReport_0WithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_0'][0]) + public function generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - $request = $this->generateGoodsFeedbackReport_0Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -8281,169 +5879,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8457,34 +5931,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8494,7 +5945,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8502,7 +5953,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8510,7 +5961,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8518,7 +5969,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8526,7 +5977,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8534,27 +5985,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsFeedbackReport_0Async + * Operation generateBoostConsolidatedReportAsync * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_0Async($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_0'][0]) + public function generateBoostConsolidatedReportAsync($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - return $this->generateGoodsFeedbackReport_0AsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) + return $this->generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -8563,21 +6016,21 @@ class FbyApi } /** - * Operation generateGoodsFeedbackReport_0AsyncWithHttpInfo + * Operation generateBoostConsolidatedReportAsyncWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReport_0AsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_0'][0]) + public function generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsFeedbackReport_0Request($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8616,28 +6069,28 @@ class FbyApi } /** - * Create request for operation 'generateGoodsFeedbackReport_0' + * Create request for operation 'generateBoostConsolidatedReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsFeedbackReport_0Request($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport_0'][0]) + public function generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - // verify the required parameter 'generate_goods_feedback_request' is set - if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { + // verify the required parameter 'generate_boost_consolidated_request' is set + if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport_0' + 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport' ); } - $resourcePath = '/reports/goods-feedback/generate'; + $resourcePath = '/v2/reports/boost-consolidated/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8664,12 +6117,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_goods_feedback_request)) { + if (isset($generate_boost_consolidated_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); } else { - $httpBody = $generate_goods_feedback_request; + $httpBody = $generate_boost_consolidated_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8727,40 +6180,40 @@ class FbyApi } /** - * Operation generateGoodsMovementReport_0 + * Operation generateClosureDocumentsDetalizationReport * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsMovementReport_0($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport_0'][0]) + public function generateClosureDocumentsDetalizationReport($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - list($response) = $this->generateGoodsMovementReport_0WithHttpInfo($generate_goods_movement_report_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType); return $response; } /** - * Operation generateGoodsMovementReport_0WithHttpInfo + * Operation generateClosureDocumentsDetalizationReportWithHttpInfo * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsMovementReport_0WithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport_0'][0]) + public function generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - $request = $this->generateGoodsMovementReport_0Request($generate_goods_movement_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -8787,169 +6240,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8963,34 +6298,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9000,7 +6312,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9008,7 +6320,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9016,7 +6328,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9024,7 +6336,15 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9032,7 +6352,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9040,27 +6360,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsMovementReport_0Async + * Operation generateClosureDocumentsDetalizationReportAsync * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsMovementReport_0Async($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport_0'][0]) + public function generateClosureDocumentsDetalizationReportAsync($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - return $this->generateGoodsMovementReport_0AsyncWithHttpInfo($generate_goods_movement_report_request, $format, $contentType) + return $this->generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -9069,21 +6391,21 @@ class FbyApi } /** - * Operation generateGoodsMovementReport_0AsyncWithHttpInfo + * Operation generateClosureDocumentsDetalizationReportAsyncWithHttpInfo * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsMovementReport_0AsyncWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport_0'][0]) + public function generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsMovementReport_0Request($generate_goods_movement_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9122,28 +6444,28 @@ class FbyApi } /** - * Create request for operation 'generateGoodsMovementReport_0' + * Create request for operation 'generateClosureDocumentsDetalizationReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsMovementReport_0Request($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport_0'][0]) + public function generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - // verify the required parameter 'generate_goods_movement_report_request' is set - if ($generate_goods_movement_report_request === null || (is_array($generate_goods_movement_report_request) && count($generate_goods_movement_report_request) === 0)) { + // verify the required parameter 'generate_closure_documents_detalization_request' is set + if ($generate_closure_documents_detalization_request === null || (is_array($generate_closure_documents_detalization_request) && count($generate_closure_documents_detalization_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_movement_report_request when calling generateGoodsMovementReport_0' + 'Missing the required parameter $generate_closure_documents_detalization_request when calling generateClosureDocumentsDetalizationReport' ); } - $resourcePath = '/reports/goods-movement/generate'; + $resourcePath = '/v2/reports/closure-documents/detalization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9170,12 +6492,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_goods_movement_report_request)) { + if (isset($generate_closure_documents_detalization_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_movement_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_detalization_request)); } else { - $httpBody = $generate_goods_movement_report_request; + $httpBody = $generate_closure_documents_detalization_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9233,40 +6555,38 @@ class FbyApi } /** - * Operation generateGoodsRealizationReport_0 + * Operation generateClosureDocumentsReport * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsRealizationReport_0($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_0'][0]) + public function generateClosureDocumentsReport($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - list($response) = $this->generateGoodsRealizationReport_0WithHttpInfo($generate_goods_realization_report_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, $contentType); return $response; } /** - * Operation generateGoodsRealizationReport_0WithHttpInfo + * Operation generateClosureDocumentsReportWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsRealizationReport_0WithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_0'][0]) + public function generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - $request = $this->generateGoodsRealizationReport_0Request($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -9293,169 +6613,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9469,34 +6665,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -9506,7 +6679,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9514,7 +6687,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9522,7 +6695,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9530,7 +6703,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9538,7 +6711,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -9546,27 +6719,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsRealizationReport_0Async + * Operation generateClosureDocumentsReportAsync * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReport_0Async($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_0'][0]) + public function generateClosureDocumentsReportAsync($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - return $this->generateGoodsRealizationReport_0AsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) + return $this->generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, $contentType) ->then( function ($response) { return $response[0]; @@ -9575,21 +6749,20 @@ class FbyApi } /** - * Operation generateGoodsRealizationReport_0AsyncWithHttpInfo + * Operation generateClosureDocumentsReportAsyncWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReport_0AsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_0'][0]) + public function generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsRealizationReport_0Request($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9628,43 +6801,32 @@ class FbyApi } /** - * Create request for operation 'generateGoodsRealizationReport_0' + * Create request for operation 'generateClosureDocumentsReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsRealizationReport_0Request($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport_0'][0]) + public function generateClosureDocumentsReportRequest($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - // verify the required parameter 'generate_goods_realization_report_request' is set - if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { + // verify the required parameter 'generate_closure_documents_request' is set + if ($generate_closure_documents_request === null || (is_array($generate_closure_documents_request) && count($generate_closure_documents_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport_0' + 'Missing the required parameter $generate_closure_documents_request when calling generateClosureDocumentsReport' ); } - - $resourcePath = '/reports/goods-realization/generate'; + $resourcePath = '/v2/reports/closure-documents/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -9676,12 +6838,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_goods_realization_report_request)) { + if (isset($generate_closure_documents_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_request)); } else { - $httpBody = $generate_goods_realization_report_request; + $httpBody = $generate_closure_documents_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9739,40 +6901,40 @@ class FbyApi } /** - * Operation generateGoodsTurnoverReport_0 + * Operation generateCompetitorsPositionReport * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsTurnoverReport_0($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport_0'][0]) + public function generateCompetitorsPositionReport($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - list($response) = $this->generateGoodsTurnoverReport_0WithHttpInfo($generate_goods_turnover_request, $format, $contentType); + list($response) = $this->generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format, $contentType); return $response; } /** - * Operation generateGoodsTurnoverReport_0WithHttpInfo + * Operation generateCompetitorsPositionReportWithHttpInfo * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsTurnoverReport_0WithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport_0'][0]) + public function generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - $request = $this->generateGoodsTurnoverReport_0Request($generate_goods_turnover_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -9799,169 +6961,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -9975,34 +7013,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -10012,7 +7027,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10020,7 +7035,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10028,7 +7043,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10036,7 +7051,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10044,7 +7059,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10052,27 +7067,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsTurnoverReport_0Async + * Operation generateCompetitorsPositionReportAsync * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsTurnoverReport_0Async($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport_0'][0]) + public function generateCompetitorsPositionReportAsync($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - return $this->generateGoodsTurnoverReport_0AsyncWithHttpInfo($generate_goods_turnover_request, $format, $contentType) + return $this->generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -10081,21 +7098,21 @@ class FbyApi } /** - * Operation generateGoodsTurnoverReport_0AsyncWithHttpInfo + * Operation generateCompetitorsPositionReportAsyncWithHttpInfo * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsTurnoverReport_0AsyncWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport_0'][0]) + public function generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsTurnoverReport_0Request($generate_goods_turnover_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10134,28 +7151,28 @@ class FbyApi } /** - * Create request for operation 'generateGoodsTurnoverReport_0' + * Create request for operation 'generateCompetitorsPositionReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsTurnoverReport_0Request($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport_0'][0]) + public function generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - // verify the required parameter 'generate_goods_turnover_request' is set - if ($generate_goods_turnover_request === null || (is_array($generate_goods_turnover_request) && count($generate_goods_turnover_request) === 0)) { + // verify the required parameter 'generate_competitors_position_report_request' is set + if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_turnover_request when calling generateGoodsTurnoverReport_0' + 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport' ); } - $resourcePath = '/reports/goods-turnover/generate'; + $resourcePath = '/v2/reports/competitors-position/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10182,12 +7199,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_goods_turnover_request)) { + if (isset($generate_competitors_position_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_turnover_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); } else { - $httpBody = $generate_goods_turnover_request; + $httpBody = $generate_competitors_position_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10245,40 +7262,40 @@ class FbyApi } /** - * Operation generatePricesReport_0 + * Operation generateGoodsFeedbackReport * - * Отчет «Цены на рынке» + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generatePricesReport_0($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_0'][0]) + public function generateGoodsFeedbackReport($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - list($response) = $this->generatePricesReport_0WithHttpInfo($generate_prices_report_request, $format, $contentType); + list($response) = $this->generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format, $contentType); return $response; } /** - * Operation generatePricesReport_0WithHttpInfo + * Operation generateGoodsFeedbackReportWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generatePricesReport_0WithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_0'][0]) + public function generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $request = $this->generatePricesReport_0Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -10305,169 +7322,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10481,34 +7374,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -10518,7 +7388,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10526,7 +7396,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10534,7 +7404,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10542,7 +7412,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10550,7 +7420,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10558,27 +7428,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generatePricesReport_0Async + * Operation generateGoodsFeedbackReportAsync * - * Отчет «Цены на рынке» + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_0Async($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_0'][0]) + public function generateGoodsFeedbackReportAsync($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - return $this->generatePricesReport_0AsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) + return $this->generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -10587,21 +7459,21 @@ class FbyApi } /** - * Operation generatePricesReport_0AsyncWithHttpInfo + * Operation generateGoodsFeedbackReportAsyncWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReport_0AsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_0'][0]) + public function generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generatePricesReport_0Request($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10640,28 +7512,28 @@ class FbyApi } /** - * Create request for operation 'generatePricesReport_0' + * Create request for operation 'generateGoodsFeedbackReport' * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generatePricesReport_0Request($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport_0'][0]) + public function generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - // verify the required parameter 'generate_prices_report_request' is set - if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { + // verify the required parameter 'generate_goods_feedback_request' is set + if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport_0' + 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport' ); } - $resourcePath = '/reports/prices/generate'; + $resourcePath = '/v2/reports/goods-feedback/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10688,12 +7560,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_prices_report_request)) { + if (isset($generate_goods_feedback_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); } else { - $httpBody = $generate_prices_report_request; + $httpBody = $generate_goods_feedback_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10751,40 +7623,40 @@ class FbyApi } /** - * Operation generateShelfsStatisticsReport_0 + * Operation generateGoodsMovementReport * - * Отчет по полкам + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShelfsStatisticsReport_0($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_0'][0]) + public function generateGoodsMovementReport($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - list($response) = $this->generateShelfsStatisticsReport_0WithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); + list($response) = $this->generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format, $contentType); return $response; } /** - * Operation generateShelfsStatisticsReport_0WithHttpInfo + * Operation generateGoodsMovementReportWithHttpInfo * - * Отчет по полкам + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShelfsStatisticsReport_0WithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_0'][0]) + public function generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - $request = $this->generateShelfsStatisticsReport_0Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -10811,169 +7683,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -10987,34 +7735,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11024,7 +7749,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11032,7 +7757,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11040,7 +7765,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11048,7 +7773,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11056,7 +7781,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11064,27 +7789,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShelfsStatisticsReport_0Async + * Operation generateGoodsMovementReportAsync * - * Отчет по полкам + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_0Async($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_0'][0]) + public function generateGoodsMovementReportAsync($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - return $this->generateShelfsStatisticsReport_0AsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) + return $this->generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -11093,21 +7820,21 @@ class FbyApi } /** - * Operation generateShelfsStatisticsReport_0AsyncWithHttpInfo + * Operation generateGoodsMovementReportAsyncWithHttpInfo * - * Отчет по полкам + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReport_0AsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_0'][0]) + public function generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShelfsStatisticsReport_0Request($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11146,28 +7873,28 @@ class FbyApi } /** - * Create request for operation 'generateShelfsStatisticsReport_0' + * Create request for operation 'generateGoodsMovementReport' * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShelfsStatisticsReport_0Request($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport_0'][0]) + public function generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - // verify the required parameter 'generate_shelfs_statistics_request' is set - if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { + // verify the required parameter 'generate_goods_movement_report_request' is set + if ($generate_goods_movement_report_request === null || (is_array($generate_goods_movement_report_request) && count($generate_goods_movement_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport_0' + 'Missing the required parameter $generate_goods_movement_report_request when calling generateGoodsMovementReport' ); } - $resourcePath = '/reports/shelf-statistics/generate'; + $resourcePath = '/v2/reports/goods-movement/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11194,12 +7921,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_shelfs_statistics_request)) { + if (isset($generate_goods_movement_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_movement_report_request)); } else { - $httpBody = $generate_shelfs_statistics_request; + $httpBody = $generate_goods_movement_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11257,40 +7984,40 @@ class FbyApi } /** - * Operation generateShowsSalesReport_0 + * Operation generateGoodsPricesReport * - * Отчет «Аналитика продаж» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShowsSalesReport_0($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_0'][0]) + public function generateGoodsPricesReport($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - list($response) = $this->generateShowsSalesReport_0WithHttpInfo($generate_shows_sales_report_request, $format, $contentType); + list($response) = $this->generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format, $contentType); return $response; } /** - * Operation generateShowsSalesReport_0WithHttpInfo + * Operation generateGoodsPricesReportWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShowsSalesReport_0WithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_0'][0]) + public function generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $request = $this->generateShowsSalesReport_0Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11317,169 +8044,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11493,34 +8096,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -11530,7 +8110,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11538,7 +8118,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11546,7 +8126,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11554,7 +8134,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11562,7 +8142,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11570,27 +8150,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShowsSalesReport_0Async + * Operation generateGoodsPricesReportAsync * - * Отчет «Аналитика продаж» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_0Async($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_0'][0]) + public function generateGoodsPricesReportAsync($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - return $this->generateShowsSalesReport_0AsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) + return $this->generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -11599,21 +8181,21 @@ class FbyApi } /** - * Operation generateShowsSalesReport_0AsyncWithHttpInfo + * Operation generateGoodsPricesReportAsyncWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReport_0AsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_0'][0]) + public function generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShowsSalesReport_0Request($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11652,28 +8234,28 @@ class FbyApi } /** - * Create request for operation 'generateShowsSalesReport_0' + * Create request for operation 'generateGoodsPricesReport' * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShowsSalesReport_0Request($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport_0'][0]) + public function generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - // verify the required parameter 'generate_shows_sales_report_request' is set - if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { + // verify the required parameter 'generate_goods_prices_report_request' is set + if ($generate_goods_prices_report_request === null || (is_array($generate_goods_prices_report_request) && count($generate_goods_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport_0' + 'Missing the required parameter $generate_goods_prices_report_request when calling generateGoodsPricesReport' ); } - $resourcePath = '/reports/shows-sales/generate'; + $resourcePath = '/v2/reports/goods-prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11700,12 +8282,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_shows_sales_report_request)) { + if (isset($generate_goods_prices_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_prices_report_request)); } else { - $httpBody = $generate_shows_sales_report_request; + $httpBody = $generate_goods_prices_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11763,40 +8345,40 @@ class FbyApi } /** - * Operation generateStocksOnWarehousesReport_0 + * Operation generateGoodsRealizationReport * - * Отчет по остаткам на складах + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateStocksOnWarehousesReport_0($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_0'][0]) + public function generateGoodsRealizationReport($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - list($response) = $this->generateStocksOnWarehousesReport_0WithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + list($response) = $this->generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format, $contentType); return $response; } /** - * Operation generateStocksOnWarehousesReport_0WithHttpInfo + * Operation generateGoodsRealizationReportWithHttpInfo * - * Отчет по остаткам на складах + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateStocksOnWarehousesReport_0WithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_0'][0]) + public function generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - $request = $this->generateStocksOnWarehousesReport_0Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -11823,169 +8405,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -11999,34 +8463,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12036,7 +8477,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12044,7 +8485,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12052,7 +8493,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12060,7 +8501,15 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12068,7 +8517,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12076,27 +8525,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateStocksOnWarehousesReport_0Async + * Operation generateGoodsRealizationReportAsync * - * Отчет по остаткам на складах + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_0Async($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_0'][0]) + public function generateGoodsRealizationReportAsync($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - return $this->generateStocksOnWarehousesReport_0AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) + return $this->generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12105,21 +8556,21 @@ class FbyApi } /** - * Operation generateStocksOnWarehousesReport_0AsyncWithHttpInfo + * Operation generateGoodsRealizationReportAsyncWithHttpInfo * - * Отчет по остаткам на складах + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReport_0AsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_0'][0]) + public function generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateStocksOnWarehousesReport_0Request($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12158,28 +8609,28 @@ class FbyApi } /** - * Create request for operation 'generateStocksOnWarehousesReport_0' + * Create request for operation 'generateGoodsRealizationReport' * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateStocksOnWarehousesReport_0Request($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport_0'][0]) + public function generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set - if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { + // verify the required parameter 'generate_goods_realization_report_request' is set + if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport_0' + 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport' ); } - $resourcePath = '/reports/stocks-on-warehouses/generate'; + $resourcePath = '/v2/reports/goods-realization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12206,12 +8657,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_stocks_on_warehouses_report_request)) { + if (isset($generate_goods_realization_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); } else { - $httpBody = $generate_stocks_on_warehouses_report_request; + $httpBody = $generate_goods_realization_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12269,40 +8720,40 @@ class FbyApi } /** - * Operation generateUnitedMarketplaceServicesReport_0 + * Operation generateGoodsTurnoverReport * - * Отчет по стоимости услуг + * Отчет по оборачиваемости * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedMarketplaceServicesReport_0($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_0'][0]) + public function generateGoodsTurnoverReport($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { - list($response) = $this->generateUnitedMarketplaceServicesReport_0WithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType); + list($response) = $this->generateGoodsTurnoverReportWithHttpInfo($generate_goods_turnover_request, $format, $contentType); return $response; } /** - * Operation generateUnitedMarketplaceServicesReport_0WithHttpInfo + * Operation generateGoodsTurnoverReportWithHttpInfo * - * Отчет по стоимости услуг + * Отчет по оборачиваемости * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedMarketplaceServicesReport_0WithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_0'][0]) + public function generateGoodsTurnoverReportWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { - $request = $this->generateUnitedMarketplaceServicesReport_0Request($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12329,169 +8780,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -12505,34 +8832,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -12542,7 +8846,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12550,7 +8854,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12558,7 +8862,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12566,7 +8870,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12574,7 +8878,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12582,27 +8886,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedMarketplaceServicesReport_0Async + * Operation generateGoodsTurnoverReportAsync * - * Отчет по стоимости услуг + * Отчет по оборачиваемости * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_0Async($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_0'][0]) + public function generateGoodsTurnoverReportAsync($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { - return $this->generateUnitedMarketplaceServicesReport_0AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType) + return $this->generateGoodsTurnoverReportAsyncWithHttpInfo($generate_goods_turnover_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -12611,21 +8917,21 @@ class FbyApi } /** - * Operation generateUnitedMarketplaceServicesReport_0AsyncWithHttpInfo + * Operation generateGoodsTurnoverReportAsyncWithHttpInfo * - * Отчет по стоимости услуг + * Отчет по оборачиваемости * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReport_0AsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_0'][0]) + public function generateGoodsTurnoverReportAsyncWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedMarketplaceServicesReport_0Request($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12664,28 +8970,28 @@ class FbyApi } /** - * Create request for operation 'generateUnitedMarketplaceServicesReport_0' + * Create request for operation 'generateGoodsTurnoverReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedMarketplaceServicesReport_0Request($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport_0'][0]) + public function generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { - // verify the required parameter 'generate_united_marketplace_services_report_request' is set - if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { + // verify the required parameter 'generate_goods_turnover_request' is set + if ($generate_goods_turnover_request === null || (is_array($generate_goods_turnover_request) && count($generate_goods_turnover_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport_0' + 'Missing the required parameter $generate_goods_turnover_request when calling generateGoodsTurnoverReport' ); } - $resourcePath = '/reports/united-marketplace-services/generate'; + $resourcePath = '/v2/reports/goods-turnover/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12712,12 +9018,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_united_marketplace_services_report_request)) { + if (isset($generate_goods_turnover_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_turnover_request)); } else { - $httpBody = $generate_united_marketplace_services_report_request; + $httpBody = $generate_goods_turnover_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -12775,40 +9081,40 @@ class FbyApi } /** - * Operation generateUnitedNettingReport_0 + * Operation generateJewelryFiscalReport * - * Отчет по платежам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedNettingReport_0($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_0'][0]) + public function generateJewelryFiscalReport($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - list($response) = $this->generateUnitedNettingReport_0WithHttpInfo($generate_united_netting_report_request, $format, $contentType); + list($response) = $this->generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType); return $response; } /** - * Operation generateUnitedNettingReport_0WithHttpInfo + * Operation generateJewelryFiscalReportWithHttpInfo * - * Отчет по платежам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedNettingReport_0WithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_0'][0]) + public function generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - $request = $this->generateUnitedNettingReport_0Request($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -12835,169 +9141,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13011,34 +9193,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -13048,7 +9207,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13056,7 +9215,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13064,7 +9223,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13072,7 +9231,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13080,7 +9239,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13088,27 +9247,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedNettingReport_0Async + * Operation generateJewelryFiscalReportAsync * - * Отчет по платежам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_0Async($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_0'][0]) + public function generateJewelryFiscalReportAsync($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - return $this->generateUnitedNettingReport_0AsyncWithHttpInfo($generate_united_netting_report_request, $format, $contentType) + return $this->generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -13117,21 +9278,21 @@ class FbyApi } /** - * Operation generateUnitedNettingReport_0AsyncWithHttpInfo + * Operation generateJewelryFiscalReportAsyncWithHttpInfo * - * Отчет по платежам + * Отчет по заказам с ювелирными изделиями * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReport_0AsyncWithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_0'][0]) + public function generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedNettingReport_0Request($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13170,28 +9331,28 @@ class FbyApi } /** - * Create request for operation 'generateUnitedNettingReport_0' + * Create request for operation 'generateJewelryFiscalReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedNettingReport_0Request($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport_0'][0]) + public function generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) { - // verify the required parameter 'generate_united_netting_report_request' is set - if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { + // verify the required parameter 'generate_jewelry_fiscal_report_request' is set + if ($generate_jewelry_fiscal_report_request === null || (is_array($generate_jewelry_fiscal_report_request) && count($generate_jewelry_fiscal_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport_0' + 'Missing the required parameter $generate_jewelry_fiscal_report_request when calling generateJewelryFiscalReport' ); } - $resourcePath = '/reports/united-netting/generate'; + $resourcePath = '/v2/reports/jewelry-fiscal/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13218,12 +9379,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_united_netting_report_request)) { + if (isset($generate_jewelry_fiscal_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_jewelry_fiscal_report_request)); } else { - $httpBody = $generate_united_netting_report_request; + $httpBody = $generate_jewelry_fiscal_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13281,40 +9442,40 @@ class FbyApi } /** - * Operation generateUnitedOrdersReport_0 + * Operation generateKeyIndicatorsReport * - * Отчет по заказам + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedOrdersReport_0($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_0'][0]) + public function generateKeyIndicatorsReport($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - list($response) = $this->generateUnitedOrdersReport_0WithHttpInfo($generate_united_orders_request, $format, $contentType); + list($response) = $this->generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format, $contentType); return $response; } /** - * Operation generateUnitedOrdersReport_0WithHttpInfo + * Operation generateKeyIndicatorsReportWithHttpInfo * - * Отчет по заказам + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedOrdersReport_0WithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_0'][0]) + public function generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - $request = $this->generateUnitedOrdersReport_0Request($generate_united_orders_request, $format, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -13341,169 +9502,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -13517,34 +9554,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -13554,7 +9568,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13562,7 +9576,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13570,7 +9584,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13578,7 +9592,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13586,7 +9600,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13594,27 +9608,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedOrdersReport_0Async + * Operation generateKeyIndicatorsReportAsync * - * Отчет по заказам + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReport_0Async($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_0'][0]) + public function generateKeyIndicatorsReportAsync($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - return $this->generateUnitedOrdersReport_0AsyncWithHttpInfo($generate_united_orders_request, $format, $contentType) + return $this->generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -13623,21 +9639,21 @@ class FbyApi } /** - * Operation generateUnitedOrdersReport_0AsyncWithHttpInfo + * Operation generateKeyIndicatorsReportAsyncWithHttpInfo * - * Отчет по заказам + * Отчет по ключевым показателям * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReport_0AsyncWithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_0'][0]) + public function generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedOrdersReport_0Request($generate_united_orders_request, $format, $contentType); + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13676,28 +9692,28 @@ class FbyApi } /** - * Create request for operation 'generateUnitedOrdersReport_0' + * Create request for operation 'generateKeyIndicatorsReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedOrdersReport_0Request($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport_0'][0]) + public function generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) { - // verify the required parameter 'generate_united_orders_request' is set - if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { + // verify the required parameter 'generate_key_indicators_request' is set + if ($generate_key_indicators_request === null || (is_array($generate_key_indicators_request) && count($generate_key_indicators_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport_0' + 'Missing the required parameter $generate_key_indicators_request when calling generateKeyIndicatorsReport' ); } - $resourcePath = '/reports/united-orders/generate'; + $resourcePath = '/v2/reports/key-indicators/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13724,12 +9740,12 @@ class FbyApi ); // for model (json/xml) - if (isset($generate_united_orders_request)) { + if (isset($generate_key_indicators_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_key_indicators_request)); } else { - $httpBody = $generate_united_orders_request; + $httpBody = $generate_key_indicators_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13787,44 +9803,40 @@ class FbyApi } /** - * Operation getAllOffers_3 + * Operation generateOfferBarcodes * - * Все предложения магазина + * Генерация штрихкодов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getAllOffers_3($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_3'][0]) + public function generateOfferBarcodes($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - list($response) = $this->getAllOffers_3WithHttpInfo($campaign_id, $feed_id, $chunk, $contentType); + list($response) = $this->generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType); return $response; } /** - * Operation getAllOffers_3WithHttpInfo + * Operation generateOfferBarcodesWithHttpInfo * - * Все предложения магазина + * Генерация штрихкодов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getAllOffers_3WithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_3'][0]) + public function generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $request = $this->getAllOffers_3Request($campaign_id, $feed_id, $chunk, $contentType); + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -13851,196 +9863,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetAllOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetAllOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetAllOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14054,44 +9921,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetAllOffersResponse', + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14099,7 +9943,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14107,7 +9951,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14115,23 +9959,23 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: + throw $e; + case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + '\OpenAPI\Client\Model\ApiLimitErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 420: + throw $e; + case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLimitErrorResponse', + '\OpenAPI\Client\Model\ApiLockedErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14139,29 +9983,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllOffers_3Async + * Operation generateOfferBarcodesAsync * - * Все предложения магазина + * Генерация штрихкодов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffers_3Async($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_3'][0]) + public function generateOfferBarcodesAsync($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - return $this->getAllOffers_3AsyncWithHttpInfo($campaign_id, $feed_id, $chunk, $contentType) + return $this->generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -14170,23 +10014,21 @@ class FbyApi } /** - * Operation getAllOffers_3AsyncWithHttpInfo + * Operation generateOfferBarcodesAsyncWithHttpInfo * - * Все предложения магазина + * Генерация штрихкодов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffers_3AsyncWithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_3'][0]) + public function generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - $request = $this->getAllOffers_3Request($campaign_id, $feed_id, $chunk, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse'; + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14225,65 +10067,50 @@ class FbyApi } /** - * Create request for operation 'getAllOffers_3' + * Create request for operation 'generateOfferBarcodes' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getAllOffers_3Request($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers_3'][0]) + public function generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getAllOffers_3' + 'Missing the required parameter $business_id when calling generateOfferBarcodes' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getAllOffers_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.generateOfferBarcodes, must be bigger than or equal to 1.'); } + // verify the required parameter 'generate_offer_barcodes_request' is set + if ($generate_offer_barcodes_request === null || (is_array($generate_offer_barcodes_request) && count($generate_offer_barcodes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_offer_barcodes_request when calling generateOfferBarcodes' + ); + } - - $resourcePath = '/campaigns/{campaignId}/offers/all'; + $resourcePath = '/v1/businesses/{businessId}/offer-mappings/barcodes/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chunk, - 'chunk', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -14296,7 +10123,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_offer_barcodes_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_offer_barcodes_request)); + } else { + $httpBody = $generate_offer_barcodes_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -14344,7 +10178,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14352,44 +10186,42 @@ class FbyApi } /** - * Operation getBidsInfoForBusiness_2 + * Operation generatePricesReport * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getBidsInfoForBusiness_2($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_2'][0]) + public function generatePricesReport($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - list($response) = $this->getBidsInfoForBusiness_2WithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + list($response) = $this->generatePricesReportWithHttpInfo($generate_prices_report_request, $format, $contentType); return $response; } /** - * Operation getBidsInfoForBusiness_2WithHttpInfo + * Operation generatePricesReportWithHttpInfo * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getBidsInfoForBusiness_2WithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_2'][0]) + public function generatePricesReportWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $request = $this->getBidsInfoForBusiness_2Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14416,196 +10248,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -14619,44 +10300,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsInfoResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14664,7 +10322,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14672,7 +10330,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14680,15 +10338,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14696,7 +10346,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -14704,29 +10354,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsInfoForBusiness_2Async + * Operation generatePricesReportAsync * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getBidsInfoForBusiness_2Async($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_2'][0]) + public function generatePricesReportAsync($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - return $this->getBidsInfoForBusiness_2AsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) + return $this->generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -14735,23 +10386,22 @@ class FbyApi } /** - * Operation getBidsInfoForBusiness_2AsyncWithHttpInfo + * Operation generatePricesReportAsyncWithHttpInfo * - * Информация об установленных ставках + * Отчет «Цены на рынке» * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getBidsInfoForBusiness_2AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_2'][0]) + public function generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; - $request = $this->getBidsInfoForBusiness_2Request($business_id, $page_token, $limit, $get_bids_info_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14790,35 +10440,29 @@ class FbyApi } /** - * Create request for operation 'getBidsInfoForBusiness_2' + * Create request for operation 'generatePricesReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetBidsInfoRequest $get_bids_info_request description (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getBidsInfoForBusiness_2Request($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness_2'][0]) + public function generatePricesReportRequest($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_prices_report_request' is set + if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsInfoForBusiness_2' + 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBidsInfoForBusiness_2, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/businesses/{businessId}/bids/info'; + $resourcePath = '/v2/reports/prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14827,32 +10471,15 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -14862,12 +10489,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_bids_info_request)) { + if (isset($generate_prices_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); } else { - $httpBody = $get_bids_info_request; + $httpBody = $generate_prices_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -14925,40 +10552,40 @@ class FbyApi } /** - * Operation getBidsRecommendations_2 + * Operation generateSalesGeographyReport * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBidsRecommendations_2($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_2'][0]) + public function generateSalesGeographyReport($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - list($response) = $this->getBidsRecommendations_2WithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); + list($response) = $this->generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format, $contentType); return $response; } /** - * Operation getBidsRecommendations_2WithHttpInfo + * Operation generateSalesGeographyReportWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBidsRecommendations_2WithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_2'][0]) + public function generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $request = $this->getBidsRecommendations_2Request($business_id, $get_bids_recommendations_request, $contentType); + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -14985,196 +10612,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBidsRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15188,44 +10664,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15233,7 +10686,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15241,7 +10694,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15249,15 +10702,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15265,7 +10710,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15273,27 +10718,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBidsRecommendations_2Async + * Operation generateSalesGeographyReportAsync * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_2Async($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_2'][0]) + public function generateSalesGeographyReportAsync($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - return $this->getBidsRecommendations_2AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) + return $this->generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -15302,21 +10749,21 @@ class FbyApi } /** - * Operation getBidsRecommendations_2AsyncWithHttpInfo + * Operation generateSalesGeographyReportAsyncWithHttpInfo * - * Рекомендованные ставки для заданных товаров + * Отчет по географии продаж * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBidsRecommendations_2AsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_2'][0]) + public function generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; - $request = $this->getBidsRecommendations_2Request($business_id, $get_bids_recommendations_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15355,53 +10802,45 @@ class FbyApi } /** - * Create request for operation 'getBidsRecommendations_2' + * Create request for operation 'generateSalesGeographyReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBidsRecommendations_2Request($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations_2'][0]) + public function generateSalesGeographyReportRequest($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBidsRecommendations_2' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBidsRecommendations_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_bids_recommendations_request' is set - if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { + // verify the required parameter 'generate_sales_geography_request' is set + if ($generate_sales_geography_request === null || (is_array($generate_sales_geography_request) && count($generate_sales_geography_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations_2' + 'Missing the required parameter $generate_sales_geography_request when calling generateSalesGeographyReport' ); } - $resourcePath = '/businesses/{businessId}/bids/recommendations'; + + $resourcePath = '/v2/reports/sales-geography/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -15411,12 +10850,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_bids_recommendations_request)) { + if (isset($generate_sales_geography_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_sales_geography_request)); } else { - $httpBody = $get_bids_recommendations_request; + $httpBody = $generate_sales_geography_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -15474,44 +10913,40 @@ class FbyApi } /** - * Operation getBusinessQuarantineOffers_1 + * Operation generateShelfsStatisticsReport * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessQuarantineOffers_1($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_1'][0]) + public function generateShelfsStatisticsReport($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - list($response) = $this->getBusinessQuarantineOffers_1WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); return $response; } /** - * Operation getBusinessQuarantineOffers_1WithHttpInfo + * Operation generateShelfsStatisticsReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessQuarantineOffers_1WithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_1'][0]) + public function generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $request = $this->getBusinessQuarantineOffers_1Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -15538,196 +10973,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -15741,44 +11025,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15786,7 +11047,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15794,7 +11055,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15802,15 +11063,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15818,7 +11071,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15826,29 +11079,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessQuarantineOffers_1Async + * Operation generateShelfsStatisticsReportAsync * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_1Async($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_1'][0]) + public function generateShelfsStatisticsReportAsync($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - return $this->getBusinessQuarantineOffers_1AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -15857,23 +11110,21 @@ class FbyApi } /** - * Operation getBusinessQuarantineOffers_1AsyncWithHttpInfo + * Operation generateShelfsStatisticsReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в кабинете + * Отчет по полкам * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessQuarantineOffers_1AsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_1'][0]) + public function generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getBusinessQuarantineOffers_1Request($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15912,41 +11163,28 @@ class FbyApi } /** - * Create request for operation 'getBusinessQuarantineOffers_1' + * Create request for operation 'generateShelfsStatisticsReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessQuarantineOffers_1Request($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers_1'][0]) + public function generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers_1' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBusinessQuarantineOffers_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_shelfs_statistics_request' is set + if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers_1' + 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport' ); } - - $resourcePath = '/businesses/{businessId}/price-quarantine'; + $resourcePath = '/v2/reports/shelf-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15955,32 +11193,15 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -15990,12 +11211,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_shelfs_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_shelfs_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -16053,38 +11274,40 @@ class FbyApi } /** - * Operation getBusinessSettings_2 + * Operation generateShowsBoostReport * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getBusinessSettings_2($business_id, string $contentType = self::contentTypes['getBusinessSettings_2'][0]) + public function generateShowsBoostReport($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - list($response) = $this->getBusinessSettings_2WithHttpInfo($business_id, $contentType); + list($response) = $this->generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format, $contentType); return $response; } /** - * Operation getBusinessSettings_2WithHttpInfo + * Operation generateShowsBoostReportWithHttpInfo * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getBusinessSettings_2WithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_2'][0]) + public function generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $request = $this->getBusinessSettings_2Request($business_id, $contentType); + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16111,196 +11334,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -16314,44 +11386,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16359,7 +11408,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16367,7 +11416,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16375,15 +11424,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16391,7 +11432,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16399,26 +11440,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getBusinessSettings_2Async + * Operation generateShowsBoostReportAsync * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_2Async($business_id, string $contentType = self::contentTypes['getBusinessSettings_2'][0]) + public function generateShowsBoostReportAsync($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - return $this->getBusinessSettings_2AsyncWithHttpInfo($business_id, $contentType) + return $this->generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16427,20 +11471,21 @@ class FbyApi } /** - * Operation getBusinessSettings_2AsyncWithHttpInfo + * Operation generateShowsBoostReportAsyncWithHttpInfo * - * Настройки кабинета + * Отчет по бусту показов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getBusinessSettings_2AsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings_2'][0]) + public function generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; - $request = $this->getBusinessSettings_2Request($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16479,45 +11524,45 @@ class FbyApi } /** - * Create request for operation 'getBusinessSettings_2' + * Create request for operation 'generateShowsBoostReport' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getBusinessSettings_2Request($business_id, string $contentType = self::contentTypes['getBusinessSettings_2'][0]) + public function generateShowsBoostReportRequest($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'generate_shows_boost_request' is set + if ($generate_shows_boost_request === null || (is_array($generate_shows_boost_request) && count($generate_shows_boost_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getBusinessSettings_2' + 'Missing the required parameter $generate_shows_boost_request when calling generateShowsBoostReport' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBusinessSettings_2, must be bigger than or equal to 1.'); - } - - $resourcePath = '/businesses/{businessId}/settings'; + + + $resourcePath = '/v2/reports/shows-boost/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -16527,7 +11572,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_shows_boost_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_boost_request)); + } else { + $httpBody = $generate_shows_boost_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -16583,38 +11635,40 @@ class FbyApi } /** - * Operation getCampaignLogins_3 + * Operation generateShowsSalesReport * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignLogins_3($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_3'][0]) + public function generateShowsSalesReport($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - list($response) = $this->getCampaignLogins_3WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format, $contentType); return $response; } /** - * Operation getCampaignLogins_3WithHttpInfo + * Operation generateShowsSalesReportWithHttpInfo * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignLoginsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignLogins_3WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_3'][0]) + public function generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $request = $this->getCampaignLogins_3Request($campaign_id, $contentType); + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -16641,196 +11695,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignLoginsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignLoginsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -16844,44 +11753,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignLoginsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16889,7 +11775,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16897,7 +11783,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16905,7 +11791,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16913,7 +11799,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16921,7 +11807,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16929,26 +11815,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignLogins_3Async + * Operation generateShowsSalesReportAsync * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_3Async($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_3'][0]) + public function generateShowsSalesReportAsync($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - return $this->getCampaignLogins_3AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -16957,20 +11846,21 @@ class FbyApi } /** - * Operation getCampaignLogins_3AsyncWithHttpInfo + * Operation generateShowsSalesReportAsyncWithHttpInfo * - * Логины, связанные с магазином + * Отчет «Аналитика продаж» * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignLogins_3AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_3'][0]) + public function generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignLoginsResponse'; - $request = $this->getCampaignLogins_3Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17009,45 +11899,45 @@ class FbyApi } /** - * Create request for operation 'getCampaignLogins_3' + * Create request for operation 'generateShowsSalesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignLogins_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignLogins_3Request($campaign_id, string $contentType = self::contentTypes['getCampaignLogins_3'][0]) + public function generateShowsSalesReportRequest($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_shows_sales_report_request' is set + if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignLogins_3' + 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignLogins_3, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/logins'; + + + $resourcePath = '/v2/reports/shows-sales/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -17057,7 +11947,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_shows_sales_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + } else { + $httpBody = $generate_shows_sales_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17105,7 +12002,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17113,44 +12010,40 @@ class FbyApi } /** - * Operation getCampaignOffers_1 + * Operation generateStocksOnWarehousesReport * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignOffers_1($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_1'][0]) + public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - list($response) = $this->getCampaignOffers_1WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); return $response; } /** - * Operation getCampaignOffers_1WithHttpInfo + * Operation generateStocksOnWarehousesReportWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignOffers_1WithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_1'][0]) + public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $request = $this->getCampaignOffers_1Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -17177,196 +12070,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17380,44 +12128,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17425,7 +12150,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17433,7 +12158,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17441,7 +12166,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17449,7 +12174,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17457,7 +12182,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17465,29 +12190,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignOffers_1Async + * Operation generateStocksOnWarehousesReportAsync * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_1Async($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_1'][0]) + public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - return $this->getCampaignOffers_1AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) + return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -17496,23 +12221,21 @@ class FbyApi } /** - * Operation getCampaignOffers_1AsyncWithHttpInfo + * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo * - * Информация о товарах, которые размещены в заданном магазине + * Отчет по остаткам на складах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignOffers_1AsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_1'][0]) + public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - $request = $this->getCampaignOffers_1Request($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17551,41 +12274,28 @@ class FbyApi } /** - * Create request for operation 'getCampaignOffers_1' + * Create request for operation 'generateStocksOnWarehousesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignOffers_1Request($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers_1'][0]) + public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignOffers_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignOffers_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_campaign_offers_request' is set - if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set + if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers_1' + 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' ); } - - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/reports/stocks-on-warehouses/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17594,32 +12304,15 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -17629,12 +12322,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_campaign_offers_request)) { + if (isset($generate_stocks_on_warehouses_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); } else { - $httpBody = $get_campaign_offers_request; + $httpBody = $generate_stocks_on_warehouses_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -17692,44 +12385,42 @@ class FbyApi } /** - * Operation getCampaignQuarantineOffers_1 + * Operation generateUnitedMarketplaceServicesReport * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignQuarantineOffers_1($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_1'][0]) + public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - list($response) = $this->getCampaignQuarantineOffers_1WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignQuarantineOffers_1WithHttpInfo + * Operation generateUnitedMarketplaceServicesReportWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignQuarantineOffers_1WithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_1'][0]) + public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $request = $this->getCampaignQuarantineOffers_1Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -17756,196 +12447,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -17959,44 +12505,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18004,7 +12527,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18012,7 +12535,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18020,7 +12543,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18028,7 +12551,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18036,7 +12559,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18044,29 +12567,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignQuarantineOffers_1Async + * Operation generateUnitedMarketplaceServicesReportAsync * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_1Async($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_1'][0]) + public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - return $this->getCampaignQuarantineOffers_1AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) + return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -18075,23 +12599,22 @@ class FbyApi } /** - * Operation getCampaignQuarantineOffers_1AsyncWithHttpInfo + * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo * - * Список товаров, находящихся в карантине по цене в магазине + * Отчет по стоимости услуг * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignQuarantineOffers_1AsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_1'][0]) + public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - $request = $this->getCampaignQuarantineOffers_1Request($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18130,41 +12653,30 @@ class FbyApi } /** - * Create request for operation 'getCampaignQuarantineOffers_1' + * Create request for operation 'generateUnitedMarketplaceServicesReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignQuarantineOffers_1Request($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers_1'][0]) + public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers_1' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignQuarantineOffers_1, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_quarantine_offers_request' is set - if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + // verify the required parameter 'generate_united_marketplace_services_report_request' is set + if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers_1' + 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' ); } - $resourcePath = '/campaigns/{campaignId}/price-quarantine'; + $resourcePath = '/v2/reports/united-marketplace-services/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18173,32 +12685,24 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $format, + 'format', // param base name + 'ReportFormatType', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType '', // style false, // explode false // required ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -18208,12 +12712,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_quarantine_offers_request)) { + if (isset($generate_united_marketplace_services_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); } else { - $httpBody = $get_quarantine_offers_request; + $httpBody = $generate_united_marketplace_services_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -18271,40 +12775,42 @@ class FbyApi } /** - * Operation getCampaignRegion_1 + * Operation generateUnitedNettingReport * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignRegion_1($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_1'][0]) + public function generateUnitedNettingReport($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - list($response) = $this->getCampaignRegion_1WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignRegion_1WithHttpInfo + * Operation generateUnitedNettingReportWithHttpInfo * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignRegionResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignRegion_1WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_1'][0]) + public function generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $request = $this->getCampaignRegion_1Request($campaign_id, $contentType); + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -18331,196 +12837,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignRegionResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignRegionResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -18534,44 +12895,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignRegionResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18579,7 +12917,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18587,7 +12925,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18595,7 +12933,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18603,7 +12941,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18611,7 +12949,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -18619,27 +12957,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignRegion_1Async + * Operation generateUnitedNettingReportAsync * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_1Async($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_1'][0]) + public function generateUnitedNettingReportAsync($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - return $this->getCampaignRegion_1AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -18648,21 +12989,22 @@ class FbyApi } /** - * Operation getCampaignRegion_1AsyncWithHttpInfo + * Operation generateUnitedNettingReportAsyncWithHttpInfo * - * Регион магазина + * Отчет по платежам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getCampaignRegion_1AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_1'][0]) + public function generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignRegionResponse'; - $request = $this->getCampaignRegion_1Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18701,46 +13043,56 @@ class FbyApi } /** - * Create request for operation 'getCampaignRegion_1' + * Create request for operation 'generateUnitedNettingReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignRegion_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getCampaignRegion_1Request($campaign_id, string $contentType = self::contentTypes['getCampaignRegion_1'][0]) + public function generateUnitedNettingReportRequest($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_netting_report_request' is set + if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignRegion_1' + 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignRegion_1, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/region'; + + + + $resourcePath = '/v2/reports/united-netting/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -18750,7 +13102,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_netting_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); + } else { + $httpBody = $generate_united_netting_report_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -18798,7 +13157,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18806,38 +13165,42 @@ class FbyApi } /** - * Operation getCampaignSettings_3 + * Operation generateUnitedOrdersReport * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignSettings_3($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_3'][0]) + public function generateUnitedOrdersReport($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - list($response) = $this->getCampaignSettings_3WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format, $language, $contentType); return $response; } /** - * Operation getCampaignSettings_3WithHttpInfo + * Operation generateUnitedOrdersReportWithHttpInfo * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignSettings_3WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_3'][0]) + public function generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $request = $this->getCampaignSettings_3Request($campaign_id, $contentType); + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -18864,196 +13227,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignSettingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignSettingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19067,44 +13285,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19112,7 +13307,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19120,7 +13315,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19128,7 +13323,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19136,7 +13331,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19144,7 +13339,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19152,26 +13347,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignSettings_3Async + * Operation generateUnitedOrdersReportAsync * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_3Async($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_3'][0]) + public function generateUnitedOrdersReportAsync($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - return $this->getCampaignSettings_3AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -19180,20 +13379,22 @@ class FbyApi } /** - * Operation getCampaignSettings_3AsyncWithHttpInfo + * Operation generateUnitedOrdersReportAsyncWithHttpInfo * - * Настройки магазина + * Отчет по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignSettings_3AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_3'][0]) + public function generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; - $request = $this->getCampaignSettings_3Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19232,45 +13433,56 @@ class FbyApi } /** - * Create request for operation 'getCampaignSettings_3' + * Create request for operation 'generateUnitedOrdersReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignSettings_3Request($campaign_id, string $contentType = self::contentTypes['getCampaignSettings_3'][0]) + public function generateUnitedOrdersReportRequest($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_orders_request' is set + if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignSettings_3' + 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignSettings_3, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}/settings'; + + + + $resourcePath = '/v2/reports/united-orders/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19280,7 +13492,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_orders_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + } else { + $httpBody = $generate_united_orders_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -19328,7 +13547,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19336,38 +13555,40 @@ class FbyApi } /** - * Operation getCampaign_3 + * Operation generateUnitedReturnsReport * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaign_3($campaign_id, string $contentType = self::contentTypes['getCampaign_3'][0]) + public function generateUnitedReturnsReport($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - list($response) = $this->getCampaign_3WithHttpInfo($campaign_id, $contentType); + list($response) = $this->generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format, $contentType); return $response; } /** - * Operation getCampaign_3WithHttpInfo + * Operation generateUnitedReturnsReportWithHttpInfo * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaign_3WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_3'][0]) + public function generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $request = $this->getCampaign_3Request($campaign_id, $contentType); + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -19394,196 +13615,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -19597,44 +13667,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignResponse', + '\OpenAPI\Client\Model\GenerateReportResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19642,7 +13689,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19650,7 +13697,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19658,15 +13705,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19674,7 +13713,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -19682,26 +13721,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaign_3Async + * Operation generateUnitedReturnsReportAsync * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_3Async($campaign_id, string $contentType = self::contentTypes['getCampaign_3'][0]) + public function generateUnitedReturnsReportAsync($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - return $this->getCampaign_3AsyncWithHttpInfo($campaign_id, $contentType) + return $this->generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -19710,20 +13752,21 @@ class FbyApi } /** - * Operation getCampaign_3AsyncWithHttpInfo + * Operation generateUnitedReturnsReportAsyncWithHttpInfo * - * Информация о магазине + * Отчет по невыкупам и возвратам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaign_3AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign_3'][0]) + public function generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; - $request = $this->getCampaign_3Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19762,45 +13805,45 @@ class FbyApi } /** - * Create request for operation 'getCampaign_3' + * Create request for operation 'generateUnitedReturnsReport' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign_3'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaign_3Request($campaign_id, string $contentType = self::contentTypes['getCampaign_3'][0]) + public function generateUnitedReturnsReportRequest($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'generate_united_returns_request' is set + if ($generate_united_returns_request === null || (is_array($generate_united_returns_request) && count($generate_united_returns_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaign_3' + 'Missing the required parameter $generate_united_returns_request when calling generateUnitedReturnsReport' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaign_3, must be bigger than or equal to 1.'); - } - - $resourcePath = '/campaigns/{campaignId}'; + + + $resourcePath = '/v2/reports/united-returns/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -19810,7 +13853,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($generate_united_returns_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_returns_request)); + } else { + $httpBody = $generate_united_returns_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -19858,7 +13908,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19866,42 +13916,36 @@ class FbyApi } /** - * Operation getCampaignsByLogin_3 + * Operation getAuthTokenInfo * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaignsByLogin_3($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_3'][0]) + public function getAuthTokenInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - list($response) = $this->getCampaignsByLogin_3WithHttpInfo($login, $page, $page_size, $contentType); + list($response) = $this->getAuthTokenInfoWithHttpInfo($contentType); return $response; } /** - * Operation getCampaignsByLogin_3WithHttpInfo + * Operation getAuthTokenInfoWithHttpInfo * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaignsByLogin_3WithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_3'][0]) + public function getAuthTokenInfoWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $request = $this->getCampaignsByLogin_3Request($login, $page, $page_size, $contentType); + $request = $this->getAuthTokenInfoRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -19928,196 +13972,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20131,44 +14024,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetTokenInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20176,7 +14046,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20184,7 +14054,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20192,15 +14062,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20208,7 +14070,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20216,28 +14078,27 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaignsByLogin_3Async + * Operation getAuthTokenInfoAsync * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_3Async($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_3'][0]) + public function getAuthTokenInfoAsync(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - return $this->getCampaignsByLogin_3AsyncWithHttpInfo($login, $page, $page_size, $contentType) + return $this->getAuthTokenInfoAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -20246,22 +14107,19 @@ class FbyApi } /** - * Operation getCampaignsByLogin_3AsyncWithHttpInfo + * Operation getAuthTokenInfoAsyncWithHttpInfo * - * Магазины, доступные логину + * Получение информации о токене авторизации * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaignsByLogin_3AsyncWithHttpInfo($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_3'][0]) + public function getAuthTokenInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaignsByLogin_3Request($login, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetTokenInfoResponse'; + $request = $this->getAuthTokenInfoRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20300,67 +14158,26 @@ class FbyApi } /** - * Create request for operation 'getCampaignsByLogin_3' + * Create request for operation 'getAuthTokenInfo' * - * @param string $login Логин пользователя. (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignsByLogin_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaignsByLogin_3Request($login, $page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaignsByLogin_3'][0]) + public function getAuthTokenInfoRequest(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) { - // verify the required parameter 'login' is set - if ($login === null || (is_array($login) && count($login) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $login when calling getCampaignsByLogin_3' - ); - } - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getCampaignsByLogin_3, must be smaller than or equal to 10000.'); - } - - - $resourcePath = '/campaigns/by_login/{login}'; + $resourcePath = '/v2/auth/token'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($login !== null) { - $resourcePath = str_replace( - '{' . 'login' . '}', - ObjectSerializer::toPathValue($login), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -20418,7 +14235,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -20426,40 +14243,44 @@ class FbyApi } /** - * Operation getCampaigns_3 + * Operation getBidsInfoForBusiness * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCampaigns_3($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_3'][0]) + public function getBidsInfoForBusiness($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - list($response) = $this->getCampaigns_3WithHttpInfo($page, $page_size, $contentType); + list($response) = $this->getBidsInfoForBusinessWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $response; } /** - * Operation getCampaigns_3WithHttpInfo + * Operation getBidsInfoForBusinessWithHttpInfo * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCampaigns_3WithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_3'][0]) + public function getBidsInfoForBusinessWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $request = $this->getCampaigns_3Request($page, $page_size, $contentType); + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -20486,196 +14307,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCampaignsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -20689,44 +14365,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignsResponse', + '\OpenAPI\Client\Model\GetBidsInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20734,7 +14387,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20742,7 +14395,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20750,7 +14403,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20758,7 +14411,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20766,7 +14419,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20774,27 +14427,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCampaigns_3Async + * Operation getBidsInfoForBusinessAsync * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_3Async($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_3'][0]) + public function getBidsInfoForBusinessAsync($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - return $this->getCampaigns_3AsyncWithHttpInfo($page, $page_size, $contentType) + return $this->getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token, $limit, $get_bids_info_request, $contentType) ->then( function ($response) { return $response[0]; @@ -20803,21 +14460,23 @@ class FbyApi } /** - * Operation getCampaigns_3AsyncWithHttpInfo + * Operation getBidsInfoForBusinessAsyncWithHttpInfo * - * Список магазинов пользователя + * Информация об установленных ставках * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCampaigns_3AsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_3'][0]) + public function getBidsInfoForBusinessAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; - $request = $this->getCampaigns_3Request($page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsInfoResponse'; + $request = $this->getBidsInfoForBusinessRequest($business_id, $page_token, $limit, $get_bids_info_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20856,25 +14515,38 @@ class FbyApi } /** - * Create request for operation 'getCampaigns_3' + * Create request for operation 'getBidsInfoForBusiness' * - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetBidsInfoRequest|null $get_bids_info_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsInfoForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCampaigns_3Request($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns_3'][0]) + public function getBidsInfoForBusinessRequest($business_id, $page_token = null, $limit = null, $get_bids_info_request = null, string $contentType = self::contentTypes['getBidsInfoForBusiness'][0]) { - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getCampaigns_3, must be smaller than or equal to 10000.'); + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBidsInfoForBusiness' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getBidsInfoForBusiness, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns'; + + $resourcePath = '/v2/businesses/{businessId}/bids/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20883,17 +14555,17 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -20901,6 +14573,14 @@ class FbyApi ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -20910,7 +14590,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_bids_info_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_info_request)); + } else { + $httpBody = $get_bids_info_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -20958,7 +14645,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -20966,38 +14653,40 @@ class FbyApi } /** - * Operation getCategoriesMaxSaleQuantum_0 + * Operation getBidsRecommendations * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesMaxSaleQuantum_0($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_0'][0]) + public function getBidsRecommendations($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - list($response) = $this->getCategoriesMaxSaleQuantum_0WithHttpInfo($get_categories_max_sale_quantum_request, $contentType); + list($response) = $this->getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType); return $response; } /** - * Operation getCategoriesMaxSaleQuantum_0WithHttpInfo + * Operation getBidsRecommendationsWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBidsRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesMaxSaleQuantum_0WithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_0'][0]) + public function getBidsRecommendationsWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $request = $this->getCategoriesMaxSaleQuantum_0Request($get_categories_max_sale_quantum_request, $contentType); + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -21024,196 +14713,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21227,44 +14771,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + '\OpenAPI\Client\Model\GetBidsRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21272,7 +14793,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21280,7 +14801,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21288,7 +14809,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21296,7 +14817,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21304,7 +14825,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21312,26 +14833,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesMaxSaleQuantum_0Async + * Operation getBidsRecommendationsAsync * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_0Async($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_0'][0]) + public function getBidsRecommendationsAsync($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - return $this->getCategoriesMaxSaleQuantum_0AsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) + return $this->getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, $contentType) ->then( function ($response) { return $response[0]; @@ -21340,20 +14864,21 @@ class FbyApi } /** - * Operation getCategoriesMaxSaleQuantum_0AsyncWithHttpInfo + * Operation getBidsRecommendationsAsyncWithHttpInfo * - * Лимит на установку кванта продажи и минимального количества товаров в заказе + * Рекомендованные ставки для заданных товаров * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesMaxSaleQuantum_0AsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_0'][0]) + public function getBidsRecommendationsAsyncWithHttpInfo($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; - $request = $this->getCategoriesMaxSaleQuantum_0Request($get_categories_max_sale_quantum_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBidsRecommendationsResponse'; + $request = $this->getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21392,26 +14917,37 @@ class FbyApi } /** - * Create request for operation 'getCategoriesMaxSaleQuantum_0' + * Create request for operation 'getBidsRecommendations' * - * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBidsRecommendationsRequest $get_bids_recommendations_request description. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBidsRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesMaxSaleQuantum_0Request($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum_0'][0]) + public function getBidsRecommendationsRequest($business_id, $get_bids_recommendations_request, string $contentType = self::contentTypes['getBidsRecommendations'][0]) { - // verify the required parameter 'get_categories_max_sale_quantum_request' is set - if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBidsRecommendations' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBidsRecommendations, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_bids_recommendations_request' is set + if ($get_bids_recommendations_request === null || (is_array($get_bids_recommendations_request) && count($get_bids_recommendations_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum_0' + 'Missing the required parameter $get_bids_recommendations_request when calling getBidsRecommendations' ); } - $resourcePath = '/categories/max-sale-quantum'; + $resourcePath = '/v2/businesses/{businessId}/bids/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21420,6 +14956,14 @@ class FbyApi + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -21429,12 +14973,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_categories_max_sale_quantum_request)) { + if (isset($get_bids_recommendations_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_bids_recommendations_request)); } else { - $httpBody = $get_categories_max_sale_quantum_request; + $httpBody = $get_bids_recommendations_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -21492,38 +15036,44 @@ class FbyApi } /** - * Operation getCategoriesTree_0 + * Operation getBusinessOrders * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoriesTree_0($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_0'][0]) + public function getBusinessOrders($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - list($response) = $this->getCategoriesTree_0WithHttpInfo($get_categories_request, $contentType); + list($response) = $this->getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoriesTree_0WithHttpInfo + * Operation getBusinessOrdersWithHttpInfo * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoriesTree_0WithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_0'][0]) + public function getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $request = $this->getCategoriesTree_0Request($get_categories_request, $contentType); + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -21550,196 +15100,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -21753,44 +15158,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoriesResponse', + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21798,7 +15180,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21806,7 +15188,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21814,7 +15196,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21822,7 +15204,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21830,7 +15212,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -21838,26 +15220,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoriesTree_0Async + * Operation getBusinessOrdersAsync * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_0Async($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_0'][0]) + public function getBusinessOrdersAsync($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - return $this->getCategoriesTree_0AsyncWithHttpInfo($get_categories_request, $contentType) + return $this->getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -21866,20 +15253,23 @@ class FbyApi } /** - * Operation getCategoriesTree_0AsyncWithHttpInfo + * Operation getBusinessOrdersAsyncWithHttpInfo * - * Дерево категорий + * Информация о заказах в кабинете * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoriesTree_0AsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_0'][0]) + public function getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; - $request = $this->getCategoriesTree_0Request($get_categories_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessOrdersResponse'; + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21918,28 +15308,78 @@ class FbyApi } /** - * Create request for operation 'getCategoriesTree_0' + * Create request for operation 'getBusinessOrders' * - * @param \OpenAPI\Client\Model\GetCategoriesRequest $get_categories_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoriesTree_0Request($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree_0'][0]) + public function getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessOrders' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_business_orders_request' is set + if ($get_business_orders_request === null || (is_array($get_business_orders_request) && count($get_business_orders_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_business_orders_request when calling getBusinessOrders' + ); + } - $resourcePath = '/categories/tree'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -21949,12 +15389,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_categories_request)) { + if (isset($get_business_orders_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_business_orders_request)); } else { - $httpBody = $get_categories_request; + $httpBody = $get_business_orders_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -22012,38 +15452,44 @@ class FbyApi } /** - * Operation getCategoryContentParameters_1 + * Operation getBusinessQuarantineOffers * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getCategoryContentParameters_1($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_1'][0]) + public function getBusinessQuarantineOffers($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - list($response) = $this->getCategoryContentParameters_1WithHttpInfo($category_id, $contentType); + list($response) = $this->getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getCategoryContentParameters_1WithHttpInfo + * Operation getBusinessQuarantineOffersWithHttpInfo * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCategoryContentParameters_1WithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_1'][0]) + public function getBusinessQuarantineOffersWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $request = $this->getCategoryContentParameters_1Request($category_id, $contentType); + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -22070,196 +15516,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCategoryContentParametersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22273,44 +15574,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22318,7 +15596,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22326,7 +15604,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22334,7 +15612,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22342,7 +15620,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22350,7 +15628,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22358,26 +15636,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getCategoryContentParameters_1Async + * Operation getBusinessQuarantineOffersAsync * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_1Async($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_1'][0]) + public function getBusinessQuarantineOffersAsync($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - return $this->getCategoryContentParameters_1AsyncWithHttpInfo($category_id, $contentType) + return $this->getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -22386,20 +15669,23 @@ class FbyApi } /** - * Operation getCategoryContentParameters_1AsyncWithHttpInfo + * Operation getBusinessQuarantineOffersAsyncWithHttpInfo * - * Списки характеристик товаров по категориям + * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCategoryContentParameters_1AsyncWithHttpInfo($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_1'][0]) + public function getBusinessQuarantineOffersAsyncWithHttpInfo($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; - $request = $this->getCategoryContentParameters_1Request($category_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22438,42 +15724,75 @@ class FbyApi } /** - * Create request for operation 'getCategoryContentParameters_1' + * Create request for operation 'getBusinessQuarantineOffers' * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getCategoryContentParameters_1Request($category_id, string $contentType = self::contentTypes['getCategoryContentParameters_1'][0]) + public function getBusinessQuarantineOffersRequest($business_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessQuarantineOffers'][0]) { - // verify the required parameter 'category_id' is set - if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $category_id when calling getCategoryContentParameters_1' + 'Missing the required parameter $business_id when calling getBusinessQuarantineOffers' ); } - if ($category_id < 1) { - throw new \InvalidArgumentException('invalid value for "$category_id" when calling FbyApi.getCategoryContentParameters_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quarantine_offers_request when calling getBusinessQuarantineOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); } - $resourcePath = '/category/{categoryId}/parameters'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($category_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'categoryId' . '}', - ObjectSerializer::toPathValue($category_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -22486,7 +15805,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_quarantine_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + } else { + $httpBody = $get_quarantine_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -22542,46 +15868,38 @@ class FbyApi } /** - * Operation getChatHistory_2 + * Operation getBusinessSettings * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChatHistory_2($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_2'][0]) + public function getBusinessSettings($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - list($response) = $this->getChatHistory_2WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + list($response) = $this->getBusinessSettingsWithHttpInfo($business_id, $contentType); return $response; } /** - * Operation getChatHistory_2WithHttpInfo + * Operation getBusinessSettingsWithHttpInfo * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChatHistory_2WithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_2'][0]) + public function getBusinessSettingsWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $request = $this->getChatHistory_2Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $request = $this->getBusinessSettingsRequest($business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -22608,196 +15926,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatHistoryResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatHistoryResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -22811,44 +15984,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatHistoryResponse', + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22856,7 +16006,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22864,7 +16014,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22872,7 +16022,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22880,7 +16030,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22888,7 +16038,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -22896,30 +16046,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChatHistory_2Async + * Operation getBusinessSettingsAsync * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_2Async($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_2'][0]) + public function getBusinessSettingsAsync($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - return $this->getChatHistory_2AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) + return $this->getBusinessSettingsAsyncWithHttpInfo($business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -22928,24 +16076,20 @@ class FbyApi } /** - * Operation getChatHistory_2AsyncWithHttpInfo + * Operation getBusinessSettingsAsyncWithHttpInfo * - * Получение истории сообщений в чате + * Настройки кабинета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChatHistory_2AsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_2'][0]) + public function getBusinessSettingsAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; - $request = $this->getChatHistory_2Request($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; + $request = $this->getBusinessSettingsRequest($business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22984,85 +16128,35 @@ class FbyApi } /** - * Create request for operation 'getChatHistory_2' + * Create request for operation 'getBusinessSettings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChatHistory_2Request($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory_2'][0]) + public function getBusinessSettingsRequest($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChatHistory_2' + 'Missing the required parameter $business_id when calling getBusinessSettings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getChatHistory_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getBusinessSettings, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling getChatHistory_2' - ); - } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.getChatHistory_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_chat_history_request' is set - if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chat_history_request when calling getChatHistory_2' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats/history'; + $resourcePath = '/v2/businesses/{businessId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -23082,14 +16176,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_chat_history_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); - } else { - $httpBody = $get_chat_history_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -23145,44 +16232,38 @@ class FbyApi } /** - * Operation getChats_2 + * Operation getCampaign * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getChats_2($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_2'][0]) + public function getCampaign($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - list($response) = $this->getChats_2WithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); + list($response) = $this->getCampaignWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getChats_2WithHttpInfo + * Operation getCampaignWithHttpInfo * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getChats_2WithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_2'][0]) + public function getCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $request = $this->getChats_2Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $request = $this->getCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -23209,196 +16290,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetChatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetChatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetChatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23412,44 +16348,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetChatsResponse', + '\OpenAPI\Client\Model\GetCampaignResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23457,7 +16370,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23465,7 +16378,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23473,7 +16386,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23481,7 +16394,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23489,7 +16402,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -23497,29 +16410,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getChats_2Async + * Operation getCampaignAsync * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_2Async($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_2'][0]) + public function getCampaignAsync($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - return $this->getChats_2AsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) + return $this->getCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -23528,23 +16440,20 @@ class FbyApi } /** - * Operation getChats_2AsyncWithHttpInfo + * Operation getCampaignAsyncWithHttpInfo * - * Получение доступных чатов + * Информация о магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChats_2AsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_2'][0]) + public function getCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; - $request = $this->getChats_2Request($business_id, $get_chats_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; + $request = $this->getCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23583,72 +16492,42 @@ class FbyApi } /** - * Create request for operation 'getChats_2' + * Create request for operation 'getCampaign' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getChats_2Request($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats_2'][0]) + public function getCampaignRequest($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getChats_2' + 'Missing the required parameter $campaign_id when calling getCampaign' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getChats_2, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaign, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_chats_request' is set - if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_chats_request when calling getChats_2' - ); - } - - - - $resourcePath = '/businesses/{businessId}/chats'; + $resourcePath = '/v2/campaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -23661,14 +16540,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_chats_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); - } else { - $httpBody = $get_chats_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -23716,7 +16588,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -23724,50 +16596,44 @@ class FbyApi } /** - * Operation getFeedIndexLogs_3 + * Operation getCampaignOffers * - * Отчет по индексации прайс-листа + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeedIndexLogs_3($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_3'][0]) + public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - list($response) = $this->getFeedIndexLogs_3WithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getFeedIndexLogs_3WithHttpInfo + * Operation getCampaignOffersWithHttpInfo * - * Отчет по индексации прайс-листа + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedIndexLogsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedIndexLogs_3WithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_3'][0]) + public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $request = $this->getFeedIndexLogs_3Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -23794,196 +16660,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedIndexLogsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -23997,44 +16718,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedIndexLogsResponse', + '\OpenAPI\Client\Model\GetCampaignOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24042,7 +16740,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24050,7 +16748,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24058,7 +16756,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24066,7 +16764,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24074,7 +16772,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24082,32 +16780,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedIndexLogs_3Async + * Operation getCampaignOffersAsync * - * Отчет по индексации прайс-листа + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_3Async($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_3'][0]) + public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - return $this->getFeedIndexLogs_3AsyncWithHttpInfo($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType) + return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -24116,26 +16813,23 @@ class FbyApi } /** - * Operation getFeedIndexLogs_3AsyncWithHttpInfo + * Operation getCampaignOffersAsyncWithHttpInfo * - * Отчет по индексации прайс-листа + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedIndexLogs_3AsyncWithHttpInfo($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_3'][0]) + public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedIndexLogsResponse'; - $request = $this->getFeedIndexLogs_3Request($campaign_id, $feed_id, $limit, $published_time_from, $published_time_to, $status, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24174,46 +16868,44 @@ class FbyApi } /** - * Create request for operation 'getFeedIndexLogs_3' + * Create request for operation 'getCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $published_time_from Начальная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Значение по умолчанию: последние восемь дней со времени отправки запроса. (optional) - * @param \DateTime $published_time_to Конечная дата. Используется для фильтрации записей — по дате и времени публикации предложений на Яндекс Маркете. Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-31T00:42:42+03:00`. Значение по умолчанию: дата и время отправки запроса. {% note info %} Если во время переключения между страницами выходных данных на Яндекс Маркете появятся новые результаты индексации прайс-листа, вы не получите часть данных. Чтобы этого не произошло, зафиксируйте выходные данные с помощью входного параметра `published_time_to`. Значение параметра не должно быть датой из будущего. {% endnote %} (optional) - * @param \OpenAPI\Client\Model\FeedIndexLogsStatusType $status Статус индексации и проверки прайс-листа на соответствие техническим требованиям. Возможные значения: * `ERROR` — произошли ошибки. * `OK` — обработан без ошибок. * `WARNING` — наблюдались некритичные проблемы. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedIndexLogs_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeedIndexLogs_3Request($campaign_id, $feed_id, $limit = null, $published_time_from = null, $published_time_to = null, $status = null, string $contentType = self::contentTypes['getFeedIndexLogs_3'][0]) + public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedIndexLogs_3' + 'Missing the required parameter $campaign_id when calling getCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getFeedIndexLogs_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'get_campaign_offers_request' is set + if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeedIndexLogs_3' + 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' ); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + - - - - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/index-logs'; + $resourcePath = '/v2/campaigns/{campaignId}/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24222,26 +16914,8 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_from, - 'published_time_from', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $published_time_to, - 'published_time_to', // param base name + $page_token, + 'page_token', // param base name 'string', // openApiType '', // style false, // explode @@ -24249,9 +16923,9 @@ class FbyApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'FeedIndexLogsStatusType', // openApiType + $limit, + 'limit', // param base name + 'integer', // openApiType '', // style false, // explode false // required @@ -24266,14 +16940,6 @@ class FbyApi $resourcePath ); } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -24283,7 +16949,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_campaign_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + } else { + $httpBody = $get_campaign_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -24331,7 +17004,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -24339,42 +17012,44 @@ class FbyApi } /** - * Operation getFeed_3 + * Operation getCampaignQuarantineOffers * - * Информация о прайс-листе + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeed_3($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_3'][0]) + public function getCampaignQuarantineOffers($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - list($response) = $this->getFeed_3WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getFeed_3WithHttpInfo + * Operation getCampaignQuarantineOffersWithHttpInfo * - * Информация о прайс-листе + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetQuarantineOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeed_3WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_3'][0]) + public function getCampaignQuarantineOffersWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $request = $this->getFeed_3Request($campaign_id, $feed_id, $contentType); + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -24401,196 +17076,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -24604,44 +17134,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedResponse', + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24649,7 +17156,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24657,7 +17164,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24665,7 +17172,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24673,7 +17180,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24681,7 +17188,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -24689,28 +17196,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeed_3Async + * Operation getCampaignQuarantineOffersAsync * - * Информация о прайс-листе + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_3Async($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_3'][0]) + public function getCampaignQuarantineOffersAsync($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - return $this->getFeed_3AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -24719,22 +17229,23 @@ class FbyApi } /** - * Operation getFeed_3AsyncWithHttpInfo + * Operation getCampaignQuarantineOffersAsyncWithHttpInfo * - * Информация о прайс-листе + * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeed_3AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_3'][0]) + public function getCampaignQuarantineOffersAsyncWithHttpInfo($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedResponse'; - $request = $this->getFeed_3Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; + $request = $this->getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24773,44 +17284,68 @@ class FbyApi } /** - * Create request for operation 'getFeed_3' + * Create request for operation 'getCampaignQuarantineOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeed_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeed_3Request($campaign_id, $feed_id, string $contentType = self::contentTypes['getFeed_3'][0]) + public function getCampaignQuarantineOffersRequest($campaign_id, $get_quarantine_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignQuarantineOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeed_3' + 'Missing the required parameter $campaign_id when calling getCampaignQuarantineOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getFeed_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'get_quarantine_offers_request' is set + if ($get_quarantine_offers_request === null || (is_array($get_quarantine_offers_request) && count($get_quarantine_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling getFeed_3' + 'Missing the required parameter $get_quarantine_offers_request when calling getCampaignQuarantineOffers' ); } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -24821,14 +17356,6 @@ class FbyApi $resourcePath ); } - // path params - if ($feed_id !== null) { - $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -24838,7 +17365,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_quarantine_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quarantine_offers_request)); + } else { + $httpBody = $get_quarantine_offers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -24886,7 +17420,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -24894,46 +17428,38 @@ class FbyApi } /** - * Operation getFeedbackAndCommentUpdates_1 + * Operation getCampaignSettings * - * Новые и обновленные отзывы о магазине + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeedbackAndCommentUpdates_1($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_1'][0]) + public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - list($response) = $this->getFeedbackAndCommentUpdates_1WithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType); + list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getFeedbackAndCommentUpdates_1WithHttpInfo + * Operation getCampaignSettingsWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedbackListResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeedbackAndCommentUpdates_1WithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_1'][0]) + public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $request = $this->getFeedbackAndCommentUpdates_1Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -24960,196 +17486,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedbackListResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedbackListResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25163,44 +17544,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedbackListResponse', + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25208,7 +17566,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25216,7 +17574,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25224,7 +17582,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25232,7 +17590,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25240,7 +17598,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25248,30 +17606,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeedbackAndCommentUpdates_1Async + * Operation getCampaignSettingsAsync * - * Новые и обновленные отзывы о магазине + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedbackAndCommentUpdates_1Async($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_1'][0]) + public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - return $this->getFeedbackAndCommentUpdates_1AsyncWithHttpInfo($campaign_id, $page_token, $limit, $from_date, $contentType) + return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -25280,24 +17636,20 @@ class FbyApi } /** - * Operation getFeedbackAndCommentUpdates_1AsyncWithHttpInfo + * Operation getCampaignSettingsAsyncWithHttpInfo * - * Новые и обновленные отзывы о магазине + * Настройки магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeedbackAndCommentUpdates_1AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_1'][0]) + public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedbackListResponse'; - $request = $this->getFeedbackAndCommentUpdates_1Request($campaign_id, $page_token, $limit, $from_date, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25336,69 +17688,35 @@ class FbyApi } /** - * Create request for operation 'getFeedbackAndCommentUpdates_1' + * Create request for operation 'getCampaignSettings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \DateTime $from_date Начальная дата обновления отзывов. Если параметр указан, возвращаются отзывы, которые были написаны или обновлены с этой даты. Формат даты: `ГГГГ-ММ-ДД`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeedbackAndCommentUpdates_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeedbackAndCommentUpdates_1Request($campaign_id, $page_token = null, $limit = null, $from_date = null, string $contentType = self::contentTypes['getFeedbackAndCommentUpdates_1'][0]) + public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeedbackAndCommentUpdates_1' + 'Missing the required parameter $campaign_id when calling getCampaignSettings' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getFeedbackAndCommentUpdates_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getCampaignSettings, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/campaigns/{campaignId}/feedback/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/settings'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'from_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -25474,40 +17792,40 @@ class FbyApi } /** - * Operation getFeeds_3 + * Operation getCampaigns * - * Список прайс-листов магазина + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_3'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFeeds_3($campaign_id, string $contentType = self::contentTypes['getFeeds_3'][0]) + public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - list($response) = $this->getFeeds_3WithHttpInfo($campaign_id, $contentType); + list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); return $response; } /** - * Operation getFeeds_3WithHttpInfo + * Operation getCampaignsWithHttpInfo * - * Список прайс-листов магазина + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_3'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFeedsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFeeds_3WithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_3'][0]) + public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $request = $this->getFeeds_3Request($campaign_id, $contentType); + $request = $this->getCampaignsRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -25534,196 +17852,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFeedsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFeedsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFeedsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -25737,44 +17910,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFeedsResponse', + '\OpenAPI\Client\Model\GetCampaignsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25782,7 +17932,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25790,7 +17940,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25798,7 +17948,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25806,7 +17956,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25814,7 +17964,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -25822,27 +17972,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFeeds_3Async + * Operation getCampaignsAsync * - * Список прайс-листов магазина + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_3'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeeds_3Async($campaign_id, string $contentType = self::contentTypes['getFeeds_3'][0]) + public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - return $this->getFeeds_3AsyncWithHttpInfo($campaign_id, $contentType) + return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -25851,21 +18003,21 @@ class FbyApi } /** - * Operation getFeeds_3AsyncWithHttpInfo + * Operation getCampaignsAsyncWithHttpInfo * - * Список прайс-листов магазина + * Список магазинов пользователя * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_3'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getFeeds_3AsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getFeeds_3'][0]) + public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFeedsResponse'; - $request = $this->getFeeds_3Request($campaign_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; + $request = $this->getCampaignsRequest($page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25904,46 +18056,51 @@ class FbyApi } /** - * Create request for operation 'getFeeds_3' + * Create request for operation 'getCampaigns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFeeds_3'] to see the possible values for this operation + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getFeeds_3Request($campaign_id, string $contentType = self::contentTypes['getFeeds_3'][0]) + public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getFeeds_3' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getFeeds_3, must be bigger than or equal to 1.'); + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getCampaigns, must be smaller than or equal to 10000.'); } - $resourcePath = '/campaigns/{campaignId}/feeds'; + + $resourcePath = '/v2/campaigns'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -26009,36 +18166,40 @@ class FbyApi } /** - * Operation getFulfillmentWarehouses_0 + * Operation getCategoriesMaxSaleQuantum * - * Идентификаторы складов Маркета (FBY) + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getFulfillmentWarehouses_0(string $contentType = self::contentTypes['getFulfillmentWarehouses_0'][0]) + public function getCategoriesMaxSaleQuantum($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - list($response) = $this->getFulfillmentWarehouses_0WithHttpInfo($contentType); + list($response) = $this->getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, $contentType); return $response; } /** - * Operation getFulfillmentWarehouses_0WithHttpInfo + * Operation getCategoriesMaxSaleQuantumWithHttpInfo * - * Идентификаторы складов Маркета (FBY) + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getFulfillmentWarehouses_0WithHttpInfo(string $contentType = self::contentTypes['getFulfillmentWarehouses_0'][0]) + public function getCategoriesMaxSaleQuantumWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $request = $this->getFulfillmentWarehouses_0Request($contentType); + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -26065,196 +18226,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26268,44 +18284,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26313,7 +18306,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26321,7 +18314,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26329,7 +18322,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26337,7 +18330,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26345,7 +18338,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26353,25 +18346,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getFulfillmentWarehouses_0Async + * Operation getCategoriesMaxSaleQuantumAsync * - * Идентификаторы складов Маркета (FBY) + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getFulfillmentWarehouses_0Async(string $contentType = self::contentTypes['getFulfillmentWarehouses_0'][0]) + public function getCategoriesMaxSaleQuantumAsync($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - return $this->getFulfillmentWarehouses_0AsyncWithHttpInfo($contentType) + return $this->getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, $contentType) ->then( function ($response) { return $response[0]; @@ -26380,19 +18377,21 @@ class FbyApi } /** - * Operation getFulfillmentWarehouses_0AsyncWithHttpInfo + * Operation getCategoriesMaxSaleQuantumAsyncWithHttpInfo * - * Идентификаторы складов Маркета (FBY) + * Лимит на установку кванта продажи и минимального количества товаров в заказе * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getFulfillmentWarehouses_0AsyncWithHttpInfo(string $contentType = self::contentTypes['getFulfillmentWarehouses_0'][0]) + public function getCategoriesMaxSaleQuantumAsyncWithHttpInfo($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { - $returnType = '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse'; - $request = $this->getFulfillmentWarehouses_0Request($contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumResponse'; + $request = $this->getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26431,18 +18430,27 @@ class FbyApi } /** - * Create request for operation 'getFulfillmentWarehouses_0' + * Create request for operation 'getCategoriesMaxSaleQuantum' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesMaxSaleQuantumRequest $get_categories_max_sale_quantum_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesMaxSaleQuantum'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getFulfillmentWarehouses_0Request(string $contentType = self::contentTypes['getFulfillmentWarehouses_0'][0]) + public function getCategoriesMaxSaleQuantumRequest($get_categories_max_sale_quantum_request, string $contentType = self::contentTypes['getCategoriesMaxSaleQuantum'][0]) { + // verify the required parameter 'get_categories_max_sale_quantum_request' is set + if ($get_categories_max_sale_quantum_request === null || (is_array($get_categories_max_sale_quantum_request) && count($get_categories_max_sale_quantum_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_categories_max_sale_quantum_request when calling getCategoriesMaxSaleQuantum' + ); + } + - $resourcePath = '/warehouses'; + $resourcePath = '/v2/categories/max-sale-quantum'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26460,7 +18468,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_categories_max_sale_quantum_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_max_sale_quantum_request)); + } else { + $httpBody = $get_categories_max_sale_quantum_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -26508,7 +18523,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -26516,44 +18531,38 @@ class FbyApi } /** - * Operation getGoodsFeedbackComments_0 + * Operation getCategoriesTree * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbackComments_0($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_0'][0]) + public function getCategoriesTree($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - list($response) = $this->getGoodsFeedbackComments_0WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + list($response) = $this->getCategoriesTreeWithHttpInfo($get_categories_request, $contentType); return $response; } /** - * Operation getGoodsFeedbackComments_0WithHttpInfo + * Operation getCategoriesTreeWithHttpInfo * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbackComments_0WithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_0'][0]) + public function getCategoriesTreeWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $request = $this->getGoodsFeedbackComments_0Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -26580,196 +18589,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -26783,44 +18647,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + '\OpenAPI\Client\Model\GetCategoriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26828,7 +18669,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26836,7 +18677,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26844,7 +18685,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26852,7 +18693,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26860,7 +18701,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -26868,29 +18709,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbackComments_0Async + * Operation getCategoriesTreeAsync * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_0Async($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_0'][0]) + public function getCategoriesTreeAsync($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - return $this->getGoodsFeedbackComments_0AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) + return $this->getCategoriesTreeAsyncWithHttpInfo($get_categories_request, $contentType) ->then( function ($response) { return $response[0]; @@ -26899,23 +18739,20 @@ class FbyApi } /** - * Operation getGoodsFeedbackComments_0AsyncWithHttpInfo + * Operation getCategoriesTreeAsyncWithHttpInfo * - * Получение комментариев к отзыву + * Дерево категорий * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbackComments_0AsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_0'][0]) + public function getCategoriesTreeAsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - $request = $this->getGoodsFeedbackComments_0Request($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26954,75 +18791,28 @@ class FbyApi } /** - * Create request for operation 'getGoodsFeedbackComments_0' + * Create request for operation 'getCategoriesTree' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments_0'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbackComments_0Request($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments_0'][0]) + public function getCategoriesTreeRequest($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbackComments_0' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getGoodsFeedbackComments_0, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_goods_feedback_comments_request' is set - if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments_0' - ); - } - - - $resourcePath = '/businesses/{businessId}/goods-feedback/comments'; + $resourcePath = '/v2/categories/tree'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -27032,12 +18822,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_goods_feedback_comments_request)) { + if (isset($get_categories_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); } else { - $httpBody = $get_goods_feedback_comments_request; + $httpBody = $get_categories_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -27095,44 +18885,40 @@ class FbyApi } /** - * Operation getGoodsFeedbacks_0 + * Operation getCategoryContentParameters * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_0'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsFeedbacks_0($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_0'][0]) + public function getCategoryContentParameters($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - list($response) = $this->getGoodsFeedbacks_0WithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $business_id, $contentType); return $response; } /** - * Operation getGoodsFeedbacks_0WithHttpInfo + * Operation getCategoryContentParametersWithHttpInfo * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_0'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsFeedbacks_0WithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_0'][0]) + public function getCategoryContentParametersWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $request = $this->getGoodsFeedbacks_0Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27159,196 +18945,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -27362,44 +19003,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27407,7 +19025,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27415,7 +19033,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27423,7 +19041,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27431,7 +19049,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27439,7 +19057,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27447,29 +19065,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsFeedbacks_0Async + * Operation getCategoryContentParametersAsync * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_0'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_0Async($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_0'][0]) + public function getCategoryContentParametersAsync($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - return $this->getGoodsFeedbacks_0AsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) + return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id, $contentType) ->then( function ($response) { return $response[0]; @@ -27478,23 +19096,21 @@ class FbyApi } /** - * Operation getGoodsFeedbacks_0AsyncWithHttpInfo + * Operation getCategoryContentParametersAsyncWithHttpInfo * - * Получение отзывов о товарах продавца + * Списки характеристик товаров по категориям * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_0'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsFeedbacks_0AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_0'][0]) + public function getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - $request = $this->getGoodsFeedbacks_0Request($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27533,35 +19149,34 @@ class FbyApi } /** - * Create request for operation 'getGoodsFeedbacks_0' + * Create request for operation 'getCategoryContentParameters' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks_0'] to see the possible values for this operation + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsFeedbacks_0Request($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks_0'][0]) + public function getCategoryContentParametersRequest($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'category_id' is set + if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getGoodsFeedbacks_0' + 'Missing the required parameter $category_id when calling getCategoryContentParameters' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getGoodsFeedbacks_0, must be bigger than or equal to 1.'); + if ($category_id <= 0) { + throw new \InvalidArgumentException('invalid value for "$category_id" when calling FbyApi.getCategoryContentParameters, must be bigger than 0.'); + } + + if ($business_id !== null && $business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getCategoryContentParameters, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/businesses/{businessId}/goods-feedback'; + $resourcePath = '/v2/category/{categoryId}/parameters'; $formParams = []; $queryParams = []; $headerParams = []; @@ -27570,17 +19185,8 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $business_id, + 'businessId', // param base name 'integer', // openApiType '', // style false, // explode @@ -27589,10 +19195,10 @@ class FbyApi // path params - if ($business_id !== null) { + if ($category_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'categoryId' . '}', + ObjectSerializer::toPathValue($category_id), $resourcePath ); } @@ -27605,14 +19211,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_goods_feedback_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); - } else { - $httpBody = $get_goods_feedback_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -27668,40 +19267,40 @@ class FbyApi } /** - * Operation getGoodsStats_0 + * Operation getChat * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getGoodsStats_0($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_0'][0]) + public function getChat($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - list($response) = $this->getGoodsStats_0WithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); + list($response) = $this->getChatWithHttpInfo($business_id, $chat_id, $contentType); return $response; } /** - * Operation getGoodsStats_0WithHttpInfo + * Operation getChatWithHttpInfo * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getGoodsStats_0WithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_0'][0]) + public function getChatWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $request = $this->getGoodsStats_0Request($campaign_id, $get_goods_stats_request, $contentType); + $request = $this->getChatRequest($business_id, $chat_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -27728,196 +19327,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -27931,44 +19385,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetGoodsStatsResponse', + '\OpenAPI\Client\Model\GetChatResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27976,7 +19407,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27984,7 +19415,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -27992,7 +19423,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28000,7 +19431,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28008,7 +19439,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28016,27 +19447,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getGoodsStats_0Async + * Operation getChatAsync * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_0Async($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_0'][0]) + public function getChatAsync($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - return $this->getGoodsStats_0AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) + return $this->getChatAsyncWithHttpInfo($business_id, $chat_id, $contentType) ->then( function ($response) { return $response[0]; @@ -28045,21 +19478,21 @@ class FbyApi } /** - * Operation getGoodsStats_0AsyncWithHttpInfo + * Operation getChatAsyncWithHttpInfo * - * Отчет по товарам + * Получение чата по идентификатору * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getGoodsStats_0AsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_0'][0]) + public function getChatAsyncWithHttpInfo($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - $request = $this->getGoodsStats_0Request($campaign_id, $get_goods_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatResponse'; + $request = $this->getChatRequest($business_id, $chat_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28098,50 +19531,62 @@ class FbyApi } /** - * Create request for operation 'getGoodsStats_0' + * Create request for operation 'getChat' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getGoodsStats_0Request($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats_0'][0]) + public function getChatRequest($business_id, $chat_id, string $contentType = self::contentTypes['getChat'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getGoodsStats_0' + 'Missing the required parameter $business_id when calling getChat' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getGoodsStats_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getChat, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_goods_stats_request' is set - if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats_0' + 'Missing the required parameter $chat_id when calling getChat' ); } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.getChat, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/stats/skus'; + $resourcePath = '/v2/businesses/{businessId}/chat'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $chat_id, + 'chatId', // param base name + 'integer', // openApiType + '', // style + false, // explode + true // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -28154,14 +19599,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_goods_stats_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); - } else { - $httpBody = $get_goods_stats_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -28209,7 +19647,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -28217,50 +19655,46 @@ class FbyApi } /** - * Operation getHiddenOffers_0 + * Operation getChatHistory * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getHiddenOffers_0($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_0'][0]) + public function getChatHistory($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - list($response) = $this->getHiddenOffers_0WithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + list($response) = $this->getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getHiddenOffers_0WithHttpInfo + * Operation getChatHistoryWithHttpInfo * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatHistoryResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getHiddenOffers_0WithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_0'][0]) + public function getChatHistoryWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $request = $this->getHiddenOffers_0Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -28287,169 +19721,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetHiddenOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -28463,44 +19779,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatHistoryResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetHiddenOffersResponse', + '\OpenAPI\Client\Model\GetChatHistoryResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28508,7 +19801,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28516,7 +19809,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28524,7 +19817,15 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28532,7 +19833,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -28540,32 +19841,32 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getHiddenOffers_0Async + * Operation getChatHistoryAsync * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_0Async($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_0'][0]) + public function getChatHistoryAsync($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - return $this->getHiddenOffers_0AsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType) + return $this->getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -28574,26 +19875,24 @@ class FbyApi } /** - * Operation getHiddenOffers_0AsyncWithHttpInfo + * Operation getChatHistoryAsyncWithHttpInfo * - * Информация о скрытых вами товарах + * Получение истории сообщений в чате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffers_0AsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_0'][0]) + public function getChatHistoryAsyncWithHttpInfo($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - $request = $this->getHiddenOffers_0Request($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatHistoryResponse'; + $request = $this->getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28632,44 +19931,55 @@ class FbyApi } /** - * Create request for operation 'getHiddenOffers_0' + * Create request for operation 'getChatHistory' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \OpenAPI\Client\Model\GetChatHistoryRequest $get_chat_history_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatHistory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getHiddenOffers_0Request($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers_0'][0]) + public function getChatHistoryRequest($business_id, $chat_id, $get_chat_history_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChatHistory'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getHiddenOffers_0' + 'Missing the required parameter $business_id when calling getChatHistory' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getHiddenOffers_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getChatHistory, must be bigger than or equal to 1.'); } + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatHistory' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.getChatHistory, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_chat_history_request' is set + if ($get_chat_history_request === null || (is_array($get_chat_history_request) && count($get_chat_history_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chat_history_request when calling getChatHistory' + ); + } - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getHiddenOffers_0, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getChatHistory, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/businesses/{businessId}/chats/history'; $formParams = []; $queryParams = []; $headerParams = []; @@ -28678,12 +19988,12 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType + $chat_id, + 'chatId', // param base name + 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( @@ -28703,40 +20013,13 @@ class FbyApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -28749,7 +20032,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_chat_history_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chat_history_request)); + } else { + $httpBody = $get_chat_history_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -28797,7 +20087,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -28805,44 +20095,42 @@ class FbyApi } /** - * Operation getOfferCardsContentStatus_1 + * Operation getChatMessage * - * Получение информации о заполненности карточек магазина + * Получение сообщения в чате * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferCardsContentStatus_1($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_1'][0]) + public function getChatMessage($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - list($response) = $this->getOfferCardsContentStatus_1WithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + list($response) = $this->getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, $contentType); return $response; } /** - * Operation getOfferCardsContentStatus_1WithHttpInfo + * Operation getChatMessageWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение сообщения в чате * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetChatMessageResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferCardsContentStatus_1WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_1'][0]) + public function getChatMessageWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $request = $this->getOfferCardsContentStatus_1Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -28869,196 +20157,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29072,44 +20215,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatMessageResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + '\OpenAPI\Client\Model\GetChatMessageResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29117,7 +20237,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29125,7 +20245,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29133,7 +20253,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29141,7 +20261,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29149,7 +20269,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29157,29 +20277,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferCardsContentStatus_1Async + * Operation getChatMessageAsync * - * Получение информации о заполненности карточек магазина + * Получение сообщения в чате * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_1Async($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_1'][0]) + public function getChatMessageAsync($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - return $this->getOfferCardsContentStatus_1AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) + return $this->getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, $contentType) ->then( function ($response) { return $response[0]; @@ -29188,23 +20309,22 @@ class FbyApi } /** - * Operation getOfferCardsContentStatus_1AsyncWithHttpInfo + * Operation getChatMessageAsyncWithHttpInfo * - * Получение информации о заполненности карточек магазина + * Получение сообщения в чате * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferCardsContentStatus_1AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_1'][0]) + public function getChatMessageAsyncWithHttpInfo($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; - $request = $this->getOfferCardsContentStatus_1Request($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatMessageResponse'; + $request = $this->getChatMessageRequest($business_id, $chat_id, $message_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29243,35 +20363,51 @@ class FbyApi } /** - * Create request for operation 'getOfferCardsContentStatus_1' + * Create request for operation 'getChatMessage' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest $get_offer_cards_content_status_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param int $message_id Идентификатор сообщения. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChatMessage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferCardsContentStatus_1Request($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus_1'][0]) + public function getChatMessageRequest($business_id, $chat_id, $message_id, string $contentType = self::contentTypes['getChatMessage'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferCardsContentStatus_1' + 'Missing the required parameter $business_id when calling getChatMessage' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getOfferCardsContentStatus_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling getChatMessage' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.getChatMessage, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'message_id' is set + if ($message_id === null || (is_array($message_id) && count($message_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $message_id when calling getChatMessage' + ); + } + if ($message_id < 1) { + throw new \InvalidArgumentException('invalid value for "$message_id" when calling FbyApi.getChatMessage, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/businesses/{businessId}/offer-cards'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -29280,21 +20416,21 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $chat_id, + 'chatId', // param base name + 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $message_id, + 'messageId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); @@ -29315,14 +20451,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_offer_cards_content_status_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); - } else { - $httpBody = $get_offer_cards_content_status_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -29370,7 +20499,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -29378,58 +20507,44 @@ class FbyApi } /** - * Operation getOfferMappingEntries_0 + * Operation getChats * - * Список товаров в каталоге + * Получение доступных чатов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappingEntries_0($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_0'][0]) + public function getChats($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - list($response) = $this->getOfferMappingEntries_0WithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + list($response) = $this->getChatsWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOfferMappingEntries_0WithHttpInfo + * Operation getChatsWithHttpInfo * - * Список товаров в каталоге + * Получение доступных чатов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetChatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappingEntries_0WithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_0'][0]) + public function getChatsWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $request = $this->getOfferMappingEntries_0Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -29456,196 +20571,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -29659,44 +20629,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetChatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetChatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29704,7 +20651,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29712,7 +20659,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29720,7 +20667,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29728,7 +20675,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29736,7 +20683,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -29744,36 +20691,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappingEntries_0Async + * Operation getChatsAsync * - * Список товаров в каталоге + * Получение доступных чатов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_0Async($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_0'][0]) + public function getChatsAsync($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - return $this->getOfferMappingEntries_0AsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) + return $this->getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -29782,30 +20724,23 @@ class FbyApi } /** - * Operation getOfferMappingEntries_0AsyncWithHttpInfo + * Operation getChatsAsyncWithHttpInfo * - * Список товаров в каталоге + * Получение доступных чатов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOfferMappingEntries_0AsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_0'][0]) + public function getChatsAsyncWithHttpInfo($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - $request = $this->getOfferMappingEntries_0Request($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetChatsResponse'; + $request = $this->getChatsRequest($business_id, $get_chats_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29844,117 +20779,50 @@ class FbyApi } /** - * Create request for operation 'getOfferMappingEntries_0' + * Create request for operation 'getChats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetChatsRequest $get_chats_request description (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getChats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOfferMappingEntries_0Request($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries_0'][0]) + public function getChatsRequest($business_id, $get_chats_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getChats'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOfferMappingEntries_0' + 'Missing the required parameter $business_id when calling getChats' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOfferMappingEntries_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getChats, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_chats_request' is set + if ($get_chats_request === null || (is_array($get_chats_request) && count($get_chats_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_chats_request when calling getChats' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getChats, must be bigger than or equal to 1.'); + } + - - - - - - - - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries'; + $resourcePath = '/v2/businesses/{businessId}/chats'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offer_id, - 'offer_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_sku, - 'shop_sku', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $mapping_kind, - 'mapping_kind', // param base name - 'OfferMappingKindType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $availability, - 'availability', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $category_id, - 'category_id', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $vendor, - 'vendor', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, @@ -29976,10 +20844,10 @@ class FbyApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -29992,7 +20860,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_chats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_chats_request)); + } else { + $httpBody = $get_chats_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -30040,7 +20915,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -30048,44 +20923,44 @@ class FbyApi } /** - * Operation getOfferMappings_1 + * Operation getDefaultPrices * - * Информация о товарах в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferMappings_1($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_1'][0]) + public function getDefaultPrices($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - list($response) = $this->getOfferMappings_1WithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + list($response) = $this->getDefaultPricesWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $response; } /** - * Operation getOfferMappings_1WithHttpInfo + * Operation getDefaultPricesWithHttpInfo * - * Информация о товарах в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferMappings_1WithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_1'][0]) + public function getDefaultPricesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $request = $this->getOfferMappings_1Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -30112,196 +20987,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30315,44 +21045,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferMappingsResponse', + '\OpenAPI\Client\Model\GetDefaultPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30360,7 +21067,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30368,7 +21075,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30376,7 +21083,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30384,7 +21091,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30392,7 +21099,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30400,29 +21107,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferMappings_1Async + * Operation getDefaultPricesAsync * - * Информация о товарах в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_1Async($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_1'][0]) + public function getDefaultPricesAsync($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - return $this->getOfferMappings_1AsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType) + return $this->getDefaultPricesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -30431,23 +21140,23 @@ class FbyApi } /** - * Operation getOfferMappings_1AsyncWithHttpInfo + * Operation getDefaultPricesAsyncWithHttpInfo * - * Информация о товарах в каталоге + * Просмотр цен на указанные товары во всех магазинах * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferMappings_1AsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_1'][0]) + public function getDefaultPricesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; - $request = $this->getOfferMappings_1Request($business_id, $page_token, $limit, $get_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDefaultPricesResponse'; + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30486,35 +21195,38 @@ class FbyApi } /** - * Create request for operation 'getOfferMappings_1' + * Create request for operation 'getDefaultPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOfferMappingsRequest $get_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferMappings_1Request($business_id, $page_token = null, $limit = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings_1'][0]) + public function getDefaultPricesRequest($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferMappings_1' + 'Missing the required parameter $business_id when calling getDefaultPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getOfferMappings_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getDefaultPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/offer-mappings'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -30558,12 +21270,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_offer_mappings_request)) { + if (isset($get_default_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_default_prices_request)); } else { - $httpBody = $get_offer_mappings_request; + $httpBody = $get_default_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -30621,44 +21333,38 @@ class FbyApi } /** - * Operation getOfferRecommendations_1 + * Operation getFulfillmentWarehouses * - * Рекомендации Маркета, касающиеся цен + * Идентификаторы складов Маркета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_1'] to see the possible values for this operation + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOfferRecommendations_1($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_1'][0]) + public function getFulfillmentWarehouses($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - list($response) = $this->getOfferRecommendations_1WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + list($response) = $this->getFulfillmentWarehousesWithHttpInfo($campaign_id, $contentType); return $response; } /** - * Operation getOfferRecommendations_1WithHttpInfo + * Operation getFulfillmentWarehousesWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Идентификаторы складов Маркета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_1'] to see the possible values for this operation + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOfferRecommendations_1WithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_1'][0]) + public function getFulfillmentWarehousesWithHttpInfo($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - $request = $this->getOfferRecommendations_1Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $request = $this->getFulfillmentWarehousesRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -30685,196 +21391,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -30888,44 +21449,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30933,7 +21471,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30941,7 +21479,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30949,7 +21487,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30957,7 +21495,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30965,7 +21503,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -30973,29 +21511,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOfferRecommendations_1Async + * Operation getFulfillmentWarehousesAsync * - * Рекомендации Маркета, касающиеся цен + * Идентификаторы складов Маркета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_1'] to see the possible values for this operation + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_1Async($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_1'][0]) + public function getFulfillmentWarehousesAsync($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - return $this->getOfferRecommendations_1AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) + return $this->getFulfillmentWarehousesAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -31004,23 +21541,20 @@ class FbyApi } /** - * Operation getOfferRecommendations_1AsyncWithHttpInfo + * Operation getFulfillmentWarehousesAsyncWithHttpInfo * - * Рекомендации Маркета, касающиеся цен + * Идентификаторы складов Маркета * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_1'] to see the possible values for this operation + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOfferRecommendations_1AsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_1'][0]) + public function getFulfillmentWarehousesAsyncWithHttpInfo($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - $request = $this->getOfferRecommendations_1Request($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse'; + $request = $this->getFulfillmentWarehousesRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31059,41 +21593,23 @@ class FbyApi } /** - * Create request for operation 'getOfferRecommendations_1' + * Create request for operation 'getFulfillmentWarehouses' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations_1'] to see the possible values for this operation + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOfferRecommendations_1Request($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations_1'][0]) + public function getFulfillmentWarehousesRequest($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferRecommendations_1' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getOfferRecommendations_1, must be bigger than or equal to 1.'); + if ($campaign_id !== null && $campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getFulfillmentWarehouses, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_offer_recommendations_request' is set - if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations_1' - ); - } - - - - $resourcePath = '/businesses/{businessId}/offers/recommendations'; + $resourcePath = '/v2/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31102,17 +21618,8 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $campaign_id, + 'campaignId', // param base name 'integer', // openApiType '', // style false, // explode @@ -31120,14 +21627,6 @@ class FbyApi ) ?? []); - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -31137,14 +21636,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_offer_recommendations_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); - } else { - $httpBody = $get_offer_recommendations_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -31192,7 +21684,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31200,54 +21692,44 @@ class FbyApi } /** - * Operation getOffers_3 + * Operation getGoodsFeedbackComments * - * Предложения магазина + * Получение комментариев к отзыву * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOffers_3($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_3'][0]) + public function getGoodsFeedbackComments($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - list($response) = $this->getOffers_3WithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + list($response) = $this->getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOffers_3WithHttpInfo + * Operation getGoodsFeedbackCommentsWithHttpInfo * - * Предложения магазина + * Получение комментариев к отзыву * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOffers_3WithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_3'][0]) + public function getGoodsFeedbackCommentsWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $request = $this->getOffers_3Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -31274,196 +21756,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -31477,44 +21814,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOffersResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31522,7 +21836,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31530,7 +21844,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31538,7 +21852,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31546,7 +21860,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31554,7 +21868,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -31562,34 +21876,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOffers_3Async + * Operation getGoodsFeedbackCommentsAsync * - * Предложения магазина + * Получение комментариев к отзыву * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_3Async($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_3'][0]) + public function getGoodsFeedbackCommentsAsync($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - return $this->getOffers_3AsyncWithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType) + return $this->getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -31598,28 +21909,23 @@ class FbyApi } /** - * Operation getOffers_3AsyncWithHttpInfo + * Operation getGoodsFeedbackCommentsAsyncWithHttpInfo * - * Предложения магазина + * Получение комментариев к отзыву * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffers_3AsyncWithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_3'][0]) + public function getGoodsFeedbackCommentsAsyncWithHttpInfo($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - $request = $this->getOffers_3Request($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; + $request = $this->getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31658,47 +21964,44 @@ class FbyApi } /** - * Create request for operation 'getOffers_3' + * Create request for operation 'getGoodsFeedbackComments' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers_3'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOffers_3Request($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers_3'][0]) + public function getGoodsFeedbackCommentsRequest($business_id, $get_goods_feedback_comments_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsFeedbackComments'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOffers_3' + 'Missing the required parameter $business_id when calling getGoodsFeedbackComments' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOffers_3, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_goods_feedback_comments_request' is set + if ($get_goods_feedback_comments_request === null || (is_array($get_goods_feedback_comments_request) && count($get_goods_feedback_comments_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_goods_feedback_comments_request when calling getGoodsFeedbackComments' + ); + } - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getOffers_3, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -31707,26 +22010,8 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_category_id, - 'shopCategoryId', // param base name + $page_token, + 'page_token', // param base name 'string', // openApiType '', // style false, // explode @@ -31734,35 +22019,8 @@ class FbyApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $matched, - 'matched', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -31771,10 +22029,10 @@ class FbyApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -31787,7 +22045,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_feedback_comments_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_comments_request)); + } else { + $httpBody = $get_goods_feedback_comments_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -31835,7 +22100,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -31843,40 +22108,44 @@ class FbyApi } /** - * Operation getOrderBusinessBuyerInfo_1 + * Operation getGoodsFeedbacks * - * Информация о покупателе — юридическом лице + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessBuyerInfo_1($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_1'][0]) + public function getGoodsFeedbacks($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - list($response) = $this->getOrderBusinessBuyerInfo_1WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsFeedbacksWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $response; } /** - * Operation getOrderBusinessBuyerInfo_1WithHttpInfo + * Operation getGoodsFeedbacksWithHttpInfo * - * Информация о покупателе — юридическом лице + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsFeedbackResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessBuyerInfo_1WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_1'][0]) + public function getGoodsFeedbacksWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $request = $this->getOrderBusinessBuyerInfo_1Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -31903,196 +22172,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32106,44 +22230,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32151,7 +22252,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32159,7 +22260,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32167,7 +22268,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32175,7 +22276,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32183,7 +22284,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32191,27 +22292,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessBuyerInfo_1Async + * Operation getGoodsFeedbacksAsync * - * Информация о покупателе — юридическом лице + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_1Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_1'][0]) + public function getGoodsFeedbacksAsync($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - return $this->getOrderBusinessBuyerInfo_1AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType) ->then( function ($response) { return $response[0]; @@ -32220,21 +22325,23 @@ class FbyApi } /** - * Operation getOrderBusinessBuyerInfo_1AsyncWithHttpInfo + * Operation getGoodsFeedbacksAsyncWithHttpInfo * - * Информация о покупателе — юридическом лице + * Получение отзывов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessBuyerInfo_1AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_1'][0]) + public function getGoodsFeedbacksAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - $request = $this->getOrderBusinessBuyerInfo_1Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; + $request = $this->getGoodsFeedbacksRequest($business_id, $page_token, $limit, $get_goods_feedback_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32273,58 +22380,69 @@ class FbyApi } /** - * Create request for operation 'getOrderBusinessBuyerInfo_1' + * Create request for operation 'getGoodsFeedbacks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessBuyerInfo_1Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo_1'][0]) + public function getGoodsFeedbacksRequest($business_id, $page_token = null, $limit = null, $get_goods_feedback_request = null, string $contentType = self::contentTypes['getGoodsFeedbacks'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo_1' + 'Missing the required parameter $business_id when calling getGoodsFeedbacks' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrderBusinessBuyerInfo_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo_1' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -32337,7 +22455,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_goods_feedback_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_feedback_request)); + } else { + $httpBody = $get_goods_feedback_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -32393,40 +22518,44 @@ class FbyApi } /** - * Operation getOrderBusinessDocumentsInfo_1 + * Operation getGoodsQuestionAnswers * - * Информация о документах + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrderBusinessDocumentsInfo_1($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_1'][0]) + public function getGoodsQuestionAnswers($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - list($response) = $this->getOrderBusinessDocumentsInfo_1WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrderBusinessDocumentsInfo_1WithHttpInfo + * Operation getGoodsQuestionAnswersWithHttpInfo * - * Информация о документах + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderBusinessDocumentsInfo_1WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_1'][0]) + public function getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $request = $this->getOrderBusinessDocumentsInfo_1Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -32453,196 +22582,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -32656,44 +22640,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + '\OpenAPI\Client\Model\GetAnswersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32701,7 +22662,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32709,7 +22670,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32717,7 +22678,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32725,7 +22686,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32733,7 +22694,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -32741,27 +22702,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderBusinessDocumentsInfo_1Async + * Operation getGoodsQuestionAnswersAsync * - * Информация о документах + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_1Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_1'][0]) + public function getGoodsQuestionAnswersAsync($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - return $this->getOrderBusinessDocumentsInfo_1AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -32770,21 +22735,23 @@ class FbyApi } /** - * Operation getOrderBusinessDocumentsInfo_1AsyncWithHttpInfo + * Operation getGoodsQuestionAnswersAsyncWithHttpInfo * - * Информация о документах + * Получение ответов на вопрос * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderBusinessDocumentsInfo_1AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_1'][0]) + public function getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - $request = $this->getOrderBusinessDocumentsInfo_1Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetAnswersResponse'; + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -32823,58 +22790,75 @@ class FbyApi } /** - * Create request for operation 'getOrderBusinessDocumentsInfo_1' + * Create request for operation 'getGoodsQuestionAnswers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderBusinessDocumentsInfo_1Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo_1'][0]) + public function getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo_1' + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getGoodsQuestionAnswers' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrderBusinessDocumentsInfo_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_answers_request' is set + if ($get_answers_request === null || (is_array($get_answers_request) && count($get_answers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo_1' + 'Missing the required parameter $get_answers_request when calling getGoodsQuestionAnswers' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/documents'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/goods-questions/answers'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -32887,7 +22871,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_answers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_answers_request)); + } else { + $httpBody = $get_answers_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -32943,40 +22934,44 @@ class FbyApi } /** - * Operation getOrder_0 + * Operation getGoodsQuestions * - * Информация об одном заказе + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrder_0($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_0'][0]) + public function getGoodsQuestions($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - list($response) = $this->getOrder_0WithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getGoodsQuestionsWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType); return $response; } /** - * Operation getOrder_0WithHttpInfo + * Operation getGoodsQuestionsWithHttpInfo * - * Информация об одном заказе + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrder_0WithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_0'][0]) + public function getGoodsQuestionsWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $request = $this->getOrder_0Request($campaign_id, $order_id, $contentType); + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -33003,196 +22998,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33206,44 +23056,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderResponse', + '\OpenAPI\Client\Model\GetQuestionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33251,7 +23078,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33259,7 +23086,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33267,7 +23094,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33275,7 +23102,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33283,7 +23110,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33291,27 +23118,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrder_0Async + * Operation getGoodsQuestionsAsync * - * Информация об одном заказе + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_0Async($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_0'][0]) + public function getGoodsQuestionsAsync($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - return $this->getOrder_0AsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType) ->then( function ($response) { return $response[0]; @@ -33320,21 +23151,23 @@ class FbyApi } /** - * Operation getOrder_0AsyncWithHttpInfo + * Operation getGoodsQuestionsAsyncWithHttpInfo * - * Информация об одном заказе + * Получение вопросов о товарах продавца * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrder_0AsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_0'][0]) + public function getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - $request = $this->getOrder_0Request($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetQuestionsResponse'; + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33373,58 +23206,69 @@ class FbyApi } /** - * Create request for operation 'getOrder_0' + * Create request for operation 'getGoodsQuestions' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrder_0Request($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder_0'][0]) + public function getGoodsQuestionsRequest($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrder_0' + 'Missing the required parameter $business_id when calling getGoodsQuestions' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrder_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getGoodsQuestions, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrder_0' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getGoodsQuestions, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -33437,7 +23281,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_questions_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_questions_request)); + } else { + $httpBody = $get_questions_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -33485,7 +23336,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -33493,44 +23344,40 @@ class FbyApi } /** - * Operation getOrdersStats_0 + * Operation getGoodsStats * - * Детальная информация по заказам + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrdersStats_0($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_0'][0]) + public function getGoodsStats($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - list($response) = $this->getOrdersStats_0WithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + list($response) = $this->getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType); return $response; } /** - * Operation getOrdersStats_0WithHttpInfo + * Operation getGoodsStatsWithHttpInfo * - * Детальная информация по заказам + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetGoodsStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrdersStats_0WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_0'][0]) + public function getGoodsStatsWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $request = $this->getOrdersStats_0Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -33557,196 +23404,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -33760,44 +23462,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersStatsResponse', + '\OpenAPI\Client\Model\GetGoodsStatsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33805,7 +23484,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33813,7 +23492,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33821,7 +23500,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33829,7 +23508,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33837,7 +23516,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -33845,29 +23524,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrdersStats_0Async + * Operation getGoodsStatsAsync * - * Детальная информация по заказам + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrdersStats_0Async($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_0'][0]) + public function getGoodsStatsAsync($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - return $this->getOrdersStats_0AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + return $this->getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, $contentType) ->then( function ($response) { return $response[0]; @@ -33876,23 +23555,21 @@ class FbyApi } /** - * Operation getOrdersStats_0AsyncWithHttpInfo + * Operation getGoodsStatsAsyncWithHttpInfo * - * Детальная информация по заказам + * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrdersStats_0AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_0'][0]) + public function getGoodsStatsAsyncWithHttpInfo($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - $request = $this->getOrdersStats_0Request($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; + $request = $this->getGoodsStatsRequest($campaign_id, $get_goods_stats_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -33931,59 +23608,43 @@ class FbyApi } /** - * Create request for operation 'getOrdersStats_0' + * Create request for operation 'getGoodsStats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrdersStats_0Request($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats_0'][0]) + public function getGoodsStatsRequest($campaign_id, $get_goods_stats_request, string $contentType = self::contentTypes['getGoodsStats'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrdersStats_0' + 'Missing the required parameter $campaign_id when calling getGoodsStats' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrdersStats_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getGoodsStats, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_goods_stats_request' is set + if ($get_goods_stats_request === null || (is_array($get_goods_stats_request) && count($get_goods_stats_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_goods_stats_request when calling getGoodsStats' + ); + } - - - $resourcePath = '/campaigns/{campaignId}/stats/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/skus'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -34003,12 +23664,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_orders_stats_request)) { + if (isset($get_goods_stats_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_goods_stats_request)); } else { - $httpBody = $get_orders_stats_request; + $httpBody = $get_goods_stats_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -34066,76 +23727,44 @@ class FbyApi } /** - * Operation getOrders_2 + * Operation getHiddenOffers * - * Информация о нескольких заказах + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrders_2($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_2'][0]) + public function getHiddenOffers($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - list($response) = $this->getOrders_2WithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + list($response) = $this->getHiddenOffersWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrders_2WithHttpInfo - * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_2'] to see the possible values for this operation + * Operation getHiddenOffersWithHttpInfo + * + * Информация о скрытых вами товарах + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrders_2WithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_2'][0]) + public function getHiddenOffersWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $request = $this->getOrders_2Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -34162,196 +23791,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -34365,44 +23843,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersResponse', + '\OpenAPI\Client\Model\GetHiddenOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34410,7 +23865,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34418,7 +23873,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34426,15 +23881,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34442,7 +23889,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -34450,45 +23897,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrders_2Async + * Operation getHiddenOffersAsync * - * Информация о нескольких заказах + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrders_2Async($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_2'][0]) + public function getHiddenOffersAsync($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - return $this->getOrders_2AsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + return $this->getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -34497,39 +23930,23 @@ class FbyApi } /** - * Operation getOrders_2AsyncWithHttpInfo + * Operation getHiddenOffersAsyncWithHttpInfo * - * Информация о нескольких заказах + * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrders_2AsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_2'][0]) + public function getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - $request = $this->getOrders_2Request($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -34568,70 +23985,38 @@ class FbyApi } /** - * Create request for operation 'getOrders_2' + * Create request for operation 'getHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders_2'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrders_2Request($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders_2'][0]) + public function getHiddenOffersRequest($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrders_2' + 'Missing the required parameter $campaign_id when calling getHiddenOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrders_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getHiddenOffers, must be bigger than or equal to 1.'); } - - - - - - - - - - - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getOrders_2, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getHiddenOffers, must be bigger than or equal to 1.'); } - - - - $resourcePath = '/campaigns/{campaignId}/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -34640,158 +24025,14 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $status, - 'status', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $substatus, - 'substatus', // param base name + $offer_id, + 'offer_id', // param base name 'array', // openApiType '', // style false, // explode false // required ) ?? []); // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_from, - 'supplierShipmentDateFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $supplier_shipment_date_to, - 'supplierShipmentDateTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_from, - 'updatedAtFrom', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $updated_at_to, - 'updatedAtTo', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $dispatch_type, - 'dispatchType', // param base name - 'OrderDeliveryDispatchType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $fake, - 'fake', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $has_cis, - 'hasCis', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_waiting_for_cancellation_approve, - 'onlyWaitingForCancellationApprove', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $only_estimated_delivery, - 'onlyEstimatedDelivery', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $buyer_type, - 'buyerType', // param base name - 'OrderBuyerType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $page_token, 'page_token', // param base name @@ -34884,44 +24125,44 @@ class FbyApi } /** - * Operation getPricesByOfferIds_0 + * Operation getOfferCardsContentStatus * - * Просмотр цен на указанные товары в магазине + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPricesByOfferIds_0($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_0'][0]) + public function getOfferCardsContentStatus($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - list($response) = $this->getPricesByOfferIds_0WithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + list($response) = $this->getOfferCardsContentStatusWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); return $response; } /** - * Operation getPricesByOfferIds_0WithHttpInfo + * Operation getOfferCardsContentStatusWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPricesByOfferIds_0WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_0'][0]) + public function getOfferCardsContentStatusWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - $request = $this->getPricesByOfferIds_0Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -34948,196 +24189,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35151,44 +24247,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35196,7 +24269,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35204,7 +24277,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35212,7 +24285,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35220,7 +24293,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35228,7 +24301,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35236,29 +24309,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPricesByOfferIds_0Async + * Operation getOfferCardsContentStatusAsync * - * Просмотр цен на указанные товары в магазине + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPricesByOfferIds_0Async($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_0'][0]) + public function getOfferCardsContentStatusAsync($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - return $this->getPricesByOfferIds_0AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + return $this->getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) ->then( function ($response) { return $response[0]; @@ -35267,23 +24342,23 @@ class FbyApi } /** - * Operation getPricesByOfferIds_0AsyncWithHttpInfo + * Operation getOfferCardsContentStatusAsyncWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Получение информации о заполненности карточек магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPricesByOfferIds_0AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_0'][0]) + public function getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - $request = $this->getPricesByOfferIds_0Request($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35322,35 +24397,38 @@ class FbyApi } /** - * Create request for operation 'getPricesByOfferIds_0' + * Create request for operation 'getOfferCardsContentStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPricesByOfferIds_0Request($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds_0'][0]) + public function getOfferCardsContentStatusRequest($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPricesByOfferIds_0' + 'Missing the required parameter $business_id when calling getOfferCardsContentStatus' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getPricesByOfferIds_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35378,10 +24456,10 @@ class FbyApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -35394,12 +24472,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_prices_by_offer_ids_request)) { + if (isset($get_offer_cards_content_status_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); } else { - $httpBody = $get_prices_by_offer_ids_request; + $httpBody = $get_offer_cards_content_status_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -35457,46 +24535,58 @@ class FbyApi } /** - * Operation getPrices_0 + * Operation getOfferMappingEntries * - * Список цен + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function getPrices_0($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_0'][0]) + public function getOfferMappingEntries($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - list($response) = $this->getPrices_0WithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + list($response) = $this->getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); return $response; } /** - * Operation getPrices_0WithHttpInfo + * Operation getOfferMappingEntriesWithHttpInfo * - * Список цен + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getPrices_0WithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_0'][0]) + public function getOfferMappingEntriesWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - $request = $this->getPrices_0Request($campaign_id, $page_token, $limit, $archived, $contentType); + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -35523,196 +24613,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -35726,44 +24671,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesResponse', + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35771,7 +24693,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35779,7 +24701,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35787,7 +24709,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35795,7 +24717,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35803,7 +24725,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -35811,30 +24733,38 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPrices_0Async + * Operation getOfferMappingEntriesAsync * - * Список цен + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getPrices_0Async($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_0'][0]) + public function getOfferMappingEntriesAsync($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - return $this->getPrices_0AsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + return $this->getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -35843,24 +24773,30 @@ class FbyApi } /** - * Operation getPrices_0AsyncWithHttpInfo + * Operation getOfferMappingEntriesAsyncWithHttpInfo * - * Список цен + * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getPrices_0AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_0'][0]) + public function getOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - $request = $this->getPrices_0Request($campaign_id, $page_token, $limit, $archived, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; + $request = $this->getOfferMappingEntriesRequest($campaign_id, $offer_id, $shop_sku, $mapping_kind, $status, $availability, $category_id, $vendor, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -35899,36 +24835,51 @@ class FbyApi } /** - * Create request for operation 'getPrices_0' + * Create request for operation 'getOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getPrices_0Request($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices_0'][0]) + public function getOfferMappingEntriesRequest($campaign_id, $offer_id = null, $shop_sku = null, $mapping_kind = null, $status = null, $availability = null, $category_id = null, $vendor = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPrices_0' + 'Missing the required parameter $campaign_id when calling getOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getPrices_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOfferMappingEntries, must be bigger than or equal to 1.'); } + + + + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getOfferMappingEntries, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries'; $formParams = []; $queryParams = []; $headerParams = []; @@ -35937,27 +24888,81 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType + $offer_id, + 'offer_id', // param base name + 'array', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $shop_sku, + 'shop_sku', // param base name + 'array', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $archived, - 'archived', // param base name - 'boolean', // openApiType + $mapping_kind, + 'mapping_kind', // param base name + 'OfferMappingKindType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $availability, + 'availability', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $category_id, + 'category_id', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $vendor, + 'vendor', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType '', // style false, // explode false // required @@ -36037,44 +25042,46 @@ class FbyApi } /** - * Operation getPromoOffers_0 + * Operation getOfferMappings * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация о товарах в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromoOffers_0($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_0'][0]) + public function getOfferMappings($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - list($response) = $this->getPromoOffers_0WithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $response; } /** - * Operation getPromoOffers_0WithHttpInfo + * Operation getOfferMappingsWithHttpInfo * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация о товарах в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromoOffers_0WithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_0'][0]) + public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - $request = $this->getPromoOffers_0Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -36101,196 +25108,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36304,44 +25166,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPromoOffersResponse', + '\OpenAPI\Client\Model\GetOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36349,7 +25188,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36357,7 +25196,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36365,7 +25204,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36373,7 +25212,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36381,7 +25220,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36389,29 +25228,32 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromoOffers_0Async + * Operation getOfferMappingsAsync * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация о товарах в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromoOffers_0Async($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_0'][0]) + public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - return $this->getPromoOffers_0AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) + return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -36420,23 +25262,24 @@ class FbyApi } /** - * Operation getPromoOffers_0AsyncWithHttpInfo + * Operation getOfferMappingsAsyncWithHttpInfo * - * Получение списка товаров, которые участвуют или могут участвовать в акции + * Информация о товарах в каталоге * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromoOffers_0AsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_0'][0]) + public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - $request = $this->getPromoOffers_0Request($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -36475,41 +25318,40 @@ class FbyApi } /** - * Create request for operation 'getPromoOffers_0' + * Create request for operation 'getOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromoOffers_0Request($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers_0'][0]) + public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromoOffers_0' + 'Missing the required parameter $business_id when calling getOfferMappings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getPromoOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getOfferMappings, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_promo_offers_request' is set - if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers_0' - ); - } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getOfferMappings, must be bigger than or equal to 1.'); + } + - $resourcePath = '/businesses/{businessId}/promos/offers'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -36534,6 +25376,15 @@ class FbyApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -36553,12 +25404,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_promo_offers_request)) { + if (isset($get_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promo_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); } else { - $httpBody = $get_promo_offers_request; + $httpBody = $get_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -36616,40 +25467,44 @@ class FbyApi } /** - * Operation getPromos_0 + * Operation getOfferRecommendations * - * Получение списка акций + * Рекомендации Маркета, касающиеся цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPromos_0($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_0'][0]) + public function getOfferRecommendations($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - list($response) = $this->getPromos_0WithHttpInfo($business_id, $get_promos_request, $contentType); + list($response) = $this->getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getPromos_0WithHttpInfo + * Operation getOfferRecommendationsWithHttpInfo * - * Получение списка акций + * Рекомендации Маркета, касающиеся цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPromos_0WithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_0'][0]) + public function getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $request = $this->getPromos_0Request($business_id, $get_promos_request, $contentType); + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -36676,196 +25531,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromosResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromosResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromosResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -36879,44 +25589,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPromosResponse', + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36924,7 +25611,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36932,7 +25619,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36940,7 +25627,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36948,7 +25635,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36956,7 +25643,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -36964,27 +25651,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPromos_0Async + * Operation getOfferRecommendationsAsync * - * Получение списка акций + * Рекомендации Маркета, касающиеся цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_0Async($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_0'][0]) + public function getOfferRecommendationsAsync($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - return $this->getPromos_0AsyncWithHttpInfo($business_id, $get_promos_request, $contentType) + return $this->getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -36993,21 +25684,23 @@ class FbyApi } /** - * Operation getPromos_0AsyncWithHttpInfo + * Operation getOfferRecommendationsAsyncWithHttpInfo * - * Получение списка акций + * Рекомендации Маркета, касающиеся цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPromos_0AsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_0'][0]) + public function getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - $request = $this->getPromos_0Request($business_id, $get_promos_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37046,37 +25739,68 @@ class FbyApi } /** - * Create request for operation 'getPromos_0' + * Create request for operation 'getOfferRecommendations' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPromos_0Request($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos_0'][0]) + public function getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getPromos_0' + 'Missing the required parameter $business_id when calling getOfferRecommendations' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getPromos_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getOfferRecommendations, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_offer_recommendations_request' is set + if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations' + ); + } - $resourcePath = '/businesses/{businessId}/promos'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getOfferRecommendations, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/offers/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -37096,12 +25820,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_promos_request)) { + if (isset($get_offer_recommendations_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promos_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); } else { - $httpBody = $get_promos_request; + $httpBody = $get_offer_recommendations_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -37159,40 +25883,42 @@ class FbyApi } /** - * Operation getQualityRatings_0 + * Operation getOrder * - * Индекс качества магазинов + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getQualityRatings_0($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_0'][0]) + public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - list($response) = $this->getQualityRatings_0WithHttpInfo($business_id, $get_quality_rating_request, $contentType); + list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getQualityRatings_0WithHttpInfo + * Operation getOrderWithHttpInfo * - * Индекс качества магазинов + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getQualityRatings_0WithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_0'][0]) + public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $request = $this->getQualityRatings_0Request($business_id, $get_quality_rating_request, $contentType); + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -37219,196 +25945,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -37422,44 +26003,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetQualityRatingResponse', + '\OpenAPI\Client\Model\GetOrderResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37467,7 +26025,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37475,7 +26033,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37483,7 +26041,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37491,7 +26049,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37499,7 +26057,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -37507,27 +26065,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getQualityRatings_0Async + * Operation getOrderAsync * - * Индекс качества магазинов + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getQualityRatings_0Async($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_0'][0]) + public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - return $this->getQualityRatings_0AsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) + return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -37536,21 +26097,22 @@ class FbyApi } /** - * Operation getQualityRatings_0AsyncWithHttpInfo + * Operation getOrderAsyncWithHttpInfo * - * Индекс качества магазинов + * Информация об одном заказе в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getQualityRatings_0AsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_0'][0]) + public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - $request = $this->getQualityRatings_0Request($business_id, $get_quality_rating_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -37589,37 +26151,38 @@ class FbyApi } /** - * Create request for operation 'getQualityRatings_0' + * Create request for operation 'getOrder' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getQualityRatings_0Request($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings_0'][0]) + public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getQualityRatings_0' + 'Missing the required parameter $campaign_id when calling getOrder' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getQualityRatings_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrder, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_quality_rating_request' is set - if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings_0' + 'Missing the required parameter $order_id when calling getOrder' ); } - $resourcePath = '/businesses/{businessId}/ratings/quality'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -37629,10 +26192,18 @@ class FbyApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -37645,14 +26216,7 @@ class FbyApi ); // for model (json/xml) - if (isset($get_quality_rating_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quality_rating_request)); - } else { - $httpBody = $get_quality_rating_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -37700,7 +26264,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -37708,38 +26272,40 @@ class FbyApi } /** - * Operation getReportInfo_0 + * Operation getOrderBusinessBuyerInfo * - * Получение заданного отчета + * Информация о покупателе — юридическом лице * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReportInfo_0($report_id, string $contentType = self::contentTypes['getReportInfo_0'][0]) + public function getOrderBusinessBuyerInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - list($response) = $this->getReportInfo_0WithHttpInfo($report_id, $contentType); + list($response) = $this->getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getReportInfo_0WithHttpInfo + * Operation getOrderBusinessBuyerInfoWithHttpInfo * - * Получение заданного отчета + * Информация о покупателе — юридическом лице * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessBuyerInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReportInfo_0WithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_0'][0]) + public function getOrderBusinessBuyerInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - $request = $this->getReportInfo_0Request($report_id, $contentType); + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -37766,196 +26332,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReportInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReportInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReportInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -37969,44 +26390,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReportInfoResponse', + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38014,7 +26412,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38022,7 +26420,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38030,7 +26428,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38038,7 +26436,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38046,7 +26444,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38054,26 +26452,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReportInfo_0Async + * Operation getOrderBusinessBuyerInfoAsync * - * Получение заданного отчета + * Информация о покупателе — юридическом лице * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_0Async($report_id, string $contentType = self::contentTypes['getReportInfo_0'][0]) + public function getOrderBusinessBuyerInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - return $this->getReportInfo_0AsyncWithHttpInfo($report_id, $contentType) + return $this->getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -38082,20 +26483,21 @@ class FbyApi } /** - * Operation getReportInfo_0AsyncWithHttpInfo + * Operation getOrderBusinessBuyerInfoAsyncWithHttpInfo * - * Получение заданного отчета + * Информация о покупателе — юридическом лице * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReportInfo_0AsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo_0'][0]) + public function getOrderBusinessBuyerInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - $request = $this->getReportInfo_0Request($report_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; + $request = $this->getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38134,26 +26536,37 @@ class FbyApi } /** - * Create request for operation 'getReportInfo_0' + * Create request for operation 'getOrderBusinessBuyerInfo' * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReportInfo_0Request($report_id, string $contentType = self::contentTypes['getReportInfo_0'][0]) + public function getOrderBusinessBuyerInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessBuyerInfo'][0]) { - // verify the required parameter 'report_id' is set - if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBusinessBuyerInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrderBusinessBuyerInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $report_id when calling getReportInfo_0' + 'Missing the required parameter $order_id when calling getOrderBusinessBuyerInfo' ); } - $resourcePath = '/reports/info/{reportId}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/business-buyer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38163,10 +26576,18 @@ class FbyApi // path params - if ($report_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'reportId' . '}', - ObjectSerializer::toPathValue($report_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), $resourcePath ); } @@ -38227,7 +26648,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -38235,46 +26656,40 @@ class FbyApi } /** - * Operation getReturnPhoto_3 + * Operation getOrderBusinessDocumentsInfo * - * Получение фотографии возврата + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturnPhoto_3($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_3'][0]) + public function getOrderBusinessDocumentsInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - list($response) = $this->getReturnPhoto_3WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + list($response) = $this->getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getReturnPhoto_3WithHttpInfo + * Operation getOrderBusinessDocumentsInfoWithHttpInfo * - * Получение фотографии возврата + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnPhoto_3WithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_3'][0]) + public function getOrderBusinessDocumentsInfoWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - $request = $this->getReturnPhoto_3Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -38301,196 +26716,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -38504,44 +26774,21 @@ class FbyApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38549,7 +26796,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38557,7 +26804,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38565,7 +26812,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38573,7 +26820,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38581,7 +26828,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -38589,30 +26836,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturnPhoto_3Async + * Operation getOrderBusinessDocumentsInfoAsync * - * Получение фотографии возврата + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_3Async($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_3'][0]) + public function getOrderBusinessDocumentsInfoAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - return $this->getReturnPhoto_3AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) + return $this->getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -38621,24 +26867,21 @@ class FbyApi } /** - * Operation getReturnPhoto_3AsyncWithHttpInfo + * Operation getOrderBusinessDocumentsInfoAsyncWithHttpInfo * - * Получение фотографии возврата + * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param int $item_id Идентификатор товара в возврате. (required) - * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnPhoto_3AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_3'][0]) + public function getOrderBusinessDocumentsInfoAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) { - $returnType = '\SplFileObject'; - $request = $this->getReturnPhoto_3Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; + $request = $this->getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -38677,61 +26920,5038 @@ class FbyApi } /** - * Create request for operation 'getReturnPhoto_3' + * Create request for operation 'getOrderBusinessDocumentsInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderBusinessDocumentsInfoRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderBusinessDocumentsInfo'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderBusinessDocumentsInfo' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrderBusinessDocumentsInfo, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderBusinessDocumentsInfo' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrders + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOrdersWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersAsync + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersAsyncWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrders' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrders' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrders, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbyApi.getOrders, number of items must be less than or equal to 50.'); + } + if ($order_ids !== null && count($order_ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbyApi.getOrders, number of items must be greater than or equal to 1.'); + } + + + + + + + + + + + + + + + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.getOrders, must be smaller than or equal to 10000.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $substatus, + 'substatus', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_from, + 'supplierShipmentDateFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_to, + 'supplierShipmentDateTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_from, + 'updatedAtFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_to, + 'updatedAtTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dispatch_type, + 'dispatchType', // param base name + 'OrderDeliveryDispatchType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fake, + 'fake', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_cis, + 'hasCis', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_waiting_for_cancellation_approve, + 'onlyWaitingForCancellationApprove', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_estimated_delivery, + 'onlyEstimatedDelivery', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_type, + 'buyerType', // param base name + 'OrderBuyerType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrdersStats + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrdersStats($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + list($response) = $this->getOrdersStatsWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + return $response; + } + + /** + * Operation getOrdersStatsWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersStatsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrdersStatsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersStatsAsync + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsync($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + return $this->getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersStatsAsyncWithHttpInfo + * + * Детальная информация по заказам + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrdersStatsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; + $request = $this->getOrdersStatsRequest($campaign_id, $page_token, $limit, $get_orders_stats_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrdersStats' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrdersStatsRequest($campaign_id, $page_token = null, $limit = null, $get_orders_stats_request = null, string $contentType = self::contentTypes['getOrdersStats'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrdersStats' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getOrdersStats, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getOrdersStats, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/stats/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_orders_stats_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_orders_stats_request)); + } else { + $httpBody = $get_orders_stats_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPrices + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getPrices($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + list($response) = $this->getPricesWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + return $response; + } + + /** + * Operation getPricesWithHttpInfo + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getPricesWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPricesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPricesAsync + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getPricesAsync($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + return $this->getPricesAsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricesAsyncWithHttpInfo + * + * Список цен + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getPricesAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPrices' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getPricesRequest($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getPrices' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getPrices, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getPrices, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $archived, + 'archived', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPricesByOfferIds + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + return $response; + } + + /** + * Operation getPricesByOfferIdsWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPricesByOfferIdsAsync + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricesByOfferIdsAsyncWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPricesByOfferIds' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_prices_by_offer_ids_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + } else { + $httpBody = $get_prices_by_offer_ids_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPromoOffers + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPromoOffers($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + list($response) = $this->getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getPromoOffersWithHttpInfo + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPromoOffersWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPromoOffersAsync + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromoOffersAsync($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + return $this->getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPromoOffersAsyncWithHttpInfo + * + * Получение списка товаров, которые участвуют или могут участвовать в акции + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromoOffersAsyncWithHttpInfo($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; + $request = $this->getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPromoOffers' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPromoOffersRequest($business_id, $get_promo_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getPromoOffers'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getPromoOffers' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getPromoOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_promo_offers_request' is set + if ($get_promo_offers_request === null || (is_array($get_promo_offers_request) && count($get_promo_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_promo_offers_request when calling getPromoOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getPromoOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/promos/offers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_promo_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promo_offers_request)); + } else { + $httpBody = $get_promo_offers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPromos + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPromos($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + list($response) = $this->getPromosWithHttpInfo($business_id, $get_promos_request, $contentType); + return $response; + } + + /** + * Operation getPromosWithHttpInfo + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPromosResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPromosWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPromosResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPromosAsync + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromosAsync($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + return $this->getPromosAsyncWithHttpInfo($business_id, $get_promos_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPromosAsyncWithHttpInfo + * + * Получение списка акций + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPromosAsyncWithHttpInfo($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; + $request = $this->getPromosRequest($business_id, $get_promos_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPromos' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPromosRequest($business_id, $get_promos_request = null, string $contentType = self::contentTypes['getPromos'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getPromos' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getPromos, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/businesses/{businessId}/promos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_promos_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_promos_request)); + } else { + $httpBody = $get_promos_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getQualityRatings + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getQualityRatings($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + list($response) = $this->getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, $contentType); + return $response; + } + + /** + * Operation getQualityRatingsWithHttpInfo + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetQualityRatingResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getQualityRatingsWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getQualityRatingsAsync + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getQualityRatingsAsync($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + return $this->getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getQualityRatingsAsyncWithHttpInfo + * + * Индекс качества магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getQualityRatingsAsyncWithHttpInfo($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; + $request = $this->getQualityRatingsRequest($business_id, $get_quality_rating_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getQualityRatings' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getQualityRatingsRequest($business_id, $get_quality_rating_request, string $contentType = self::contentTypes['getQualityRatings'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getQualityRatings' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getQualityRatings, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_quality_rating_request' is set + if ($get_quality_rating_request === null || (is_array($get_quality_rating_request) && count($get_quality_rating_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_quality_rating_request when calling getQualityRatings' + ); + } + + + $resourcePath = '/v2/businesses/{businessId}/ratings/quality'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_quality_rating_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_quality_rating_request)); + } else { + $httpBody = $get_quality_rating_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRegionsCodes + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getRegionsCodes(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + list($response) = $this->getRegionsCodesWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getRegionsCodesWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getRegionsCodesWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $request = $this->getRegionsCodesRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getRegionsCodesAsync + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsync(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + return $this->getRegionsCodesAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRegionsCodesAsyncWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsyncWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionsCodesResponse'; + $request = $this->getRegionsCodesRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRegionsCodes' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRegionsCodesRequest(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + + + $resourcePath = '/v2/regions/countries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReportInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + list($response) = $this->getReportInfoWithHttpInfo($report_id, $contentType); + return $response; + } + + /** + * Operation getReportInfoWithHttpInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportInfoWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + $request = $this->getReportInfoRequest($report_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReportInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReportInfoAsync + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportInfoAsync($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + return $this->getReportInfoAsyncWithHttpInfo($report_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportInfoAsyncWithHttpInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportInfoAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; + $request = $this->getReportInfoRequest($report_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportInfo' + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportInfoRequest($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $report_id when calling getReportInfo' + ); + } + if (strlen($report_id) > 255) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling FbyApi.getReportInfo, must be smaller than or equal to 255.'); + } + if (strlen($report_id) < 1) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling FbyApi.getReportInfo, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/reports/info/{reportId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($report_id !== null) { + $resourcePath = str_replace( + '{' . 'reportId' . '}', + ObjectSerializer::toPathValue($report_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReturn + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReturn($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + list($response) = $this->getReturnWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + return $response; + } + + /** + * Operation getReturnWithHttpInfo + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReturnWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReturnResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReturnAsync + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + return $this->getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReturnAsyncWithHttpInfo + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReturn' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReturnRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getReturn' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturn, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getReturn' + ); + } + + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $return_id when calling getReturn' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReturnApplication + * + * Получение заявления на возврат + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReturnApplication($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) + { + list($response) = $this->getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + return $response; + } + + /** + * Operation getReturnApplicationWithHttpInfo + * + * Получение заявления на возврат + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReturnApplicationWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) + { + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReturnApplicationAsync + * + * Получение заявления на возврат + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnApplicationAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) + { + return $this->getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReturnApplicationAsyncWithHttpInfo + * + * Получение заявления на возврат + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnApplicationAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) + { + $returnType = '\SplFileObject'; + $request = $this->getReturnApplicationRequest($campaign_id, $order_id, $return_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReturnApplication' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReturnApplicationRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturnApplication'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getReturnApplication' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturnApplication, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getReturnApplication' + ); + } + + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $return_id when calling getReturnApplication' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/octet-stream', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReturnPhoto + * + * Получение фотографий товаров в возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReturnPhoto($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) + { + list($response) = $this->getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + return $response; + } + + /** + * Operation getReturnPhotoWithHttpInfo + * + * Получение фотографий товаров в возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReturnPhotoWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) + { + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReturnPhotoAsync + * + * Получение фотографий товаров в возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnPhotoAsync($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) + { + return $this->getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReturnPhotoAsyncWithHttpInfo + * + * Получение фотографий товаров в возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param int $item_id Идентификатор товара в возврате. (required) + * @param string $image_hash Хеш ссылки изображения для загрузки. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnPhotoAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) + { + $returnType = '\SplFileObject'; + $request = $this->getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReturnPhoto' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnPhoto_3Request($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto_3'][0]) + public function getReturnPhotoRequest($campaign_id, $order_id, $return_id, $item_id, $image_hash, string $contentType = self::contentTypes['getReturnPhoto'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturnPhoto_3' + 'Missing the required parameter $campaign_id when calling getReturnPhoto' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturnPhoto_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturnPhoto, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturnPhoto_3' + 'Missing the required parameter $order_id when calling getReturnPhoto' ); } // verify the required parameter 'return_id' is set if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturnPhoto_3' + 'Missing the required parameter $return_id when calling getReturnPhoto' ); } // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $item_id when calling getReturnPhoto_3' + 'Missing the required parameter $item_id when calling getReturnPhoto' ); } // verify the required parameter 'image_hash' is set if ($image_hash === null || (is_array($image_hash) && count($image_hash) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $image_hash when calling getReturnPhoto_3' + 'Missing the required parameter $image_hash when calling getReturnPhoto' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -38845,42 +32065,58 @@ class FbyApi } /** - * Operation getReturn_3 + * Operation getReturns * - * Информация о невыкупе или возврате + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturn_3($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_3'][0]) + public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - list($response) = $this->getReturn_3WithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $response; } /** - * Operation getReturn_3WithHttpInfo + * Operation getReturnsWithHttpInfo * - * Информация о невыкупе или возврате + * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturn_3WithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_3'][0]) + public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $request = $this->getReturn_3Request($campaign_id, $order_id, $return_id, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); try { $options = $this->createHttpClientOption(); @@ -38907,196 +32143,551 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReturnsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReturnsAsync + * + * Список невыкупов и возвратов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReturnsAsyncWithHttpInfo + * + * Список невыкупов и возвратов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } + if ($returnType !== 'string') { + $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReturns' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getReturns' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturns, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getReturns, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbyApi.getReturns, number of items must be less than or equal to 50.'); + } + + + + + + + + + + $resourcePath = '/v2/campaigns/{campaignId}/returns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $statuses, + 'statuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shipment_statuses, + 'shipmentStatuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'ReturnType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date2, + 'from_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date2, + 'to_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getStocks + * + * Информация об остатках и оборачиваемости + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getStocks($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + list($response) = $this->getStocksWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + return $response; + } + + /** + * Operation getStocksWithHttpInfo + * + * Информация об остатках и оборачиваемости + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getStocksWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + $statusCode = $response->getStatusCode(); - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39110,44 +32701,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnResponse', + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39155,7 +32723,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39163,7 +32731,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39171,15 +32739,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39187,7 +32747,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39195,28 +32755,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturn_3Async + * Operation getStocksAsync * - * Информация о невыкупе или возврате + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_3Async($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_3'][0]) + public function getStocksAsync($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - return $this->getReturn_3AsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->getStocksAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) ->then( function ($response) { return $response[0]; @@ -39225,22 +32788,23 @@ class FbyApi } /** - * Operation getReturn_3AsyncWithHttpInfo + * Operation getStocksAsyncWithHttpInfo * - * Информация о невыкупе или возврате + * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturn_3AsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_3'][0]) + public function getStocksAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - $request = $this->getReturn_3Request($campaign_id, $order_id, $return_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39279,51 +32843,62 @@ class FbyApi } /** - * Create request for operation 'getReturn_3' + * Create request for operation 'getStocks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturn_3Request($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn_3'][0]) + public function getStocksRequest($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturn_3' + 'Missing the required parameter $campaign_id when calling getStocks' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturn_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getStocks, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getReturn_3' - ); - } - // verify the required parameter 'return_id' is set - if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $return_id when calling getReturn_3' - ); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getStocks, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -39334,22 +32909,6 @@ class FbyApi $resourcePath ); } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - // path params - if ($return_id !== null) { - $resourcePath = str_replace( - '{' . 'returnId' . '}', - ObjectSerializer::toPathValue($return_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -39359,7 +32918,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_warehouse_stocks_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); + } else { + $httpBody = $get_warehouse_stocks_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -39407,7 +32973,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -39415,56 +32981,42 @@ class FbyApi } /** - * Operation getReturns_3 + * Operation getSuggestedOfferMappingEntries * - * Список невыкупов и возвратов + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getReturns_3($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_3'][0]) + public function getSuggestedOfferMappingEntries($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - list($response) = $this->getReturns_3WithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + list($response) = $this->getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $response; } /** - * Operation getReturns_3WithHttpInfo + * Operation getSuggestedOfferMappingEntriesWithHttpInfo * - * Список невыкупов и возвратов + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getReturns_3WithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_3'][0]) + public function getSuggestedOfferMappingEntriesWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $request = $this->getReturns_3Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -39491,196 +33043,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -39694,44 +33101,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetReturnsResponse', + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39739,7 +33123,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39747,7 +33131,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39755,7 +33139,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39763,7 +33147,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39771,7 +33155,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -39779,35 +33163,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getReturns_3Async + * Operation getSuggestedOfferMappingEntriesAsync * - * Список невыкупов и возвратов + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getReturns_3Async($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_3'][0]) + public function getSuggestedOfferMappingEntriesAsync($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - return $this->getReturns_3AsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + return $this->getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) ->then( function ($response) { return $response[0]; @@ -39816,29 +33195,22 @@ class FbyApi } /** - * Operation getReturns_3AsyncWithHttpInfo + * Operation getSuggestedOfferMappingEntriesAsyncWithHttpInfo * - * Список невыкупов и возвратов + * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getReturns_3AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_3'][0]) + public function getSuggestedOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - $request = $this->getReturns_3Request($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; + $request = $this->getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -39877,137 +33249,44 @@ class FbyApi } /** - * Create request for operation 'getReturns_3' + * Create request for operation 'getSuggestedOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getReturns_3Request($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns_3'][0]) + public function getSuggestedOfferMappingEntriesRequest($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getReturns_3' + 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getReturns_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getSuggestedOfferMappingEntries, must be bigger than or equal to 1.'); } - - - if ($order_ids !== null && count($order_ids) > 50) { - throw new \InvalidArgumentException('invalid value for "$order_ids" when calling FbyApi.getReturns_3, number of items must be less than or equal to 50.'); + // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set + if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries' + ); } - - - - - - - $resourcePath = '/campaigns/{campaignId}/returns'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $order_ids, - 'orderIds', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $statuses, - 'statuses', // param base name - 'array', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $type, - 'type', // param base name - 'ReturnType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date2, - 'from_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date2, - 'to_date', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -40027,7 +33306,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_suggested_offer_mapping_entries_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mapping_entries_request)); + } else { + $httpBody = $get_suggested_offer_mapping_entries_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -40075,7 +33361,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -40083,44 +33369,42 @@ class FbyApi } /** - * Operation getStocks_0 + * Operation getSuggestedOfferMappings * - * Информация об остатках и оборачиваемости + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getStocks_0($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_0'][0]) + public function getSuggestedOfferMappings($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - list($response) = $this->getStocks_0WithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + list($response) = $this->getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); return $response; } /** - * Operation getStocks_0WithHttpInfo + * Operation getSuggestedOfferMappingsWithHttpInfo * - * Информация об остатках и оборачиваемости + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getStocks_0WithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_0'][0]) + public function getSuggestedOfferMappingsWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $request = $this->getStocks_0Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -40147,169 +33431,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehouseStocksResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40323,44 +33489,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40368,7 +33511,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40376,7 +33519,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40384,7 +33527,15 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40392,7 +33543,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40400,29 +33551,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getStocks_0Async + * Operation getSuggestedOfferMappingsAsync * - * Информация об остатках и оборачиваемости + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getStocks_0Async($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_0'][0]) + public function getSuggestedOfferMappingsAsync($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - return $this->getStocks_0AsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) + return $this->getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -40431,23 +33583,22 @@ class FbyApi } /** - * Operation getStocks_0AsyncWithHttpInfo + * Operation getSuggestedOfferMappingsAsyncWithHttpInfo * - * Информация об остатках и оборачиваемости + * Просмотр карточек на Маркете, которые подходят вашим товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getStocks_0AsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_0'][0]) + public function getSuggestedOfferMappingsAsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - $request = $this->getStocks_0Request($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; + $request = $this->getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -40486,66 +33637,45 @@ class FbyApi } /** - * Create request for operation 'getStocks_0' + * Create request for operation 'getSuggestedOfferMappings' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest|null $get_suggested_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getStocks_0Request($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks_0'][0]) + public function getSuggestedOfferMappingsRequest($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getStocks_0' + 'Missing the required parameter $business_id when calling getSuggestedOfferMappings' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getStocks_0, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getSuggestedOfferMappings, must be bigger than or equal to 1.'); } - - - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -40558,12 +33688,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_warehouse_stocks_request)) { + if (isset($get_suggested_offer_mappings_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mappings_request)); } else { - $httpBody = $get_warehouse_stocks_request; + $httpBody = $get_suggested_offer_mappings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -40621,42 +33751,40 @@ class FbyApi } /** - * Operation getSuggestedOfferMappingEntries_0 + * Operation getSupplyRequestDocuments * - * Рекомендованные карточки для товаров + * Получение документов по заявке на поставку, вывоз или утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getSuggestedOfferMappingEntries_0($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_0'][0]) + public function getSupplyRequestDocuments($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) { - list($response) = $this->getSuggestedOfferMappingEntries_0WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + list($response) = $this->getSupplyRequestDocumentsWithHttpInfo($campaign_id, $get_supply_request_documents_request, $contentType); return $response; } /** - * Operation getSuggestedOfferMappingEntries_0WithHttpInfo + * Operation getSupplyRequestDocumentsWithHttpInfo * - * Рекомендованные карточки для товаров + * Получение документов по заявке на поставку, вывоз или утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getSuggestedOfferMappingEntries_0WithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_0'][0]) + public function getSupplyRequestDocumentsWithHttpInfo($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) { - $request = $this->getSuggestedOfferMappingEntries_0Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $request = $this->getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -40683,196 +33811,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -40886,44 +33869,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40931,7 +33891,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40939,7 +33899,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40947,7 +33907,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40955,7 +33915,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40963,7 +33923,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -40971,28 +33931,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappingEntries_0Async + * Operation getSupplyRequestDocumentsAsync * - * Рекомендованные карточки для товаров + * Получение документов по заявке на поставку, вывоз или утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedOfferMappingEntries_0Async($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_0'][0]) + public function getSupplyRequestDocumentsAsync($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) { - return $this->getSuggestedOfferMappingEntries_0AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType) + return $this->getSupplyRequestDocumentsAsyncWithHttpInfo($campaign_id, $get_supply_request_documents_request, $contentType) ->then( function ($response) { return $response[0]; @@ -41001,22 +33962,21 @@ class FbyApi } /** - * Operation getSuggestedOfferMappingEntries_0AsyncWithHttpInfo + * Operation getSupplyRequestDocumentsAsyncWithHttpInfo * - * Рекомендованные карточки для товаров + * Получение документов по заявке на поставку, вывоз или утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedOfferMappingEntries_0AsyncWithHttpInfo($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_0'][0]) + public function getSupplyRequestDocumentsAsyncWithHttpInfo($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) { - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - $request = $this->getSuggestedOfferMappingEntries_0Request($campaign_id, $get_suggested_offer_mapping_entries_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse'; + $request = $this->getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41055,38 +34015,37 @@ class FbyApi } /** - * Create request for operation 'getSuggestedOfferMappingEntries_0' + * Create request for operation 'getSupplyRequestDocuments' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getSuggestedOfferMappingEntries_0Request($campaign_id, $get_suggested_offer_mapping_entries_request, string $contentType = self::contentTypes['getSuggestedOfferMappingEntries_0'][0]) + public function getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedOfferMappingEntries_0' + 'Missing the required parameter $campaign_id when calling getSupplyRequestDocuments' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getSuggestedOfferMappingEntries_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getSupplyRequestDocuments, must be bigger than or equal to 1.'); } - // verify the required parameter 'get_suggested_offer_mapping_entries_request' is set - if ($get_suggested_offer_mapping_entries_request === null || (is_array($get_suggested_offer_mapping_entries_request) && count($get_suggested_offer_mapping_entries_request) === 0)) { + // verify the required parameter 'get_supply_request_documents_request' is set + if ($get_supply_request_documents_request === null || (is_array($get_supply_request_documents_request) && count($get_supply_request_documents_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $get_suggested_offer_mapping_entries_request when calling getSuggestedOfferMappingEntries_0' + 'Missing the required parameter $get_supply_request_documents_request when calling getSupplyRequestDocuments' ); } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests/documents'; $formParams = []; $queryParams = []; $headerParams = []; @@ -41112,12 +34071,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_suggested_offer_mapping_entries_request)) { + if (isset($get_supply_request_documents_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mapping_entries_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_request_documents_request)); } else { - $httpBody = $get_suggested_offer_mapping_entries_request; + $httpBody = $get_supply_request_documents_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -41175,40 +34134,44 @@ class FbyApi } /** - * Operation getSuggestedOfferMappings_1 + * Operation getSupplyRequestItems * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Получение товаров в заявке на поставку, вывоз или утилизацию * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetSupplyRequestItemsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getSuggestedOfferMappings_1($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_1'][0]) + public function getSupplyRequestItems($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) { - list($response) = $this->getSuggestedOfferMappings_1WithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType); + list($response) = $this->getSupplyRequestItemsWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getSuggestedOfferMappings_1WithHttpInfo + * Operation getSupplyRequestItemsWithHttpInfo * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Получение товаров в заявке на поставку, вывоз или утилизацию * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetSupplyRequestItemsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getSuggestedOfferMappings_1WithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_1'][0]) + public function getSupplyRequestItemsWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) { - $request = $this->getSuggestedOfferMappings_1Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $request = $this->getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -41235,196 +34198,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41438,44 +34256,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse', + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41483,7 +34278,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41491,7 +34286,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41499,7 +34294,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41507,7 +34302,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41515,7 +34310,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -41523,27 +34318,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedOfferMappings_1Async + * Operation getSupplyRequestItemsAsync * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Получение товаров в заявке на поставку, вывоз или утилизацию * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSuggestedOfferMappings_1Async($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_1'][0]) + public function getSupplyRequestItemsAsync($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) { - return $this->getSuggestedOfferMappings_1AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request, $contentType) + return $this->getSupplyRequestItemsAsyncWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -41552,21 +34351,23 @@ class FbyApi } /** - * Operation getSuggestedOfferMappings_1AsyncWithHttpInfo + * Operation getSupplyRequestItemsAsyncWithHttpInfo * - * Просмотр карточек на Маркете, которые подходят вашим товарам + * Получение товаров в заявке на поставку, вывоз или утилизацию * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSuggestedOfferMappings_1AsyncWithHttpInfo($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_1'][0]) + public function getSupplyRequestItemsAsyncWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) { - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingsResponse'; - $request = $this->getSuggestedOfferMappings_1Request($business_id, $get_suggested_offer_mappings_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse'; + $request = $this->getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -41605,44 +34406,75 @@ class FbyApi } /** - * Create request for operation 'getSuggestedOfferMappings_1' + * Create request for operation 'getSupplyRequestItems' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingsRequest $get_suggested_offer_mappings_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappings_1'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSuggestedOfferMappings_1Request($business_id, $get_suggested_offer_mappings_request = null, string $contentType = self::contentTypes['getSuggestedOfferMappings_1'][0]) + public function getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getSuggestedOfferMappings_1' + 'Missing the required parameter $campaign_id when calling getSupplyRequestItems' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.getSuggestedOfferMappings_1, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getSupplyRequestItems, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_supply_request_items_request' is set + if ($get_supply_request_items_request === null || (is_array($get_supply_request_items_request) && count($get_supply_request_items_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_supply_request_items_request when calling getSupplyRequestItems' + ); + } - $resourcePath = '/businesses/{businessId}/offer-mappings/suggestions'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getSupplyRequestItems, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests/items'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -41655,12 +34487,12 @@ class FbyApi ); // for model (json/xml) - if (isset($get_suggested_offer_mappings_request)) { + if (isset($get_supply_request_items_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_suggested_offer_mappings_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_request_items_request)); } else { - $httpBody = $get_suggested_offer_mappings_request; + $httpBody = $get_supply_request_items_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -41718,42 +34550,44 @@ class FbyApi } /** - * Operation getSuggestedPrices_0 + * Operation getSupplyRequests * - * Цены для продвижения товаров + * Получение информации о заявках на поставку, вывоз и утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetSupplyRequestsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getSuggestedPrices_0($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_0'][0]) + public function getSupplyRequests($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) { - list($response) = $this->getSuggestedPrices_0WithHttpInfo($campaign_id, $suggest_prices_request, $contentType); + list($response) = $this->getSupplyRequestsWithHttpInfo($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); return $response; } /** - * Operation getSuggestedPrices_0WithHttpInfo + * Operation getSupplyRequestsWithHttpInfo * - * Цены для продвижения товаров + * Получение информации о заявках на поставку, вывоз и утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetSupplyRequestsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getSuggestedPrices_0WithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_0'][0]) + public function getSupplyRequestsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) { - $request = $this->getSuggestedPrices_0Request($campaign_id, $suggest_prices_request, $contentType); + $request = $this->getSupplyRequestsRequest($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -41780,196 +34614,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SuggestPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SuggestPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuggestPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -41983,44 +34666,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SuggestPricesResponse', + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42028,7 +34688,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42036,7 +34696,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42044,15 +34704,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42060,7 +34712,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42068,28 +34720,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedPrices_0Async + * Operation getSupplyRequestsAsync * - * Цены для продвижения товаров + * Получение информации о заявках на поставку, вывоз и утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedPrices_0Async($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_0'][0]) + public function getSupplyRequestsAsync($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) { - return $this->getSuggestedPrices_0AsyncWithHttpInfo($campaign_id, $suggest_prices_request, $contentType) + return $this->getSupplyRequestsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType) ->then( function ($response) { return $response[0]; @@ -42098,22 +34753,23 @@ class FbyApi } /** - * Operation getSuggestedPrices_0AsyncWithHttpInfo + * Operation getSupplyRequestsAsyncWithHttpInfo * - * Цены для продвижения товаров + * Получение информации о заявках на поставку, вывоз и утилизацию * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedPrices_0AsyncWithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_0'][0]) + public function getSupplyRequestsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) { - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - $request = $this->getSuggestedPrices_0Request($campaign_id, $suggest_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestsResponse'; + $request = $this->getSupplyRequestsRequest($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42152,44 +34808,62 @@ class FbyApi } /** - * Create request for operation 'getSuggestedPrices_0' + * Create request for operation 'getSupplyRequests' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getSuggestedPrices_0Request($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices_0'][0]) + public function getSupplyRequestsRequest($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedPrices_0' + 'Missing the required parameter $campaign_id when calling getSupplyRequests' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getSuggestedPrices_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.getSupplyRequests, must be bigger than or equal to 1.'); } - // verify the required parameter 'suggest_prices_request' is set - if ($suggest_prices_request === null || (is_array($suggest_prices_request) && count($suggest_prices_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $suggest_prices_request when calling getSuggestedPrices_0' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.getSupplyRequests, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/offer-prices/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -42209,12 +34883,12 @@ class FbyApi ); // for model (json/xml) - if (isset($suggest_prices_request)) { + if (isset($get_supply_requests_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($suggest_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_requests_request)); } else { - $httpBody = $suggest_prices_request; + $httpBody = $get_supply_requests_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -42272,40 +34946,40 @@ class FbyApi } /** - * Operation putBidsForBusiness_2 + * Operation putBidsForBusiness * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForBusiness_2($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_2'][0]) + public function putBidsForBusiness($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - list($response) = $this->putBidsForBusiness_2WithHttpInfo($business_id, $put_sku_bids_request, $contentType); + list($response) = $this->putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation putBidsForBusiness_2WithHttpInfo + * Operation putBidsForBusinessWithHttpInfo * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForBusiness_2WithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_2'][0]) + public function putBidsForBusinessWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - $request = $this->putBidsForBusiness_2Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -42332,196 +35006,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -42535,34 +35064,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -42572,7 +35078,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42580,7 +35086,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42588,7 +35094,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42596,7 +35102,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42604,7 +35110,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42612,7 +35118,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -42620,27 +35126,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForBusiness_2Async + * Operation putBidsForBusinessAsync * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_2Async($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_2'][0]) + public function putBidsForBusinessAsync($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { - return $this->putBidsForBusiness_2AsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) + return $this->putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -42649,21 +35157,21 @@ class FbyApi } /** - * Operation putBidsForBusiness_2AsyncWithHttpInfo + * Operation putBidsForBusinessAsyncWithHttpInfo * * Включение буста продаж и установка ставок * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForBusiness_2AsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_2'][0]) + public function putBidsForBusinessAsyncWithHttpInfo($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForBusiness_2Request($business_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForBusinessRequest($business_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -42702,37 +35210,37 @@ class FbyApi } /** - * Create request for operation 'putBidsForBusiness_2' + * Create request for operation 'putBidsForBusiness' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness_2'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForBusiness'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForBusiness_2Request($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness_2'][0]) + public function putBidsForBusinessRequest($business_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForBusiness'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling putBidsForBusiness_2' + 'Missing the required parameter $business_id when calling putBidsForBusiness' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.putBidsForBusiness_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.putBidsForBusiness, must be bigger than or equal to 1.'); } // verify the required parameter 'put_sku_bids_request' is set if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness_2' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForBusiness' ); } - $resourcePath = '/businesses/{businessId}/bids'; + $resourcePath = '/v2/businesses/{businessId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -42821,40 +35329,40 @@ class FbyApi } /** - * Operation putBidsForCampaign_3 + * Operation putBidsForCampaign * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function putBidsForCampaign_3($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_3'][0]) + public function putBidsForCampaign($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - list($response) = $this->putBidsForCampaign_3WithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); + list($response) = $this->putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType); return $response; } /** - * Operation putBidsForCampaign_3WithHttpInfo + * Operation putBidsForCampaignWithHttpInfo * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function putBidsForCampaign_3WithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_3'][0]) + public function putBidsForCampaignWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - $request = $this->putBidsForCampaign_3Request($campaign_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -42881,196 +35389,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43084,34 +35447,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -43121,7 +35461,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43129,7 +35469,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43137,7 +35477,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43145,7 +35485,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43153,7 +35493,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43161,7 +35501,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43169,27 +35509,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation putBidsForCampaign_3Async + * Operation putBidsForCampaignAsync * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_3Async($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_3'][0]) + public function putBidsForCampaignAsync($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { - return $this->putBidsForCampaign_3AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) + return $this->putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -43198,21 +35540,21 @@ class FbyApi } /** - * Operation putBidsForCampaign_3AsyncWithHttpInfo + * Operation putBidsForCampaignAsyncWithHttpInfo * * Включение буста продаж и установка ставок для магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function putBidsForCampaign_3AsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_3'][0]) + public function putBidsForCampaignAsyncWithHttpInfo($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->putBidsForCampaign_3Request($campaign_id, $put_sku_bids_request, $contentType); + $request = $this->putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43251,37 +35593,37 @@ class FbyApi } /** - * Create request for operation 'putBidsForCampaign_3' + * Create request for operation 'putBidsForCampaign' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\PutSkuBidsRequest $put_sku_bids_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign_3'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putBidsForCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function putBidsForCampaign_3Request($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign_3'][0]) + public function putBidsForCampaignRequest($campaign_id, $put_sku_bids_request, string $contentType = self::contentTypes['putBidsForCampaign'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling putBidsForCampaign_3' + 'Missing the required parameter $campaign_id when calling putBidsForCampaign' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.putBidsForCampaign_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.putBidsForCampaign, must be bigger than or equal to 1.'); } // verify the required parameter 'put_sku_bids_request' is set if ($put_sku_bids_request === null || (is_array($put_sku_bids_request) && count($put_sku_bids_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign_3' + 'Missing the required parameter $put_sku_bids_request when calling putBidsForCampaign' ); } - $resourcePath = '/campaigns/{campaignId}/bids'; + $resourcePath = '/v2/campaigns/{campaignId}/bids'; $formParams = []; $queryParams = []; $headerParams = []; @@ -43370,42 +35712,42 @@ class FbyApi } /** - * Operation refreshFeed_3 + * Operation searchRegionChildren * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function refreshFeed_3($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_3'][0]) + public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - list($response) = $this->refreshFeed_3WithHttpInfo($campaign_id, $feed_id, $contentType); + list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); return $response; } /** - * Operation refreshFeed_3WithHttpInfo + * Operation searchRegionChildrenWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function refreshFeed_3WithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_3'][0]) + public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $request = $this->refreshFeed_3Request($campaign_id, $feed_id, $contentType); + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -43432,196 +35774,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -43635,44 +35832,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43680,7 +35854,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43688,7 +35862,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43696,7 +35870,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43704,7 +35878,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43712,7 +35886,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -43720,28 +35894,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation refreshFeed_3Async + * Operation searchRegionChildrenAsync * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_3Async($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_3'][0]) + public function searchRegionChildrenAsync($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - return $this->refreshFeed_3AsyncWithHttpInfo($campaign_id, $feed_id, $contentType) + return $this->searchRegionChildrenAsyncWithHttpInfo($region_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -43750,22 +35926,22 @@ class FbyApi } /** - * Operation refreshFeed_3AsyncWithHttpInfo + * Operation searchRegionChildrenAsyncWithHttpInfo * - * Сообщить, что прайс-лист обновился + * Информация о дочерних регионах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function refreshFeed_3AsyncWithHttpInfo($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_3'][0]) + public function searchRegionChildrenAsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->refreshFeed_3Request($campaign_id, $feed_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -43804,59 +35980,64 @@ class FbyApi } /** - * Create request for operation 'refreshFeed_3' + * Create request for operation 'searchRegionChildren' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refreshFeed_3'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function refreshFeed_3Request($campaign_id, $feed_id, string $contentType = self::contentTypes['refreshFeed_3'][0]) + public function searchRegionChildrenRequest($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling refreshFeed_3' + 'Missing the required parameter $region_id when calling searchRegionChildren' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.refreshFeed_3, must be bigger than or equal to 1.'); + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.searchRegionChildren, must be smaller than or equal to 10000.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling refreshFeed_3' - ); - } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/refresh'; + $resourcePath = '/v2/regions/{regionId}/children'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($feed_id !== null) { + if ($region_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), $resourcePath ); } @@ -43917,7 +36098,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -43925,42 +36106,38 @@ class FbyApi } /** - * Operation searchRegionChildren_0 + * Operation searchRegionsById * - * Информация о дочерних регионах + * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionChildren_0($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_0'][0]) + public function searchRegionsById($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - list($response) = $this->searchRegionChildren_0WithHttpInfo($region_id, $page, $page_size, $contentType); + list($response) = $this->searchRegionsByIdWithHttpInfo($region_id, $contentType); return $response; } /** - * Operation searchRegionChildren_0WithHttpInfo + * Operation searchRegionsByIdWithHttpInfo * - * Информация о дочерних регионах + * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionChildren_0WithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_0'][0]) + public function searchRegionsByIdWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $request = $this->searchRegionChildren_0Request($region_id, $page, $page_size, $contentType); + $request = $this->searchRegionsByIdRequest($region_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -43987,196 +36164,45 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44190,52 +36216,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + '\OpenAPI\Client\Model\GetRegionsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44243,7 +36238,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44251,7 +36246,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44259,7 +36254,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44267,7 +36262,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44275,28 +36270,28 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionChildren_0Async + * Operation searchRegionsByIdAsync * - * Информация о дочерних регионах + * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_0Async($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_0'][0]) + public function searchRegionsByIdAsync($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - return $this->searchRegionChildren_0AsyncWithHttpInfo($region_id, $page, $page_size, $contentType) + return $this->searchRegionsByIdAsyncWithHttpInfo($region_id, $contentType) ->then( function ($response) { return $response[0]; @@ -44305,22 +36300,20 @@ class FbyApi } /** - * Operation searchRegionChildren_0AsyncWithHttpInfo + * Operation searchRegionsByIdAsyncWithHttpInfo * - * Информация о дочерних регионах + * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionChildren_0AsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_0'][0]) + public function searchRegionsByIdAsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - $request = $this->searchRegionChildren_0Request($region_id, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByIdRequest($region_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44359,57 +36352,32 @@ class FbyApi } /** - * Create request for operation 'searchRegionChildren_0' + * Create request for operation 'searchRegionsById' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren_0'] to see the possible values for this operation + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionChildren_0Request($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren_0'][0]) + public function searchRegionsByIdRequest($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) { // verify the required parameter 'region_id' is set if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionChildren_0' + 'Missing the required parameter $region_id when calling searchRegionsById' ); } - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling FbyApi.searchRegionChildren_0, must be smaller than or equal to 10000.'); - } - - - $resourcePath = '/regions/{regionId}/children'; + $resourcePath = '/v2/regions/{regionId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -44485,38 +36453,42 @@ class FbyApi } /** - * Operation searchRegionsById_0 + * Operation searchRegionsByName * - * Информация о регионе + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_0'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsById_0($region_id, string $contentType = self::contentTypes['searchRegionsById_0'][0]) + public function searchRegionsByName($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - list($response) = $this->searchRegionsById_0WithHttpInfo($region_id, $contentType); + list($response) = $this->searchRegionsByNameWithHttpInfo($name, $page_token, $limit, $contentType); return $response; } /** - * Operation searchRegionsById_0WithHttpInfo + * Operation searchRegionsByNameWithHttpInfo * - * Информация о регионе + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_0'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsById_0WithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_0'][0]) + public function searchRegionsByNameWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - $request = $this->searchRegionsById_0Request($region_id, $contentType); + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -44543,169 +36515,39 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -44719,34 +36561,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -44756,7 +36575,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44764,7 +36583,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44772,15 +36591,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44788,7 +36599,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -44796,26 +36607,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsById_0Async + * Operation searchRegionsByNameAsync * - * Информация о регионе + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_0'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_0Async($region_id, string $contentType = self::contentTypes['searchRegionsById_0'][0]) + public function searchRegionsByNameAsync($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - return $this->searchRegionsById_0AsyncWithHttpInfo($region_id, $contentType) + return $this->searchRegionsByNameAsyncWithHttpInfo($name, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -44824,20 +36639,22 @@ class FbyApi } /** - * Operation searchRegionsById_0AsyncWithHttpInfo + * Operation searchRegionsByNameAsyncWithHttpInfo * - * Информация о регионе + * Поиск регионов по их имени * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_0'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsById_0AsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById_0'][0]) + public function searchRegionsByNameAsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsById_0Request($region_id, $contentType); + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -44876,42 +36693,68 @@ class FbyApi } /** - * Create request for operation 'searchRegionsById_0' + * Create request for operation 'searchRegionsByName' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById_0'] to see the possible values for this operation + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsById_0Request($region_id, string $contentType = self::contentTypes['searchRegionsById_0'][0]) + public function searchRegionsByNameRequest($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) { - // verify the required parameter 'region_id' is set - if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $region_id when calling searchRegionsById_0' + 'Missing the required parameter $name when calling searchRegionsByName' ); } - $resourcePath = '/regions/{regionId}'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FbyApi.searchRegionsByName, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/regions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $name, + 'name', // param base name + 'string', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($region_id !== null) { - $resourcePath = str_replace( - '{' . 'regionId' . '}', - ObjectSerializer::toPathValue($region_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -44977,42 +36820,42 @@ class FbyApi } /** - * Operation searchRegionsByName_0 + * Operation sendFileToChat * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionsByName_0($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_0'][0]) + public function sendFileToChat($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - list($response) = $this->searchRegionsByName_0WithHttpInfo($name, $page_token, $limit, $contentType); + list($response) = $this->sendFileToChatWithHttpInfo($business_id, $chat_id, $file, $contentType); return $response; } /** - * Operation searchRegionsByName_0WithHttpInfo + * Operation sendFileToChatWithHttpInfo * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionsByName_0WithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_0'][0]) + public function sendFileToChatWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $request = $this->searchRegionsByName_0Request($name, $page_token, $limit, $contentType); + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); try { $options = $this->createHttpClientOption(); @@ -45039,142 +36882,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45188,44 +36940,29 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetRegionsResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45233,7 +36970,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45241,7 +36978,15 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45249,7 +36994,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45257,28 +37002,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation searchRegionsByName_0Async + * Operation sendFileToChatAsync * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_0Async($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_0'][0]) + public function sendFileToChatAsync($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - return $this->searchRegionsByName_0AsyncWithHttpInfo($name, $page_token, $limit, $contentType) + return $this->sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) ->then( function ($response) { return $response[0]; @@ -45287,22 +37034,22 @@ class FbyApi } /** - * Operation searchRegionsByName_0AsyncWithHttpInfo + * Operation sendFileToChatAsyncWithHttpInfo * - * Поиск регионов по их имени + * Отправка файла в чат * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchRegionsByName_0AsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_0'][0]) + public function sendFileToChatAsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - $request = $this->searchRegionsByName_0Request($name, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->sendFileToChatRequest($business_id, $chat_id, $file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45341,30 +37088,48 @@ class FbyApi } /** - * Create request for operation 'searchRegionsByName_0' + * Create request for operation 'sendFileToChat' * - * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $chat_id Идентификатор чата. (required) + * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchRegionsByName_0Request($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName_0'][0]) + public function sendFileToChatRequest($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat'][0]) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling searchRegionsByName_0' + 'Missing the required parameter $business_id when calling sendFileToChat' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'chat_id' is set + if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $chat_id when calling sendFileToChat' + ); + } + if ($chat_id < 1) { + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.sendFileToChat, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling sendFileToChat' ); } - - - $resourcePath = '/regions'; + $resourcePath = '/v2/businesses/{businessId}/chats/file/send'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45373,35 +37138,35 @@ class FbyApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $name, - 'name', // param base name - 'string', // openApiType - '', // style - false, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name + $chat_id, + 'chatId', // param base name 'integer', // openApiType '', // style false, // explode - false // required + true // required ) ?? []); + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + // form params + $formDataProcessor = new FormDataProcessor(); + + $formData = $formDataProcessor->prepare([ + 'file' => $file, + ]); + $formParams = $formDataProcessor->flatten($formData); + $multipart = $formDataProcessor->has_file; + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', ], $contentType, @@ -45457,7 +37222,7 @@ class FbyApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -45465,42 +37230,42 @@ class FbyApi } /** - * Operation sendFileToChat_2 + * Operation sendMessageToChat * - * Отправка файла в чат + * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function sendFileToChat_2($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_2'][0]) + public function sendMessageToChat($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - list($response) = $this->sendFileToChat_2WithHttpInfo($business_id, $chat_id, $file, $contentType); + list($response) = $this->sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $response; } /** - * Operation sendFileToChat_2WithHttpInfo + * Operation sendMessageToChatWithHttpInfo * - * Отправка файла в чат + * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendFileToChat_2WithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_2'][0]) + public function sendMessageToChatWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - $request = $this->sendFileToChat_2Request($business_id, $chat_id, $file, $contentType); + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -45527,196 +37292,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -45730,34 +37350,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -45767,7 +37364,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45775,7 +37372,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45783,7 +37380,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45791,7 +37388,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45799,7 +37396,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45807,7 +37404,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -45815,28 +37412,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendFileToChat_2Async + * Operation sendMessageToChatAsync * - * Отправка файла в чат + * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendFileToChat_2Async($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_2'][0]) + public function sendMessageToChatAsync($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { - return $this->sendFileToChat_2AsyncWithHttpInfo($business_id, $chat_id, $file, $contentType) + return $this->sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) ->then( function ($response) { return $response[0]; @@ -45845,22 +37444,22 @@ class FbyApi } /** - * Operation sendFileToChat_2AsyncWithHttpInfo + * Operation sendMessageToChatAsyncWithHttpInfo * - * Отправка файла в чат + * Отправка сообщения в чат * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendFileToChat_2AsyncWithHttpInfo($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_2'][0]) + public function sendMessageToChatAsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendFileToChat_2Request($business_id, $chat_id, $file, $contentType); + $request = $this->sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -45899,48 +37498,48 @@ class FbyApi } /** - * Create request for operation 'sendFileToChat_2' + * Create request for operation 'sendMessageToChat' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param int $chat_id Идентификатор чата. (required) - * @param \SplFileObject $file Содержимое файла. Максимальный размер файла — 5 Мбайт. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFileToChat_2'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendFileToChat_2Request($business_id, $chat_id, $file, string $contentType = self::contentTypes['sendFileToChat_2'][0]) + public function sendMessageToChatRequest($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendFileToChat_2' + 'Missing the required parameter $business_id when calling sendMessageToChat' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.sendFileToChat_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.sendMessageToChat, must be bigger than or equal to 1.'); } // verify the required parameter 'chat_id' is set if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendFileToChat_2' + 'Missing the required parameter $chat_id when calling sendMessageToChat' ); } if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.sendFileToChat_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.sendMessageToChat, must be bigger than or equal to 1.'); } - // verify the required parameter 'file' is set - if ($file === null || (is_array($file) && count($file) === 0)) { + // verify the required parameter 'send_message_to_chat_request' is set + if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file when calling sendFileToChat_2' + 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat' ); } - $resourcePath = '/businesses/{businessId}/chats/file/send'; + $resourcePath = '/v2/businesses/{businessId}/chats/message'; $formParams = []; $queryParams = []; $headerParams = []; @@ -45967,18 +37566,6 @@ class FbyApi ); } - // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = []; - $paramFiles = is_array($file) ? $file : [$file]; - foreach ($paramFiles as $paramFile) { - $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } - } $headers = $this->headerSelector->selectHeaders( ['application/json', ], @@ -45987,7 +37574,14 @@ class FbyApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($send_message_to_chat_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + } else { + $httpBody = $send_message_to_chat_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -46043,42 +37637,40 @@ class FbyApi } /** - * Operation sendMessageToChat_2 + * Operation skipGoodsFeedbacksReaction * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function sendMessageToChat_2($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_2'][0]) + public function skipGoodsFeedbacksReaction($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - list($response) = $this->sendMessageToChat_2WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType); + list($response) = $this->skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); return $response; } /** - * Operation sendMessageToChat_2WithHttpInfo + * Operation skipGoodsFeedbacksReactionWithHttpInfo * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendMessageToChat_2WithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_2'][0]) + public function skipGoodsFeedbacksReactionWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - $request = $this->sendMessageToChat_2Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -46105,196 +37697,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -46308,34 +37755,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -46345,7 +37769,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46353,7 +37777,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46361,7 +37785,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46369,7 +37793,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46377,7 +37801,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46385,7 +37809,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46393,28 +37817,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation sendMessageToChat_2Async + * Operation skipGoodsFeedbacksReactionAsync * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMessageToChat_2Async($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_2'][0]) + public function skipGoodsFeedbacksReactionAsync($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { - return $this->sendMessageToChat_2AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, $contentType) + return $this->skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) ->then( function ($response) { return $response[0]; @@ -46423,22 +37848,21 @@ class FbyApi } /** - * Operation sendMessageToChat_2AsyncWithHttpInfo + * Operation skipGoodsFeedbacksReactionAsyncWithHttpInfo * - * Отправка сообщения в чат + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMessageToChat_2AsyncWithHttpInfo($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_2'][0]) + public function skipGoodsFeedbacksReactionAsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->sendMessageToChat_2Request($business_id, $chat_id, $send_message_to_chat_request, $contentType); + $request = $this->skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -46477,63 +37901,43 @@ class FbyApi } /** - * Create request for operation 'sendMessageToChat_2' + * Create request for operation 'skipGoodsFeedbacksReaction' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $chat_id Идентификатор чата. (required) - * @param \OpenAPI\Client\Model\SendMessageToChatRequest $send_message_to_chat_request description (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendMessageToChat_2'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendMessageToChat_2Request($business_id, $chat_id, $send_message_to_chat_request, string $contentType = self::contentTypes['sendMessageToChat_2'][0]) + public function skipGoodsFeedbacksReactionRequest($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling sendMessageToChat_2' + 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.sendMessageToChat_2, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.skipGoodsFeedbacksReaction, must be bigger than or equal to 1.'); } - // verify the required parameter 'chat_id' is set - if ($chat_id === null || (is_array($chat_id) && count($chat_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $chat_id when calling sendMessageToChat_2' - ); - } - if ($chat_id < 1) { - throw new \InvalidArgumentException('invalid value for "$chat_id" when calling FbyApi.sendMessageToChat_2, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'send_message_to_chat_request' is set - if ($send_message_to_chat_request === null || (is_array($send_message_to_chat_request) && count($send_message_to_chat_request) === 0)) { + // verify the required parameter 'skip_goods_feedback_reaction_request' is set + if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $send_message_to_chat_request when calling sendMessageToChat_2' + 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction' ); } - $resourcePath = '/businesses/{businessId}/chats/message'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/skip-reaction'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chat_id, - 'chatId', // param base name - 'integer', // openApiType - '', // style - false, // explode - true // required - ) ?? []); // path params @@ -46553,12 +37957,12 @@ class FbyApi ); // for model (json/xml) - if (isset($send_message_to_chat_request)) { + if (isset($skip_goods_feedback_reaction_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_message_to_chat_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); } else { - $httpBody = $send_message_to_chat_request; + $httpBody = $skip_goods_feedback_reaction_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -46616,44 +38020,44 @@ class FbyApi } /** - * Operation setFeedParams_3 + * Operation submitReturnDecision * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setFeedParams_3($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_3'][0]) + public function submitReturnDecision($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - list($response) = $this->setFeedParams_3WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType); + list($response) = $this->submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $response; } /** - * Operation setFeedParams_3WithHttpInfo + * Operation submitReturnDecisionWithHttpInfo * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setFeedParams_3WithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_3'][0]) + public function submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $request = $this->setFeedParams_3Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -46680,223 +38084,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -46910,34 +38142,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -46947,7 +38156,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46955,7 +38164,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46963,7 +38172,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46971,7 +38180,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46979,7 +38188,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -46987,15 +38196,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47003,29 +38204,31 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setFeedParams_3Async + * Operation submitReturnDecisionAsync * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_3Async($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_3'][0]) + public function submitReturnDecisionAsync($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - return $this->setFeedParams_3AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, $contentType) + return $this->submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType) ->then( function ($response) { return $response[0]; @@ -47034,23 +38237,23 @@ class FbyApi } /** - * Operation setFeedParams_3AsyncWithHttpInfo + * Operation submitReturnDecisionAsyncWithHttpInfo * - * Изменение параметров прайс-листа + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function setFeedParams_3AsyncWithHttpInfo($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_3'][0]) + public function submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->setFeedParams_3Request($campaign_id, $feed_id, $set_feed_params_request, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47089,46 +38292,47 @@ class FbyApi } /** - * Create request for operation 'setFeedParams_3' + * Create request for operation 'submitReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (required) - * @param \OpenAPI\Client\Model\SetFeedParamsRequest $set_feed_params_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setFeedParams_3'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function setFeedParams_3Request($campaign_id, $feed_id, $set_feed_params_request, string $contentType = self::contentTypes['setFeedParams_3'][0]) + public function submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setFeedParams_3' + 'Missing the required parameter $campaign_id when calling submitReturnDecision' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.setFeedParams_3, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.submitReturnDecision, must be bigger than or equal to 1.'); } - // verify the required parameter 'feed_id' is set - if ($feed_id === null || (is_array($feed_id) && count($feed_id) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $feed_id when calling setFeedParams_3' + 'Missing the required parameter $order_id when calling submitReturnDecision' ); } - // verify the required parameter 'set_feed_params_request' is set - if ($set_feed_params_request === null || (is_array($set_feed_params_request) && count($set_feed_params_request) === 0)) { + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_feed_params_request when calling setFeedParams_3' + 'Missing the required parameter $return_id when calling submitReturnDecision' ); } - $resourcePath = '/campaigns/{campaignId}/feeds/{feedId}/params'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -47146,10 +38350,18 @@ class FbyApi ); } // path params - if ($feed_id !== null) { + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { $resourcePath = str_replace( - '{' . 'feedId' . '}', - ObjectSerializer::toPathValue($feed_id), + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), $resourcePath ); } @@ -47162,12 +38374,12 @@ class FbyApi ); // for model (json/xml) - if (isset($set_feed_params_request)) { + if (isset($submit_return_decision_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_feed_params_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($submit_return_decision_request)); } else { - $httpBody = $set_feed_params_request; + $httpBody = $submit_return_decision_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -47225,40 +38437,40 @@ class FbyApi } /** - * Operation skipGoodsFeedbacksReaction_0 + * Operation updateBusinessPrices * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function skipGoodsFeedbacksReaction_0($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_0'][0]) + public function updateBusinessPrices($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - list($response) = $this->skipGoodsFeedbacksReaction_0WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType); + list($response) = $this->updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, $contentType); return $response; } /** - * Operation skipGoodsFeedbacksReaction_0WithHttpInfo + * Operation updateBusinessPricesWithHttpInfo * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function skipGoodsFeedbacksReaction_0WithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_0'][0]) + public function updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - $request = $this->skipGoodsFeedbacksReaction_0Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -47285,196 +38497,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -47488,34 +38561,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -47525,7 +38575,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47533,7 +38583,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47541,7 +38591,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47549,7 +38599,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47557,7 +38607,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47565,7 +38615,15 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -47573,27 +38631,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation skipGoodsFeedbacksReaction_0Async + * Operation updateBusinessPricesAsync * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_0Async($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_0'][0]) + public function updateBusinessPricesAsync($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { - return $this->skipGoodsFeedbacksReaction_0AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, $contentType) + return $this->updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -47602,21 +38662,21 @@ class FbyApi } /** - * Operation skipGoodsFeedbacksReaction_0AsyncWithHttpInfo + * Operation updateBusinessPricesAsyncWithHttpInfo * - * Отказ от ответа на отзывы + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function skipGoodsFeedbacksReaction_0AsyncWithHttpInfo($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_0'][0]) + public function updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->skipGoodsFeedbacksReaction_0Request($business_id, $skip_goods_feedback_reaction_request, $contentType); + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -47655,37 +38715,37 @@ class FbyApi } /** - * Create request for operation 'skipGoodsFeedbacksReaction_0' + * Create request for operation 'updateBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function skipGoodsFeedbacksReaction_0Request($business_id, $skip_goods_feedback_reaction_request, string $contentType = self::contentTypes['skipGoodsFeedbacksReaction_0'][0]) + public function updateBusinessPricesRequest($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling skipGoodsFeedbacksReaction_0' + 'Missing the required parameter $business_id when calling updateBusinessPrices' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.skipGoodsFeedbacksReaction_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateBusinessPrices, must be bigger than or equal to 1.'); } - // verify the required parameter 'skip_goods_feedback_reaction_request' is set - if ($skip_goods_feedback_reaction_request === null || (is_array($skip_goods_feedback_reaction_request) && count($skip_goods_feedback_reaction_request) === 0)) { + // verify the required parameter 'update_business_prices_request' is set + if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $skip_goods_feedback_reaction_request when calling skipGoodsFeedbacksReaction_0' + 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/skip-reaction'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -47711,12 +38771,12 @@ class FbyApi ); // for model (json/xml) - if (isset($skip_goods_feedback_reaction_request)) { + if (isset($update_business_prices_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($skip_goods_feedback_reaction_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); } else { - $httpBody = $skip_goods_feedback_reaction_request; + $httpBody = $update_business_prices_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -47774,40 +38834,40 @@ class FbyApi } /** - * Operation updateBusinessPrices_0 + * Operation updateCampaignOffers * - * Установка цен на товары во всех магазинах + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateBusinessPrices_0($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_0'][0]) + public function updateCampaignOffers($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - list($response) = $this->updateBusinessPrices_0WithHttpInfo($business_id, $update_business_prices_request, $contentType); + list($response) = $this->updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); return $response; } /** - * Operation updateBusinessPrices_0WithHttpInfo + * Operation updateCampaignOffersWithHttpInfo * - * Установка цен на товары во всех магазинах + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateBusinessPrices_0WithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_0'][0]) + public function updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - $request = $this->updateBusinessPrices_0Request($business_id, $update_business_prices_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -47834,223 +38894,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48064,34 +38958,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -48101,7 +38972,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48109,7 +38980,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48117,7 +38988,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48125,7 +38996,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48133,7 +39004,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48141,7 +39012,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48149,7 +39020,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48157,27 +39028,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateBusinessPrices_0Async + * Operation updateCampaignOffersAsync * - * Установка цен на товары во всех магазинах + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_0Async($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_0'][0]) + public function updateCampaignOffersAsync($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - return $this->updateBusinessPrices_0AsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) + return $this->updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -48186,21 +39059,21 @@ class FbyApi } /** - * Operation updateBusinessPrices_0AsyncWithHttpInfo + * Operation updateCampaignOffersAsyncWithHttpInfo * - * Установка цен на товары во всех магазинах + * Изменение условий продажи товаров в магазине * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateBusinessPrices_0AsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_0'][0]) + public function updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateBusinessPrices_0Request($business_id, $update_business_prices_request, $contentType); + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48239,37 +39112,37 @@ class FbyApi } /** - * Create request for operation 'updateBusinessPrices_0' + * Create request for operation 'updateCampaignOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices_0'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateBusinessPrices_0Request($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices_0'][0]) + public function updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) { - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateBusinessPrices_0' + 'Missing the required parameter $campaign_id when calling updateCampaignOffers' ); } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateBusinessPrices_0, must be bigger than or equal to 1.'); + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.updateCampaignOffers, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_business_prices_request' is set - if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { + // verify the required parameter 'update_campaign_offers_request' is set + if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices_0' + 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers' ); } - $resourcePath = '/businesses/{businessId}/offer-prices/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -48279,10 +39152,10 @@ class FbyApi // path params - if ($business_id !== null) { + if ($campaign_id !== null) { $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), $resourcePath ); } @@ -48295,12 +39168,12 @@ class FbyApi ); // for model (json/xml) - if (isset($update_business_prices_request)) { + if (isset($update_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); } else { - $httpBody = $update_business_prices_request; + $httpBody = $update_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -48358,40 +39231,40 @@ class FbyApi } /** - * Operation updateCampaignOffers_1 + * Operation updateGoodsFeedbackComment * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateCampaignOffers_1($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_1'][0]) + public function updateGoodsFeedbackComment($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - list($response) = $this->updateCampaignOffers_1WithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); + list($response) = $this->updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); return $response; } /** - * Operation updateCampaignOffers_1WithHttpInfo + * Operation updateGoodsFeedbackCommentWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateCampaignOffers_1WithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_1'][0]) + public function updateGoodsFeedbackCommentWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $request = $this->updateCampaignOffers_1Request($campaign_id, $update_campaign_offers_request, $contentType); + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -48418,223 +39291,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -48648,44 +39349,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48693,7 +39371,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48701,7 +39379,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48709,7 +39387,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48717,7 +39395,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48725,15 +39403,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 423: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLockedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -48741,27 +39411,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateCampaignOffers_1Async + * Operation updateGoodsFeedbackCommentAsync * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_1Async($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_1'][0]) + public function updateGoodsFeedbackCommentAsync($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - return $this->updateCampaignOffers_1AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) + return $this->updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) ->then( function ($response) { return $response[0]; @@ -48770,21 +39442,21 @@ class FbyApi } /** - * Operation updateCampaignOffers_1AsyncWithHttpInfo + * Operation updateGoodsFeedbackCommentAsyncWithHttpInfo * - * Изменение условий продажи товаров в магазине + * Добавление нового или изменение созданного комментария * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateCampaignOffers_1AsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_1'][0]) + public function updateGoodsFeedbackCommentAsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateCampaignOffers_1Request($campaign_id, $update_campaign_offers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; + $request = $this->updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -48823,37 +39495,37 @@ class FbyApi } /** - * Create request for operation 'updateCampaignOffers_1' + * Create request for operation 'updateGoodsFeedbackComment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers_1'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateCampaignOffers_1Request($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers_1'][0]) + public function updateGoodsFeedbackCommentRequest($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateCampaignOffers_1' + 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.updateCampaignOffers_1, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateGoodsFeedbackComment, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_campaign_offers_request' is set - if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { + // verify the required parameter 'update_goods_feedback_comment_request' is set + if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers_1' + 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment' ); } - $resourcePath = '/campaigns/{campaignId}/offers/update'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -48863,10 +39535,10 @@ class FbyApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -48879,12 +39551,12 @@ class FbyApi ); // for model (json/xml) - if (isset($update_campaign_offers_request)) { + if (isset($update_goods_feedback_comment_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); } else { - $httpBody = $update_campaign_offers_request; + $httpBody = $update_goods_feedback_comment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -48942,40 +39614,40 @@ class FbyApi } /** - * Operation updateGoodsFeedbackComment_0 + * Operation updateGoodsQuestionTextEntity * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateGoodsFeedbackComment_0($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_0'][0]) + public function updateGoodsQuestionTextEntity($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - list($response) = $this->updateGoodsFeedbackComment_0WithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType); + list($response) = $this->updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType); return $response; } /** - * Operation updateGoodsFeedbackComment_0WithHttpInfo + * Operation updateGoodsQuestionTextEntityWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateGoodsFeedbackComment_0WithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_0'][0]) + public function updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $request = $this->updateGoodsFeedbackComment_0Request($business_id, $update_goods_feedback_comment_request, $contentType); + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -49002,196 +39674,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49205,44 +39732,21 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49250,7 +39754,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49258,7 +39762,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49266,7 +39770,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49274,7 +39778,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49282,7 +39786,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49290,27 +39794,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateGoodsFeedbackComment_0Async + * Operation updateGoodsQuestionTextEntityAsync * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_0Async($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_0'][0]) + public function updateGoodsQuestionTextEntityAsync($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - return $this->updateGoodsFeedbackComment_0AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, $contentType) + return $this->updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType) ->then( function ($response) { return $response[0]; @@ -49319,21 +39825,21 @@ class FbyApi } /** - * Operation updateGoodsFeedbackComment_0AsyncWithHttpInfo + * Operation updateGoodsQuestionTextEntityAsyncWithHttpInfo * - * Добавление нового или изменение созданного комментария + * Создание, изменение и удаление ответа или комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGoodsFeedbackComment_0AsyncWithHttpInfo($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_0'][0]) + public function updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - $request = $this->updateGoodsFeedbackComment_0Request($business_id, $update_goods_feedback_comment_request, $contentType); + $returnType = '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse'; + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49372,37 +39878,37 @@ class FbyApi } /** - * Create request for operation 'updateGoodsFeedbackComment_0' + * Create request for operation 'updateGoodsQuestionTextEntity' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment_0'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGoodsFeedbackComment_0Request($business_id, $update_goods_feedback_comment_request, string $contentType = self::contentTypes['updateGoodsFeedbackComment_0'][0]) + public function updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateGoodsFeedbackComment_0' + 'Missing the required parameter $business_id when calling updateGoodsQuestionTextEntity' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateGoodsFeedbackComment_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateGoodsQuestionTextEntity, must be bigger than or equal to 1.'); } - // verify the required parameter 'update_goods_feedback_comment_request' is set - if ($update_goods_feedback_comment_request === null || (is_array($update_goods_feedback_comment_request) && count($update_goods_feedback_comment_request) === 0)) { + // verify the required parameter 'update_goods_question_text_entity_request' is set + if ($update_goods_question_text_entity_request === null || (is_array($update_goods_question_text_entity_request) && count($update_goods_question_text_entity_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_goods_feedback_comment_request when calling updateGoodsFeedbackComment_0' + 'Missing the required parameter $update_goods_question_text_entity_request when calling updateGoodsQuestionTextEntity' ); } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/update'; + $resourcePath = '/v1/businesses/{businessId}/goods-questions/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -49428,12 +39934,12 @@ class FbyApi ); // for model (json/xml) - if (isset($update_goods_feedback_comment_request)) { + if (isset($update_goods_question_text_entity_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_feedback_comment_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_question_text_entity_request)); } else { - $httpBody = $update_goods_feedback_comment_request; + $httpBody = $update_goods_question_text_entity_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -49491,40 +39997,40 @@ class FbyApi } /** - * Operation updateOfferContent_1 + * Operation updateOfferContent * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferContent_1($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_1'][0]) + public function updateOfferContent($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - list($response) = $this->updateOfferContent_1WithHttpInfo($business_id, $update_offer_content_request, $contentType); + list($response) = $this->updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, $contentType); return $response; } /** - * Operation updateOfferContent_1WithHttpInfo + * Operation updateOfferContentWithHttpInfo * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferContent_1WithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_1'][0]) + public function updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - $request = $this->updateOfferContent_1Request($business_id, $update_offer_content_request, $contentType); + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -49551,223 +40057,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferContentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferContentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -49781,34 +40121,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -49818,7 +40135,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49826,7 +40143,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49834,7 +40151,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49842,7 +40159,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49850,7 +40167,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49858,7 +40175,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49866,7 +40183,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -49874,27 +40191,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferContent_1Async + * Operation updateOfferContentAsync * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferContent_1Async($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_1'][0]) + public function updateOfferContentAsync($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { - return $this->updateOfferContent_1AsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) + return $this->updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) ->then( function ($response) { return $response[0]; @@ -49903,21 +40222,21 @@ class FbyApi } /** - * Operation updateOfferContent_1AsyncWithHttpInfo + * Operation updateOfferContentAsyncWithHttpInfo * * Редактирование категорийных характеристик товара * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferContent_1AsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_1'][0]) + public function updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; - $request = $this->updateOfferContent_1Request($business_id, $update_offer_content_request, $contentType); + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -49956,37 +40275,37 @@ class FbyApi } /** - * Create request for operation 'updateOfferContent_1' + * Create request for operation 'updateOfferContent' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent_1'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferContent_1Request($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent_1'][0]) + public function updateOfferContentRequest($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferContent_1' + 'Missing the required parameter $business_id when calling updateOfferContent' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateOfferContent_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateOfferContent, must be bigger than or equal to 1.'); } // verify the required parameter 'update_offer_content_request' is set if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_content_request when calling updateOfferContent_1' + 'Missing the required parameter $update_offer_content_request when calling updateOfferContent' ); } - $resourcePath = '/businesses/{businessId}/offer-cards/update'; + $resourcePath = '/v2/businesses/{businessId}/offer-cards/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50075,42 +40394,42 @@ class FbyApi } /** - * Operation updateOfferMappingEntries_0 + * Operation updateOfferMappingEntries * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse * @deprecated */ - public function updateOfferMappingEntries_0($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_0'][0]) + public function updateOfferMappingEntries($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - list($response) = $this->updateOfferMappingEntries_0WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); + list($response) = $this->updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType); return $response; } /** - * Operation updateOfferMappingEntries_0WithHttpInfo + * Operation updateOfferMappingEntriesWithHttpInfo * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function updateOfferMappingEntries_0WithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_0'][0]) + public function updateOfferMappingEntriesWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - $request = $this->updateOfferMappingEntries_0Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -50137,223 +40456,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50367,34 +40520,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -50404,7 +40534,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50412,7 +40542,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50420,7 +40550,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50428,7 +40558,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50436,7 +40566,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50444,7 +40574,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50452,7 +40582,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50460,28 +40590,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappingEntries_0Async + * Operation updateOfferMappingEntriesAsync * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function updateOfferMappingEntries_0Async($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_0'][0]) + public function updateOfferMappingEntriesAsync($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { - return $this->updateOfferMappingEntries_0AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) + return $this->updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, $contentType) ->then( function ($response) { return $response[0]; @@ -50490,22 +40622,22 @@ class FbyApi } /** - * Operation updateOfferMappingEntries_0AsyncWithHttpInfo + * Operation updateOfferMappingEntriesAsyncWithHttpInfo * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function updateOfferMappingEntries_0AsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_0'][0]) + public function updateOfferMappingEntriesAsyncWithHttpInfo($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updateOfferMappingEntries_0Request($campaign_id, $update_offer_mapping_entry_request, $contentType); + $request = $this->updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -50544,38 +40676,38 @@ class FbyApi } /** - * Create request for operation 'updateOfferMappingEntries_0' + * Create request for operation 'updateOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function updateOfferMappingEntries_0Request($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries_0'][0]) + public function updateOfferMappingEntriesRequest($campaign_id, $update_offer_mapping_entry_request, string $contentType = self::contentTypes['updateOfferMappingEntries'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries_0' + 'Missing the required parameter $campaign_id when calling updateOfferMappingEntries' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.updateOfferMappingEntries_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.updateOfferMappingEntries, must be bigger than or equal to 1.'); } // verify the required parameter 'update_offer_mapping_entry_request' is set if ($update_offer_mapping_entry_request === null || (is_array($update_offer_mapping_entry_request) && count($update_offer_mapping_entry_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries_0' + 'Missing the required parameter $update_offer_mapping_entry_request when calling updateOfferMappingEntries' ); } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50664,40 +40796,42 @@ class FbyApi } /** - * Operation updateOfferMappings_1 + * Operation updateOfferMappings * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updateOfferMappings_1($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_1'][0]) + public function updateOfferMappings($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - list($response) = $this->updateOfferMappings_1WithHttpInfo($business_id, $update_offer_mappings_request, $contentType); + list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType); return $response; } /** - * Operation updateOfferMappings_1WithHttpInfo + * Operation updateOfferMappingsWithHttpInfo * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateOfferMappings_1WithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_1'][0]) + public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - $request = $this->updateOfferMappings_1Request($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -50724,223 +40858,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOfferMappingsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -50954,34 +40922,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -50991,7 +40936,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -50999,7 +40944,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51007,7 +40952,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51015,7 +40960,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51023,7 +40968,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51031,7 +40976,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51039,7 +40984,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51047,27 +40992,30 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updateOfferMappings_1Async + * Operation updateOfferMappingsAsync * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_1Async($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_1'][0]) + public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { - return $this->updateOfferMappings_1AsyncWithHttpInfo($business_id, $update_offer_mappings_request, $contentType) + return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -51076,21 +41024,22 @@ class FbyApi } /** - * Operation updateOfferMappings_1AsyncWithHttpInfo + * Operation updateOfferMappingsAsyncWithHttpInfo * * Добавление товаров в каталог и изменение информации о них * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateOfferMappings_1AsyncWithHttpInfo($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_1'][0]) + public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; - $request = $this->updateOfferMappings_1Request($business_id, $update_offer_mappings_request, $contentType); + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51129,43 +41078,54 @@ class FbyApi } /** - * Create request for operation 'updateOfferMappings_1' + * Create request for operation 'updateOfferMappings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings_1'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateOfferMappings_1Request($business_id, $update_offer_mappings_request, string $contentType = self::contentTypes['updateOfferMappings_1'][0]) + public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updateOfferMappings_1' + 'Missing the required parameter $business_id when calling updateOfferMappings' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateOfferMappings_1, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updateOfferMappings, must be bigger than or equal to 1.'); } // verify the required parameter 'update_offer_mappings_request' is set if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings_1' + 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings' ); } - $resourcePath = '/businesses/{businessId}/offer-mappings/update'; + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/update'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -51248,40 +41208,40 @@ class FbyApi } /** - * Operation updatePrices_0 + * Operation updatePrices * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePrices_0($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_0'][0]) + public function updatePrices($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - list($response) = $this->updatePrices_0WithHttpInfo($campaign_id, $update_prices_request, $contentType); + list($response) = $this->updatePricesWithHttpInfo($campaign_id, $update_prices_request, $contentType); return $response; } /** - * Operation updatePrices_0WithHttpInfo + * Operation updatePricesWithHttpInfo * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePrices_0WithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_0'][0]) + public function updatePricesWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - $request = $this->updatePrices_0Request($campaign_id, $update_prices_request, $contentType); + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -51308,223 +41268,57 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -51538,34 +41332,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -51575,7 +41346,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51583,7 +41354,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51591,7 +41362,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51599,7 +41370,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51607,7 +41378,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51615,7 +41386,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51623,7 +41394,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -51631,27 +41402,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePrices_0Async + * Operation updatePricesAsync * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_0Async($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_0'][0]) + public function updatePricesAsync($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { - return $this->updatePrices_0AsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) + return $this->updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -51660,21 +41433,21 @@ class FbyApi } /** - * Operation updatePrices_0AsyncWithHttpInfo + * Operation updatePricesAsyncWithHttpInfo * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePrices_0AsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_0'][0]) + public function updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->updatePrices_0Request($campaign_id, $update_prices_request, $contentType); + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -51713,37 +41486,37 @@ class FbyApi } /** - * Create request for operation 'updatePrices_0' + * Create request for operation 'updatePrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePrices_0Request($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices_0'][0]) + public function updatePricesRequest($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling updatePrices_0' + 'Missing the required parameter $campaign_id when calling updatePrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.updatePrices_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling FbyApi.updatePrices, must be bigger than or equal to 1.'); } // verify the required parameter 'update_prices_request' is set if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_prices_request when calling updatePrices_0' + 'Missing the required parameter $update_prices_request when calling updatePrices' ); } - $resourcePath = '/campaigns/{campaignId}/offer-prices/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -51832,40 +41605,40 @@ class FbyApi } /** - * Operation updatePromoOffers_0 + * Operation updatePromoOffers * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function updatePromoOffers_0($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_0'][0]) + public function updatePromoOffers($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - list($response) = $this->updatePromoOffers_0WithHttpInfo($business_id, $update_promo_offers_request, $contentType); + list($response) = $this->updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, $contentType); return $response; } /** - * Operation updatePromoOffers_0WithHttpInfo + * Operation updatePromoOffersWithHttpInfo * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\UpdatePromoOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updatePromoOffers_0WithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_0'][0]) + public function updatePromoOffersWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - $request = $this->updatePromoOffers_0Request($business_id, $update_promo_offers_request, $contentType); + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -51892,196 +41665,51 @@ class FbyApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdatePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -52095,34 +41723,11 @@ class FbyApi ); } - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -52132,7 +41737,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52140,7 +41745,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52148,7 +41753,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52156,7 +41761,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52164,7 +41769,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52172,7 +41777,7 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -52180,27 +41785,29 @@ class FbyApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation updatePromoOffers_0Async + * Operation updatePromoOffersAsync * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_0Async($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_0'][0]) + public function updatePromoOffersAsync($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { - return $this->updatePromoOffers_0AsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) + return $this->updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -52209,21 +41816,21 @@ class FbyApi } /** - * Operation updatePromoOffers_0AsyncWithHttpInfo + * Operation updatePromoOffersAsyncWithHttpInfo * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoOffers_0AsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_0'][0]) + public function updatePromoOffersAsyncWithHttpInfo($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - $request = $this->updatePromoOffers_0Request($business_id, $update_promo_offers_request, $contentType); + $request = $this->updatePromoOffersRequest($business_id, $update_promo_offers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -52262,37 +41869,37 @@ class FbyApi } /** - * Create request for operation 'updatePromoOffers_0' + * Create request for operation 'updatePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers_0'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePromoOffers_0Request($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers_0'][0]) + public function updatePromoOffersRequest($business_id, $update_promo_offers_request, string $contentType = self::contentTypes['updatePromoOffers'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling updatePromoOffers_0' + 'Missing the required parameter $business_id when calling updatePromoOffers' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updatePromoOffers_0, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling FbyApi.updatePromoOffers, must be bigger than or equal to 1.'); } // verify the required parameter 'update_promo_offers_request' is set if ($update_promo_offers_request === null || (is_array($update_promo_offers_request) && count($update_promo_offers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers_0' + 'Missing the required parameter $update_promo_offers_request when calling updatePromoOffers' ); } - $resourcePath = '/businesses/{businessId}/promos/offers/update'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -52396,6 +42003,57 @@ class FbyApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/GoodsFeedbackApi.php b/erp24/lib/yandex_market_api/Api/GoodsFeedbackApi.php index 54e84a8c..44218387 100644 --- a/erp24/lib/yandex_market_api/Api/GoodsFeedbackApi.php +++ b/erp24/lib/yandex_market_api/Api/GoodsFeedbackApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -139,7 +142,7 @@ class GoodsFeedbackApi * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request delete_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * @@ -158,7 +161,7 @@ class GoodsFeedbackApi * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * @@ -195,196 +198,51 @@ class GoodsFeedbackApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -398,34 +256,11 @@ class GoodsFeedbackApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -435,7 +270,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +278,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +286,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +294,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +302,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,7 +310,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -483,8 +318,10 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -494,7 +331,7 @@ class GoodsFeedbackApi * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * @@ -516,7 +353,7 @@ class GoodsFeedbackApi * * Удаление комментария к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * @@ -567,7 +404,7 @@ class GoodsFeedbackApi /** * Create request for operation 'deleteGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeleteGoodsFeedbackCommentRequest $delete_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteGoodsFeedbackComment'] to see the possible values for this operation * @@ -595,7 +432,7 @@ class GoodsFeedbackApi } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/delete'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -688,10 +525,10 @@ class GoodsFeedbackApi * * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -709,10 +546,10 @@ class GoodsFeedbackApi * * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -748,196 +585,51 @@ class GoodsFeedbackApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -951,34 +643,11 @@ class GoodsFeedbackApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackCommentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -988,7 +657,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -996,7 +665,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1004,7 +673,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1012,7 +681,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1020,7 +689,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1028,7 +697,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1036,8 +705,10 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1047,10 +718,10 @@ class GoodsFeedbackApi * * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1071,10 +742,10 @@ class GoodsFeedbackApi * * Получение комментариев к отзыву * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1124,10 +795,10 @@ class GoodsFeedbackApi /** * Create request for operation 'getGoodsFeedbackComments' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйÑ‚есь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetGoodsFeedbackCommentsRequest $get_goods_feedback_comments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbackComments'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1154,9 +825,12 @@ class GoodsFeedbackApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling GoodsFeedbackApi.getGoodsFeedbackComments, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/goods-feedback/comments'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1267,10 +941,10 @@ class GoodsFeedbackApi * * Получение отзывов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request get_goods_feedback_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request get_goods_feedback_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1288,10 +962,10 @@ class GoodsFeedbackApi * * Получение отзывов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1327,196 +1001,51 @@ class GoodsFeedbackApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsFeedbackResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1530,34 +1059,11 @@ class GoodsFeedbackApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsFeedbackResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsFeedbackResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1567,7 +1073,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1575,7 +1081,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1583,7 +1089,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1591,7 +1097,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1599,7 +1105,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1607,7 +1113,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1615,8 +1121,10 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1626,10 +1134,10 @@ class GoodsFeedbackApi * * Получение отзывов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1650,10 +1158,10 @@ class GoodsFeedbackApi * * Получение отзывов о товарах продавца * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1703,10 +1211,10 @@ class GoodsFeedbackApi /** * Create request for operation 'getGoodsFeedbacks' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest $get_goods_feedback_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetGoodsFeedbackRequest|null $get_goods_feedback_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsFeedbacks'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1726,10 +1234,13 @@ class GoodsFeedbackApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling GoodsFeedbackApi.getGoodsFeedbacks, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/goods-feedback'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1838,9 +1349,9 @@ class GoodsFeedbackApi /** * Operation skipGoodsFeedbacksReaction * - * Отказ от ответа на отзывы + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request skip_goods_feedback_reaction_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * @@ -1857,9 +1368,9 @@ class GoodsFeedbackApi /** * Operation skipGoodsFeedbacksReactionWithHttpInfo * - * Отказ от ответа на отзывы + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * @@ -1896,196 +1407,51 @@ class GoodsFeedbackApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2099,34 +1465,11 @@ class GoodsFeedbackApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2136,7 +1479,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2144,7 +1487,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2152,7 +1495,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2160,7 +1503,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2168,7 +1511,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2176,7 +1519,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2184,8 +1527,10 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2193,9 +1538,9 @@ class GoodsFeedbackApi /** * Operation skipGoodsFeedbacksReactionAsync * - * Отказ от ответа на отзывы + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * @@ -2215,9 +1560,9 @@ class GoodsFeedbackApi /** * Operation skipGoodsFeedbacksReactionAsyncWithHttpInfo * - * Отказ от ответа на отзывы + * Пропуск реакции на отзывы * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * @@ -2268,7 +1613,7 @@ class GoodsFeedbackApi /** * Create request for operation 'skipGoodsFeedbacksReaction' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\SkipGoodsFeedbackReactionRequest $skip_goods_feedback_reaction_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['skipGoodsFeedbacksReaction'] to see the possible values for this operation * @@ -2296,7 +1641,7 @@ class GoodsFeedbackApi } - $resourcePath = '/businesses/{businessId}/goods-feedback/skip-reaction'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/skip-reaction'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2389,7 +1734,7 @@ class GoodsFeedbackApi * * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request update_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * @@ -2408,7 +1753,7 @@ class GoodsFeedbackApi * * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * @@ -2445,196 +1790,51 @@ class GoodsFeedbackApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2648,34 +1848,11 @@ class GoodsFeedbackApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsFeedbackCommentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2685,7 +1862,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2693,7 +1870,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2701,7 +1878,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2709,7 +1886,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2717,7 +1894,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2725,7 +1902,7 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2733,8 +1910,10 @@ class GoodsFeedbackApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2744,7 +1923,7 @@ class GoodsFeedbackApi * * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * @@ -2766,7 +1945,7 @@ class GoodsFeedbackApi * * Добавление нового или изменение созданного комментария * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * @@ -2817,7 +1996,7 @@ class GoodsFeedbackApi /** * Create request for operation 'updateGoodsFeedbackComment' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateGoodsFeedbackCommentRequest $update_goods_feedback_comment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsFeedbackComment'] to see the possible values for this operation * @@ -2845,7 +2024,7 @@ class GoodsFeedbackApi } - $resourcePath = '/businesses/{businessId}/goods-feedback/comments/update'; + $resourcePath = '/v2/businesses/{businessId}/goods-feedback/comments/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2949,6 +2128,57 @@ class GoodsFeedbackApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/GoodsQuestionsApi.php b/erp24/lib/yandex_market_api/Api/GoodsQuestionsApi.php new file mode 100644 index 00000000..cc90527e --- /dev/null +++ b/erp24/lib/yandex_market_api/Api/GoodsQuestionsApi.php @@ -0,0 +1,1412 @@ + [ + 'application/json', + ], + 'getGoodsQuestions' => [ + 'application/json', + ], + 'updateGoodsQuestionTextEntity' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getGoodsQuestionAnswers + * + * Получение ответов на вопрос + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getGoodsQuestionAnswers($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) + { + list($response) = $this->getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getGoodsQuestionAnswersWithHttpInfo + * + * Получение ответов на вопрос + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetAnswersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getGoodsQuestionAnswersWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) + { + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetAnswersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetAnswersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getGoodsQuestionAnswersAsync + * + * Получение ответов на вопрос + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGoodsQuestionAnswersAsync($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) + { + return $this->getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGoodsQuestionAnswersAsyncWithHttpInfo + * + * Получение ответов на вопрос + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGoodsQuestionAnswersAsyncWithHttpInfo($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetAnswersResponse'; + $request = $this->getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGoodsQuestionAnswers' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetAnswersRequest $get_answers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestionAnswers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGoodsQuestionAnswersRequest($business_id, $get_answers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getGoodsQuestionAnswers'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getGoodsQuestionAnswers' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling GoodsQuestionsApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_answers_request' is set + if ($get_answers_request === null || (is_array($get_answers_request) && count($get_answers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_answers_request when calling getGoodsQuestionAnswers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling GoodsQuestionsApi.getGoodsQuestionAnswers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/goods-questions/answers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_answers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_answers_request)); + } else { + $httpBody = $get_answers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGoodsQuestions + * + * Получение вопросов о товарах продавца + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getGoodsQuestions($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) + { + list($response) = $this->getGoodsQuestionsWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType); + return $response; + } + + /** + * Operation getGoodsQuestionsWithHttpInfo + * + * Получение вопросов о товарах продавца + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetQuestionsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getGoodsQuestionsWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) + { + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuestionsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetQuestionsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getGoodsQuestionsAsync + * + * Получение вопросов о товарах продавца + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGoodsQuestionsAsync($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) + { + return $this->getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token, $limit, $get_questions_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGoodsQuestionsAsyncWithHttpInfo + * + * Получение вопросов о товарах продавца + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGoodsQuestionsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetQuestionsResponse'; + $request = $this->getGoodsQuestionsRequest($business_id, $page_token, $limit, $get_questions_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGoodsQuestions' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetQuestionsRequest|null $get_questions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsQuestions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGoodsQuestionsRequest($business_id, $page_token = null, $limit = null, $get_questions_request = null, string $contentType = self::contentTypes['getGoodsQuestions'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getGoodsQuestions' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling GoodsQuestionsApi.getGoodsQuestions, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling GoodsQuestionsApi.getGoodsQuestions, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v1/businesses/{businessId}/goods-questions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_questions_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_questions_request)); + } else { + $httpBody = $get_questions_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateGoodsQuestionTextEntity + * + * Создание, изменение и удаление ответа или комментария + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateGoodsQuestionTextEntity($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) + { + list($response) = $this->updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType); + return $response; + } + + /** + * Operation updateGoodsQuestionTextEntityWithHttpInfo + * + * Создание, изменение и удаление ответа или комментария + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateGoodsQuestionTextEntityWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) + { + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateGoodsQuestionTextEntityAsync + * + * Создание, изменение и удаление ответа или комментария + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateGoodsQuestionTextEntityAsync($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) + { + return $this->updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateGoodsQuestionTextEntityAsyncWithHttpInfo + * + * Создание, изменение и удаление ответа или комментария + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateGoodsQuestionTextEntityAsyncWithHttpInfo($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) + { + $returnType = '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityResponse'; + $request = $this->updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateGoodsQuestionTextEntity' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityRequest $update_goods_question_text_entity_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGoodsQuestionTextEntity'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateGoodsQuestionTextEntityRequest($business_id, $update_goods_question_text_entity_request, string $contentType = self::contentTypes['updateGoodsQuestionTextEntity'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling updateGoodsQuestionTextEntity' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling GoodsQuestionsApi.updateGoodsQuestionTextEntity, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_goods_question_text_entity_request' is set + if ($update_goods_question_text_entity_request === null || (is_array($update_goods_question_text_entity_request) && count($update_goods_question_text_entity_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_goods_question_text_entity_request when calling updateGoodsQuestionTextEntity' + ); + } + + + $resourcePath = '/v1/businesses/{businessId}/goods-questions/update'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_goods_question_text_entity_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_goods_question_text_entity_request)); + } else { + $httpBody = $update_goods_question_text_entity_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/erp24/lib/yandex_market_api/Api/GoodsStatsApi.php b/erp24/lib/yandex_market_api/Api/GoodsStatsApi.php index 4b155c8b..d3b3131d 100644 --- a/erp24/lib/yandex_market_api/Api/GoodsStatsApi.php +++ b/erp24/lib/yandex_market_api/Api/GoodsStatsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -127,7 +130,7 @@ class GoodsStatsApi * * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request get_goods_stats_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * @@ -146,7 +149,7 @@ class GoodsStatsApi * * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * @@ -183,196 +186,51 @@ class GoodsStatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetGoodsStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetGoodsStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -386,34 +244,11 @@ class GoodsStatsApi ); } - $returnType = '\OpenAPI\Client\Model\GetGoodsStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetGoodsStatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -423,7 +258,7 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -431,7 +266,7 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -439,7 +274,7 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -447,7 +282,7 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -455,7 +290,7 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -463,7 +298,7 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -471,8 +306,10 @@ class GoodsStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -482,7 +319,7 @@ class GoodsStatsApi * * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * @@ -504,7 +341,7 @@ class GoodsStatsApi * * Отчет по товарам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * @@ -555,7 +392,7 @@ class GoodsStatsApi /** * Create request for operation 'getGoodsStats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetGoodsStatsRequest $get_goods_stats_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGoodsStats'] to see the possible values for this operation * @@ -583,7 +420,7 @@ class GoodsStatsApi } - $resourcePath = '/campaigns/{campaignId}/stats/skus'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/skus'; $formParams = []; $queryParams = []; $headerParams = []; @@ -687,6 +524,57 @@ class GoodsStatsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/HiddenOffersApi.php b/erp24/lib/yandex_market_api/Api/HiddenOffersApi.php index f7d3a173..8897a674 100644 --- a/erp24/lib/yandex_market_api/Api/HiddenOffersApi.php +++ b/erp24/lib/yandex_market_api/Api/HiddenOffersApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -133,7 +136,7 @@ class HiddenOffersApi * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * @@ -152,7 +155,7 @@ class HiddenOffersApi * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * @@ -189,196 +192,51 @@ class HiddenOffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -392,34 +250,11 @@ class HiddenOffersApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -429,7 +264,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -437,7 +272,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -445,7 +280,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -453,7 +288,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -461,7 +296,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -469,7 +304,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -477,8 +312,10 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -488,7 +325,7 @@ class HiddenOffersApi * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * @@ -510,7 +347,7 @@ class HiddenOffersApi * * Скрытие товаров и настройки скрытия * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * @@ -561,7 +398,7 @@ class HiddenOffersApi /** * Create request for operation 'addHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\AddHiddenOffersRequest $add_hidden_offers_request Запрос на скрытие оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addHiddenOffers'] to see the possible values for this operation * @@ -589,7 +426,7 @@ class HiddenOffersApi } - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -682,7 +519,7 @@ class HiddenOffersApi * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * @@ -701,7 +538,7 @@ class HiddenOffersApi * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * @@ -738,223 +575,57 @@ class HiddenOffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -968,34 +639,11 @@ class HiddenOffersApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1005,7 +653,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1013,7 +661,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1021,7 +669,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1029,7 +677,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1037,7 +685,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1045,7 +693,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1053,7 +701,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1061,8 +709,10 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1072,7 +722,7 @@ class HiddenOffersApi * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * @@ -1094,7 +744,7 @@ class HiddenOffersApi * * Возобновление показа товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * @@ -1145,7 +795,7 @@ class HiddenOffersApi /** * Create request for operation 'deleteHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteHiddenOffersRequest $delete_hidden_offers_request Запрос на возобновление показа оферов. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteHiddenOffers'] to see the possible values for this operation * @@ -1173,7 +823,7 @@ class HiddenOffersApi } - $resourcePath = '/campaigns/{campaignId}/hidden-offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1266,22 +916,19 @@ class HiddenOffersApi * * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getHiddenOffers($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + public function getHiddenOffers($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - list($response) = $this->getHiddenOffersWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + list($response) = $this->getHiddenOffersWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType); return $response; } @@ -1290,22 +937,19 @@ class HiddenOffersApi * * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetHiddenOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getHiddenOffersWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + public function getHiddenOffersWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -1332,169 +976,45 @@ class HiddenOffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetHiddenOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetHiddenOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1508,34 +1028,11 @@ class HiddenOffersApi ); } - $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetHiddenOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1545,7 +1042,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1553,7 +1050,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1561,7 +1058,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1569,7 +1066,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1577,7 +1074,7 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1585,8 +1082,10 @@ class HiddenOffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1596,21 +1095,18 @@ class HiddenOffersApi * * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffersAsync($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + public function getHiddenOffersAsync($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { - return $this->getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType) + return $this->getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -1623,22 +1119,19 @@ class HiddenOffersApi * * Информация о скрытых вами товарах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + public function getHiddenOffersAsyncWithHttpInfo($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { $returnType = '\OpenAPI\Client\Model\GetHiddenOffersResponse'; - $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $offset, $page, $page_size, $contentType); + $request = $this->getHiddenOffersRequest($campaign_id, $offer_id, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1679,19 +1172,16 @@ class HiddenOffersApi /** * Create request for operation 'getHiddenOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор скрытого предложения. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int $offset Позиция в списке, начиная с которой возвращаются результаты ответа. Используется вместе с параметром `limit`. Если задан `offset`, параметры `page_number` и `page_size` игнорируются. `offset` игнорируется, если задан `page_token`. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификатор скрытого предложения. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHiddenOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getHiddenOffersRequest($campaign_id, $offer_id = null, $page_token = null, $limit = null, $offset = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) + public function getHiddenOffersRequest($campaign_id, $offer_id = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getHiddenOffers'][0]) { // verify the required parameter 'campaign_id' is set @@ -1704,17 +1194,14 @@ class HiddenOffersApi throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling HiddenOffersApi.getHiddenOffers, must be bigger than or equal to 1.'); } + - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling HiddenOffersApi.getHiddenOffers, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling HiddenOffersApi.getHiddenOffers, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/hidden-offers'; + $resourcePath = '/v2/campaigns/{campaignId}/hidden-offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1748,33 +1235,6 @@ class HiddenOffersApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params @@ -1865,6 +1325,57 @@ class HiddenOffersApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/LaasApi.php b/erp24/lib/yandex_market_api/Api/LaasApi.php new file mode 100644 index 00000000..6cc63e93 --- /dev/null +++ b/erp24/lib/yandex_market_api/Api/LaasApi.php @@ -0,0 +1,17977 @@ + [ + 'application/json', + ], + 'deleteOffers' => [ + 'application/json', + ], + 'generateBarcodesReport' => [ + 'application/json', + ], + 'generateClosureDocumentsDetalizationReport' => [ + 'application/json', + ], + 'generateClosureDocumentsReport' => [ + 'application/json', + ], + 'generateGoodsMovementReport' => [ + 'application/json', + ], + 'generateOfferBarcodes' => [ + 'application/json', + ], + 'generateStocksOnWarehousesReport' => [ + 'application/json', + ], + 'generateUnitedMarketplaceServicesReport' => [ + 'application/json', + ], + 'generateUnitedReturnsReport' => [ + 'application/json', + ], + 'getAuthTokenInfo' => [ + 'application/json', + ], + 'getBusinessOrders' => [ + 'application/json', + ], + 'getBusinessSettings' => [ + 'application/json', + ], + 'getCampaign' => [ + 'application/json', + ], + 'getCampaignOffers' => [ + 'application/json', + ], + 'getCampaignSettings' => [ + 'application/json', + ], + 'getCampaigns' => [ + 'application/json', + ], + 'getCategoriesTree' => [ + 'application/json', + ], + 'getCategoryContentParameters' => [ + 'application/json', + ], + 'getDefaultPrices' => [ + 'application/json', + ], + 'getFulfillmentWarehouses' => [ + 'application/json', + ], + 'getOfferCardsContentStatus' => [ + 'application/json', + ], + 'getOfferMappings' => [ + 'application/json', + ], + 'getOrder' => [ + 'application/json', + ], + 'getOrderIdentifiersStatus' => [ + 'application/json', + ], + 'getOrders' => [ + 'application/json', + ], + 'getPricesByOfferIds' => [ + 'application/json', + ], + 'getRegionsCodes' => [ + 'application/json', + ], + 'getReportInfo' => [ + 'application/json', + ], + 'getReturn' => [ + 'application/json', + ], + 'getReturns' => [ + 'application/json', + ], + 'getStocks' => [ + 'application/json', + ], + 'getSupplyRequestDocuments' => [ + 'application/json', + ], + 'getSupplyRequestItems' => [ + 'application/json', + ], + 'getSupplyRequests' => [ + 'application/json', + ], + 'searchRegionChildren' => [ + 'application/json', + ], + 'searchRegionsById' => [ + 'application/json', + ], + 'searchRegionsByName' => [ + 'application/json', + ], + 'updateBusinessPrices' => [ + 'application/json', + ], + 'updateCampaignOffers' => [ + 'application/json', + ], + 'updateOfferContent' => [ + 'application/json', + ], + 'updateOfferMappings' => [ + 'application/json', + ], + 'updateOrderStatus' => [ + 'application/json', + ], + 'updateOrderStatuses' => [ + 'application/json', + ], + 'updatePrices' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation deleteCampaignOffers + * + * Удаление товаров из ассортимента магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request delete_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function deleteCampaignOffers($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) + { + list($response) = $this->deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType); + return $response; + } + + /** + * Operation deleteCampaignOffersWithHttpInfo + * + * Удаление товаров из ассортимента магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\DeleteCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCampaignOffersWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) + { + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteCampaignOffersAsync + * + * Удаление товаров из ассортимента магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteCampaignOffersAsync($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) + { + return $this->deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCampaignOffersAsyncWithHttpInfo + * + * Удаление товаров из ассортимента магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteCampaignOffersAsyncWithHttpInfo($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; + $request = $this->deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCampaignOffers' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteCampaignOffersRequest($campaign_id, $delete_campaign_offers_request, string $contentType = self::contentTypes['deleteCampaignOffers'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling deleteCampaignOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.deleteCampaignOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'delete_campaign_offers_request' is set + if ($delete_campaign_offers_request === null || (is_array($delete_campaign_offers_request) && count($delete_campaign_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $delete_campaign_offers_request when calling deleteCampaignOffers' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/offers/delete'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($delete_campaign_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_campaign_offers_request)); + } else { + $httpBody = $delete_campaign_offers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOffers + * + * Удаление товаров из каталога + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function deleteOffers($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) + { + list($response) = $this->deleteOffersWithHttpInfo($business_id, $delete_offers_request, $contentType); + return $response; + } + + /** + * Operation deleteOffersWithHttpInfo + * + * Удаление товаров из каталога + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\DeleteOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOffersWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) + { + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteOffersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\DeleteOffersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteOffersAsync + * + * Удаление товаров из каталога + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteOffersAsync($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) + { + return $this->deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOffersAsyncWithHttpInfo + * + * Удаление товаров из каталога + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteOffersAsyncWithHttpInfo($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\DeleteOffersResponse'; + $request = $this->deleteOffersRequest($business_id, $delete_offers_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOffers' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\DeleteOffersRequest $delete_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteOffersRequest($business_id, $delete_offers_request, string $contentType = self::contentTypes['deleteOffers'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling deleteOffers' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.deleteOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'delete_offers_request' is set + if ($delete_offers_request === null || (is_array($delete_offers_request) && count($delete_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $delete_offers_request when calling deleteOffers' + ); + } + + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/delete'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($delete_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_offers_request)); + } else { + $httpBody = $delete_offers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateBarcodesReport + * + * Получение файла со штрихкодами + * + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateBarcodesReport($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) + { + list($response) = $this->generateBarcodesReportWithHttpInfo($generate_barcodes_report_request, $contentType); + return $response; + } + + /** + * Operation generateBarcodesReportWithHttpInfo + * + * Получение файла со штрихкодами + * + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateBarcodesReportWithHttpInfo($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) + { + $request = $this->generateBarcodesReportRequest($generate_barcodes_report_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateBarcodesReportAsync + * + * Получение файла со штрихкодами + * + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateBarcodesReportAsync($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) + { + return $this->generateBarcodesReportAsyncWithHttpInfo($generate_barcodes_report_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateBarcodesReportAsyncWithHttpInfo + * + * Получение файла со штрихкодами + * + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateBarcodesReportAsyncWithHttpInfo($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateBarcodesReportRequest($generate_barcodes_report_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateBarcodesReport' + * + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateBarcodesReportRequest($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) + { + + // verify the required parameter 'generate_barcodes_report_request' is set + if ($generate_barcodes_report_request === null || (is_array($generate_barcodes_report_request) && count($generate_barcodes_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_barcodes_report_request when calling generateBarcodesReport' + ); + } + + + $resourcePath = '/v1/reports/documents/barcodes/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_barcodes_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_barcodes_report_request)); + } else { + $httpBody = $generate_barcodes_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateClosureDocumentsDetalizationReport + * + * Отчет по схождению с закрывающими документами + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateClosureDocumentsDetalizationReport($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) + { + list($response) = $this->generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType); + return $response; + } + + /** + * Operation generateClosureDocumentsDetalizationReportWithHttpInfo + * + * Отчет по схождению с закрывающими документами + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) + { + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateClosureDocumentsDetalizationReportAsync + * + * Отчет по схождению с закрывающими документами + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateClosureDocumentsDetalizationReportAsync($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) + { + return $this->generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateClosureDocumentsDetalizationReportAsyncWithHttpInfo + * + * Отчет по схождению с закрывающими документами + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateClosureDocumentsDetalizationReport' + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) + { + + // verify the required parameter 'generate_closure_documents_detalization_request' is set + if ($generate_closure_documents_detalization_request === null || (is_array($generate_closure_documents_detalization_request) && count($generate_closure_documents_detalization_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_closure_documents_detalization_request when calling generateClosureDocumentsDetalizationReport' + ); + } + + + + $resourcePath = '/v2/reports/closure-documents/detalization/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_closure_documents_detalization_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_detalization_request)); + } else { + $httpBody = $generate_closure_documents_detalization_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateClosureDocumentsReport + * + * Закрывающие документы + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateClosureDocumentsReport($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) + { + list($response) = $this->generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, $contentType); + return $response; + } + + /** + * Operation generateClosureDocumentsReportWithHttpInfo + * + * Закрывающие документы + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) + { + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateClosureDocumentsReportAsync + * + * Закрывающие документы + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateClosureDocumentsReportAsync($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) + { + return $this->generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateClosureDocumentsReportAsyncWithHttpInfo + * + * Закрывающие документы + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateClosureDocumentsReport' + * + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateClosureDocumentsReportRequest($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) + { + + // verify the required parameter 'generate_closure_documents_request' is set + if ($generate_closure_documents_request === null || (is_array($generate_closure_documents_request) && count($generate_closure_documents_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_closure_documents_request when calling generateClosureDocumentsReport' + ); + } + + + $resourcePath = '/v2/reports/closure-documents/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_closure_documents_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_request)); + } else { + $httpBody = $generate_closure_documents_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateGoodsMovementReport + * + * Отчет по движению товаров + * + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateGoodsMovementReport($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + { + list($response) = $this->generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format, $contentType); + return $response; + } + + /** + * Operation generateGoodsMovementReportWithHttpInfo + * + * Отчет по движению товаров + * + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + { + $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateGoodsMovementReportAsync + * + * Отчет по движению товаров + * + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateGoodsMovementReportAsync($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + { + return $this->generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateGoodsMovementReportAsyncWithHttpInfo + * + * Отчет по движению товаров + * + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateGoodsMovementReport' + * + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + { + + // verify the required parameter 'generate_goods_movement_report_request' is set + if ($generate_goods_movement_report_request === null || (is_array($generate_goods_movement_report_request) && count($generate_goods_movement_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_goods_movement_report_request when calling generateGoodsMovementReport' + ); + } + + + + $resourcePath = '/v2/reports/goods-movement/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_goods_movement_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_movement_report_request)); + } else { + $httpBody = $generate_goods_movement_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateOfferBarcodes + * + * Генерация штрихкодов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateOfferBarcodes($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + list($response) = $this->generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType); + return $response; + } + + /** + * Operation generateOfferBarcodesWithHttpInfo + * + * Генерация штрихкодов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateOfferBarcodesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateOfferBarcodesWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateOfferBarcodesAsync + * + * Генерация штрихкодов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateOfferBarcodesAsync($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + return $this->generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateOfferBarcodesAsyncWithHttpInfo + * + * Генерация штрихкодов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateOfferBarcodesAsyncWithHttpInfo($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateOfferBarcodesResponse'; + $request = $this->generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateOfferBarcodes' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesRequest $generate_offer_barcodes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOfferBarcodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateOfferBarcodesRequest($business_id, $generate_offer_barcodes_request, string $contentType = self::contentTypes['generateOfferBarcodes'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling generateOfferBarcodes' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.generateOfferBarcodes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'generate_offer_barcodes_request' is set + if ($generate_offer_barcodes_request === null || (is_array($generate_offer_barcodes_request) && count($generate_offer_barcodes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_offer_barcodes_request when calling generateOfferBarcodes' + ); + } + + + $resourcePath = '/v1/businesses/{businessId}/offer-mappings/barcodes/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_offer_barcodes_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_offer_barcodes_request)); + } else { + $httpBody = $generate_offer_barcodes_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateStocksOnWarehousesReport + * + * Отчет по остаткам на складах + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + return $response; + } + + /** + * Operation generateStocksOnWarehousesReportWithHttpInfo + * + * Отчет по остаткам на складах + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateStocksOnWarehousesReportAsync + * + * Отчет по остаткам на складах + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo + * + * Отчет по остаткам на складах + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateStocksOnWarehousesReport' + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + + // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set + if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' + ); + } + + + + $resourcePath = '/v2/reports/stocks-on-warehouses/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_stocks_on_warehouses_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + } else { + $httpBody = $generate_stocks_on_warehouses_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateUnitedMarketplaceServicesReport + * + * Отчет по стоимости услуг + * + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + { + list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType); + return $response; + } + + /** + * Operation generateUnitedMarketplaceServicesReportWithHttpInfo + * + * Отчет по стоимости услуг + * + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + { + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateUnitedMarketplaceServicesReportAsync + * + * Отчет по стоимости услуг + * + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + { + return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo + * + * Отчет по стоимости услуг + * + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateUnitedMarketplaceServicesReport' + * + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + { + + // verify the required parameter 'generate_united_marketplace_services_report_request' is set + if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' + ); + } + + + + + $resourcePath = '/v2/reports/united-marketplace-services/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_united_marketplace_services_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); + } else { + $httpBody = $generate_united_marketplace_services_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateUnitedReturnsReport + * + * Отчет по невыкупам и возвратам + * + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateUnitedReturnsReport($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) + { + list($response) = $this->generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format, $contentType); + return $response; + } + + /** + * Operation generateUnitedReturnsReportWithHttpInfo + * + * Отчет по невыкупам и возвратам + * + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) + { + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateUnitedReturnsReportAsync + * + * Отчет по невыкупам и возвратам + * + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateUnitedReturnsReportAsync($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) + { + return $this->generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateUnitedReturnsReportAsyncWithHttpInfo + * + * Отчет по невыкупам и возвратам + * + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateUnitedReturnsReport' + * + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateUnitedReturnsReportRequest($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) + { + + // verify the required parameter 'generate_united_returns_request' is set + if ($generate_united_returns_request === null || (is_array($generate_united_returns_request) && count($generate_united_returns_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_united_returns_request when calling generateUnitedReturnsReport' + ); + } + + + + $resourcePath = '/v2/reports/united-returns/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_united_returns_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_returns_request)); + } else { + $httpBody = $generate_united_returns_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAuthTokenInfo + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getAuthTokenInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + list($response) = $this->getAuthTokenInfoWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getAuthTokenInfoWithHttpInfo + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetTokenInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getAuthTokenInfoWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + $request = $this->getAuthTokenInfoRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetTokenInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getAuthTokenInfoAsync + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAuthTokenInfoAsync(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + return $this->getAuthTokenInfoAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAuthTokenInfoAsyncWithHttpInfo + * + * Получение информации о токене авторизации + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAuthTokenInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetTokenInfoResponse'; + $request = $this->getAuthTokenInfoRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAuthTokenInfo' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthTokenInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAuthTokenInfoRequest(string $contentType = self::contentTypes['getAuthTokenInfo'][0]) + { + + + $resourcePath = '/v2/auth/token'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBusinessOrders + * + * Информация о заказах в кабинете + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getBusinessOrders($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) + { + list($response) = $this->getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getBusinessOrdersWithHttpInfo + * + * Информация о заказах в кабинете + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) + { + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getBusinessOrdersAsync + * + * Информация о заказах в кабинете + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBusinessOrdersAsync($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) + { + return $this->getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBusinessOrdersAsyncWithHttpInfo + * + * Информация о заказах в кабинете + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetBusinessOrdersResponse'; + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBusinessOrders' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessOrders' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_business_orders_request' is set + if ($get_business_orders_request === null || (is_array($get_business_orders_request) && count($get_business_orders_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_business_orders_request when calling getBusinessOrders' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_business_orders_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_business_orders_request)); + } else { + $httpBody = $get_business_orders_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBusinessSettings + * + * Настройки кабинета + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getBusinessSettings($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) + { + list($response) = $this->getBusinessSettingsWithHttpInfo($business_id, $contentType); + return $response; + } + + /** + * Operation getBusinessSettingsWithHttpInfo + * + * Настройки кабинета + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetBusinessSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getBusinessSettingsWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) + { + $request = $this->getBusinessSettingsRequest($business_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetBusinessSettingsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getBusinessSettingsAsync + * + * Настройки кабинета + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBusinessSettingsAsync($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) + { + return $this->getBusinessSettingsAsyncWithHttpInfo($business_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBusinessSettingsAsyncWithHttpInfo + * + * Настройки кабинета + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBusinessSettingsAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetBusinessSettingsResponse'; + $request = $this->getBusinessSettingsRequest($business_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBusinessSettings' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBusinessSettingsRequest($business_id, string $contentType = self::contentTypes['getBusinessSettings'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getBusinessSettings' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.getBusinessSettings, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCampaign + * + * Информация о магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getCampaign($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) + { + list($response) = $this->getCampaignWithHttpInfo($campaign_id, $contentType); + return $response; + } + + /** + * Operation getCampaignWithHttpInfo + * + * Информация о магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetCampaignResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) + { + $request = $this->getCampaignRequest($campaign_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetCampaignResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCampaignAsync + * + * Информация о магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignAsync($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) + { + return $this->getCampaignAsyncWithHttpInfo($campaign_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCampaignAsyncWithHttpInfo + * + * Информация о магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetCampaignResponse'; + $request = $this->getCampaignRequest($campaign_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCampaign' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaign'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCampaignRequest($campaign_id, string $contentType = self::contentTypes['getCampaign'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getCampaign' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getCampaign, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCampaignOffers + * + * Информация о товарах, которые размещены в заданном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) + { + list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getCampaignOffersWithHttpInfo + * + * Информация о товарах, которые размещены в заданном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) + { + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCampaignOffersAsync + * + * Информация о товарах, которые размещены в заданном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) + { + return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCampaignOffersAsyncWithHttpInfo + * + * Информация о товарах, которые размещены в заданном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCampaignOffers' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getCampaignOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_campaign_offers_request' is set + if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/offers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_campaign_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); + } else { + $httpBody = $get_campaign_offers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCampaignSettings + * + * Настройки магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getCampaignSettings($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) + { + list($response) = $this->getCampaignSettingsWithHttpInfo($campaign_id, $contentType); + return $response; + } + + /** + * Operation getCampaignSettingsWithHttpInfo + * + * Настройки магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetCampaignSettingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignSettingsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) + { + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetCampaignSettingsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCampaignSettingsAsync + * + * Настройки магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignSettingsAsync($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) + { + return $this->getCampaignSettingsAsyncWithHttpInfo($campaign_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCampaignSettingsAsyncWithHttpInfo + * + * Настройки магазина + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignSettingsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetCampaignSettingsResponse'; + $request = $this->getCampaignSettingsRequest($campaign_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCampaignSettings' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCampaignSettingsRequest($campaign_id, string $contentType = self::contentTypes['getCampaignSettings'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getCampaignSettings' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getCampaignSettings, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCampaigns + * + * Список магазинов пользователя + * + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getCampaigns($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) + { + list($response) = $this->getCampaignsWithHttpInfo($page, $page_size, $contentType); + return $response; + } + + /** + * Operation getCampaignsWithHttpInfo + * + * Список магазинов пользователя + * + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetCampaignsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCampaignsWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) + { + $request = $this->getCampaignsRequest($page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetCampaignsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCampaignsAsync + * + * Список магазинов пользователя + * + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignsAsync($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) + { + return $this->getCampaignsAsyncWithHttpInfo($page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCampaignsAsyncWithHttpInfo + * + * Список магазинов пользователя + * + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCampaignsAsyncWithHttpInfo($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetCampaignsResponse'; + $request = $this->getCampaignsRequest($page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCampaigns' + * + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaigns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCampaignsRequest($page = 1, $page_size = null, string $contentType = self::contentTypes['getCampaigns'][0]) + { + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling LaasApi.getCampaigns, must be smaller than or equal to 10000.'); + } + + + + $resourcePath = '/v2/campaigns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCategoriesTree + * + * Дерево категорий + * + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getCategoriesTree($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) + { + list($response) = $this->getCategoriesTreeWithHttpInfo($get_categories_request, $contentType); + return $response; + } + + /** + * Operation getCategoriesTreeWithHttpInfo + * + * Дерево категорий + * + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetCategoriesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCategoriesTreeWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) + { + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoriesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetCategoriesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCategoriesTreeAsync + * + * Дерево категорий + * + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCategoriesTreeAsync($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) + { + return $this->getCategoriesTreeAsyncWithHttpInfo($get_categories_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCategoriesTreeAsyncWithHttpInfo + * + * Дерево категорий + * + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCategoriesTreeAsyncWithHttpInfo($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetCategoriesResponse'; + $request = $this->getCategoriesTreeRequest($get_categories_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCategoriesTree' + * + * @param \OpenAPI\Client\Model\GetCategoriesRequest|null $get_categories_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoriesTree'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCategoriesTreeRequest($get_categories_request = null, string $contentType = self::contentTypes['getCategoriesTree'][0]) + { + + + + $resourcePath = '/v2/categories/tree'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_categories_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_categories_request)); + } else { + $httpBody = $get_categories_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCategoryContentParameters + * + * Списки характеристик товаров по категориям + * + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getCategoryContentParameters($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + { + list($response) = $this->getCategoryContentParametersWithHttpInfo($category_id, $business_id, $contentType); + return $response; + } + + /** + * Operation getCategoryContentParametersWithHttpInfo + * + * Списки характеристик товаров по категориям + * + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetCategoryContentParametersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCategoryContentParametersWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + { + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetCategoryContentParametersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCategoryContentParametersAsync + * + * Списки характеристик товаров по категориям + * + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCategoryContentParametersAsync($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + { + return $this->getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCategoryContentParametersAsyncWithHttpInfo + * + * Списки характеристик товаров по категориям + * + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCategoryContentParametersAsyncWithHttpInfo($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetCategoryContentParametersResponse'; + $request = $this->getCategoryContentParametersRequest($category_id, $business_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCategoryContentParameters' + * + * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится интересующий вас товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). (required) + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). Передайте параметр, чтобы получить характеристики, которые являются особенностями варианта товара в данном кабинете. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategoryContentParameters'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCategoryContentParametersRequest($category_id, $business_id = null, string $contentType = self::contentTypes['getCategoryContentParameters'][0]) + { + + // verify the required parameter 'category_id' is set + if ($category_id === null || (is_array($category_id) && count($category_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $category_id when calling getCategoryContentParameters' + ); + } + if ($category_id <= 0) { + throw new \InvalidArgumentException('invalid value for "$category_id" when calling LaasApi.getCategoryContentParameters, must be bigger than 0.'); + } + + if ($business_id !== null && $business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.getCategoryContentParameters, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/category/{categoryId}/parameters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $business_id, + 'businessId', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($category_id !== null) { + $resourcePath = str_replace( + '{' . 'categoryId' . '}', + ObjectSerializer::toPathValue($category_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDefaultPrices + * + * Просмотр цен на указанные товары во всех магазинах + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getDefaultPrices($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) + { + list($response) = $this->getDefaultPricesWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType); + return $response; + } + + /** + * Operation getDefaultPricesWithHttpInfo + * + * Просмотр цен на указанные товары во всех магазинах + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDefaultPricesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) + { + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getDefaultPricesAsync + * + * Просмотр цен на указанные товары во всех магазинах + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDefaultPricesAsync($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) + { + return $this->getDefaultPricesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDefaultPricesAsyncWithHttpInfo + * + * Просмотр цен на указанные товары во всех магазинах + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDefaultPricesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetDefaultPricesResponse'; + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDefaultPrices' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDefaultPricesRequest($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getDefaultPrices' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/businesses/{businessId}/offer-prices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_default_prices_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_default_prices_request)); + } else { + $httpBody = $get_default_prices_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFulfillmentWarehouses + * + * Идентификаторы складов Маркета + * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getFulfillmentWarehouses($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + { + list($response) = $this->getFulfillmentWarehousesWithHttpInfo($campaign_id, $contentType); + return $response; + } + + /** + * Operation getFulfillmentWarehousesWithHttpInfo + * + * Идентификаторы складов Маркета + * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getFulfillmentWarehousesWithHttpInfo($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + { + $request = $this->getFulfillmentWarehousesRequest($campaign_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getFulfillmentWarehousesAsync + * + * Идентификаторы складов Маркета + * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFulfillmentWarehousesAsync($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + { + return $this->getFulfillmentWarehousesAsyncWithHttpInfo($campaign_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFulfillmentWarehousesAsyncWithHttpInfo + * + * Идентификаторы складов Маркета + * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFulfillmentWarehousesAsyncWithHttpInfo($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse'; + $request = $this->getFulfillmentWarehousesRequest($campaign_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFulfillmentWarehouses' + * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFulfillmentWarehousesRequest($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + { + + if ($campaign_id !== null && $campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getFulfillmentWarehouses, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/warehouses'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $campaign_id, + 'campaignId', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferCardsContentStatus + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOfferCardsContentStatus($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + list($response) = $this->getOfferCardsContentStatusWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + return $response; + } + + /** + * Operation getOfferCardsContentStatusWithHttpInfo + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferCardsContentStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfferCardsContentStatusWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOfferCardsContentStatusAsync + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferCardsContentStatusAsync($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + return $this->getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfferCardsContentStatusAsyncWithHttpInfo + * + * Получение информации о заполненности карточек магазина + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferCardsContentStatusAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOfferCardsContentStatusResponse'; + $request = $this->getOfferCardsContentStatusRequest($business_id, $page_token, $limit, $get_offer_cards_content_status_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfferCardsContentStatus' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOfferCardsContentStatusRequest|null $get_offer_cards_content_status_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferCardsContentStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOfferCardsContentStatusRequest($business_id, $page_token = null, $limit = null, $get_offer_cards_content_status_request = null, string $contentType = self::contentTypes['getOfferCardsContentStatus'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getOfferCardsContentStatus' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getOfferCardsContentStatus, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/businesses/{businessId}/offer-cards'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_offer_cards_content_status_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_cards_content_status_request)); + } else { + $httpBody = $get_offer_cards_content_status_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOfferMappings + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOfferMappings($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + list($response) = $this->getOfferMappingsWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + return $response; + } + + /** + * Operation getOfferMappingsWithHttpInfo + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOfferMappingsWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOfferMappingsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOfferMappingsAsync + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferMappingsAsync($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + return $this->getOfferMappingsAsyncWithHttpInfo($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOfferMappingsAsyncWithHttpInfo + * + * Информация о товарах в каталоге + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOfferMappingsAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOfferMappingsResponse'; + $request = $this->getOfferMappingsRequest($business_id, $page_token, $limit, $language, $get_offer_mappings_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOfferMappings' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param \OpenAPI\Client\Model\GetOfferMappingsRequest|null $get_offer_mappings_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOfferMappingsRequest($business_id, $page_token = null, $limit = null, $language = null, $get_offer_mappings_request = null, string $contentType = self::contentTypes['getOfferMappings'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getOfferMappings' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.getOfferMappings, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getOfferMappings, must be bigger than or equal to 1.'); + } + + + + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_offer_mappings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_mappings_request)); + } else { + $httpBody = $get_offer_mappings_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrder + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderWithHttpInfo + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderAsync + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderAsyncWithHttpInfo + * + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrder' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrder' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getOrder, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrder' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderIdentifiersStatus + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderIdentifiersStatus($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + list($response) = $this->getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderIdentifiersStatusWithHttpInfo + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderIdentifiersStatusAsync + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderIdentifiersStatusAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + return $this->getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderIdentifiersStatusAsyncWithHttpInfo + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse'; + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderIdentifiersStatus' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderIdentifiersStatusRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderIdentifiersStatus' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getOrderIdentifiersStatus, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderIdentifiersStatus' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrders + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOrdersWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersAsync + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersAsyncWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrders' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrders' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getOrders, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling LaasApi.getOrders, number of items must be less than or equal to 50.'); + } + if ($order_ids !== null && count($order_ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling LaasApi.getOrders, number of items must be greater than or equal to 1.'); + } + + + + + + + + + + + + + + + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling LaasApi.getOrders, must be smaller than or equal to 10000.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $substatus, + 'substatus', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_from, + 'supplierShipmentDateFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $supplier_shipment_date_to, + 'supplierShipmentDateTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_from, + 'updatedAtFrom', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $updated_at_to, + 'updatedAtTo', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dispatch_type, + 'dispatchType', // param base name + 'OrderDeliveryDispatchType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fake, + 'fake', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $has_cis, + 'hasCis', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_waiting_for_cancellation_approve, + 'onlyWaitingForCancellationApprove', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $only_estimated_delivery, + 'onlyEstimatedDelivery', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $buyer_type, + 'buyerType', // param base name + 'OrderBuyerType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPricesByOfferIds + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + return $response; + } + + /** + * Operation getPricesByOfferIdsWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPricesByOfferIdsAsync + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPricesByOfferIdsAsyncWithHttpInfo + * + * Просмотр цен на указанные товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPricesByOfferIds' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_prices_by_offer_ids_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); + } else { + $httpBody = $get_prices_by_offer_ids_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRegionsCodes + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getRegionsCodes(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + list($response) = $this->getRegionsCodesWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getRegionsCodesWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getRegionsCodesWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $request = $this->getRegionsCodesRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getRegionsCodesAsync + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsync(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + return $this->getRegionsCodesAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRegionsCodesAsyncWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsyncWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionsCodesResponse'; + $request = $this->getRegionsCodesRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRegionsCodes' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRegionsCodesRequest(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + + + $resourcePath = '/v2/regions/countries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReportInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + list($response) = $this->getReportInfoWithHttpInfo($report_id, $contentType); + return $response; + } + + /** + * Operation getReportInfoWithHttpInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetReportInfoResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportInfoWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + $request = $this->getReportInfoRequest($report_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReportInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReportInfoAsync + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportInfoAsync($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + return $this->getReportInfoAsyncWithHttpInfo($report_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReportInfoAsyncWithHttpInfo + * + * Получение заданного отчета или документа + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportInfoAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; + $request = $this->getReportInfoRequest($report_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportInfo' + * + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReportInfoRequest($report_id, string $contentType = self::contentTypes['getReportInfo'][0]) + { + + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $report_id when calling getReportInfo' + ); + } + if (strlen($report_id) > 255) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling LaasApi.getReportInfo, must be smaller than or equal to 255.'); + } + if (strlen($report_id) < 1) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling LaasApi.getReportInfo, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/reports/info/{reportId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($report_id !== null) { + $resourcePath = str_replace( + '{' . 'reportId' . '}', + ObjectSerializer::toPathValue($report_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReturn + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReturn($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + list($response) = $this->getReturnWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + return $response; + } + + /** + * Operation getReturnWithHttpInfo + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetReturnResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReturnWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReturnResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReturnAsync + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + return $this->getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReturnAsyncWithHttpInfo + * + * Информация о невыкупе или возврате + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; + $request = $this->getReturnRequest($campaign_id, $order_id, $return_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReturn' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReturnRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['getReturn'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getReturn' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getReturn, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getReturn' + ); + } + + // verify the required parameter 'return_id' is set + if ($return_id === null || (is_array($return_id) && count($return_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $return_id when calling getReturn' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + // path params + if ($return_id !== null) { + $resourcePath = str_replace( + '{' . 'returnId' . '}', + ObjectSerializer::toPathValue($return_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReturns + * + * Список невыкупов и возвратов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + return $response; + } + + /** + * Operation getReturnsWithHttpInfo + * + * Список невыкупов и возвратов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetReturnsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getReturnsAsync + * + * Список невыкупов и возвратов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getReturnsAsyncWithHttpInfo + * + * Список невыкупов и возвратов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReturns' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getReturns' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getReturns, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getReturns, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling LaasApi.getReturns, number of items must be less than or equal to 50.'); + } + + + + + + + + + + $resourcePath = '/v2/campaigns/{campaignId}/returns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $order_ids, + 'orderIds', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $statuses, + 'statuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shipment_statuses, + 'shipmentStatuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'ReturnType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date2, + 'from_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date2, + 'to_date', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getStocks + * + * Информация об остатках и оборачиваемости + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getStocks($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + list($response) = $this->getStocksWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + return $response; + } + + /** + * Operation getStocksWithHttpInfo + * + * Информация об остатках и оборачиваемости + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetWarehouseStocksResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getStocksWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getStocksAsync + * + * Информация об остатках и оборачиваемости + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getStocksAsync($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + return $this->getStocksAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getStocksAsyncWithHttpInfo + * + * Информация об остатках и оборачиваемости + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getStocksAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; + $request = $this->getStocksRequest($campaign_id, $page_token, $limit, $get_warehouse_stocks_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getStocks' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getStocksRequest($campaign_id, $page_token = null, $limit = null, $get_warehouse_stocks_request = null, string $contentType = self::contentTypes['getStocks'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getStocks' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getStocks, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getStocks, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_warehouse_stocks_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_warehouse_stocks_request)); + } else { + $httpBody = $get_warehouse_stocks_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSupplyRequestDocuments + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getSupplyRequestDocuments($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + list($response) = $this->getSupplyRequestDocumentsWithHttpInfo($campaign_id, $get_supply_request_documents_request, $contentType); + return $response; + } + + /** + * Operation getSupplyRequestDocumentsWithHttpInfo + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSupplyRequestDocumentsWithHttpInfo($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + $request = $this->getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSupplyRequestDocumentsAsync + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestDocumentsAsync($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + return $this->getSupplyRequestDocumentsAsyncWithHttpInfo($campaign_id, $get_supply_request_documents_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSupplyRequestDocumentsAsyncWithHttpInfo + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestDocumentsAsyncWithHttpInfo($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse'; + $request = $this->getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSupplyRequestDocuments' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getSupplyRequestDocuments' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getSupplyRequestDocuments, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_supply_request_documents_request' is set + if ($get_supply_request_documents_request === null || (is_array($get_supply_request_documents_request) && count($get_supply_request_documents_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_supply_request_documents_request when calling getSupplyRequestDocuments' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_supply_request_documents_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_request_documents_request)); + } else { + $httpBody = $get_supply_request_documents_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSupplyRequestItems + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetSupplyRequestItemsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getSupplyRequestItems($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + list($response) = $this->getSupplyRequestItemsWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getSupplyRequestItemsWithHttpInfo + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetSupplyRequestItemsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSupplyRequestItemsWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + $request = $this->getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSupplyRequestItemsAsync + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestItemsAsync($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + return $this->getSupplyRequestItemsAsyncWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSupplyRequestItemsAsyncWithHttpInfo + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestItemsAsyncWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse'; + $request = $this->getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSupplyRequestItems' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getSupplyRequestItems' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getSupplyRequestItems, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_supply_request_items_request' is set + if ($get_supply_request_items_request === null || (is_array($get_supply_request_items_request) && count($get_supply_request_items_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_supply_request_items_request when calling getSupplyRequestItems' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getSupplyRequestItems, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests/items'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_supply_request_items_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_request_items_request)); + } else { + $httpBody = $get_supply_request_items_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSupplyRequests + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetSupplyRequestsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getSupplyRequests($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + list($response) = $this->getSupplyRequestsWithHttpInfo($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); + return $response; + } + + /** + * Operation getSupplyRequestsWithHttpInfo + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetSupplyRequestsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSupplyRequestsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + $request = $this->getSupplyRequestsRequest($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSupplyRequestsAsync + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestsAsync($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + return $this->getSupplyRequestsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSupplyRequestsAsyncWithHttpInfo + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestsResponse'; + $request = $this->getSupplyRequestsRequest($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSupplyRequests' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSupplyRequestsRequest($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getSupplyRequests' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.getSupplyRequests, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.getSupplyRequests, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_supply_requests_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_requests_request)); + } else { + $httpBody = $get_supply_requests_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchRegionChildren + * + * Информация о дочерних регионах + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation searchRegionChildrenWithHttpInfo + * + * Информация о дочерних регионах + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation searchRegionChildrenAsync + * + * Информация о дочерних регионах + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchRegionChildrenAsync($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + return $this->searchRegionChildrenAsyncWithHttpInfo($region_id, $page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchRegionChildrenAsyncWithHttpInfo + * + * Информация о дочерних регионах + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchRegionChildrenAsyncWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchRegionChildren' + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchRegionChildrenRequest($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $region_id when calling searchRegionChildren' + ); + } + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling LaasApi.searchRegionChildren, must be smaller than or equal to 10000.'); + } + + + + $resourcePath = '/v2/regions/{regionId}/children'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($region_id !== null) { + $resourcePath = str_replace( + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchRegionsById + * + * Информация о регионе + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function searchRegionsById($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) + { + list($response) = $this->searchRegionsByIdWithHttpInfo($region_id, $contentType); + return $response; + } + + /** + * Operation searchRegionsByIdWithHttpInfo + * + * Информация о регионе + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchRegionsByIdWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) + { + $request = $this->searchRegionsByIdRequest($region_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation searchRegionsByIdAsync + * + * Информация о регионе + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchRegionsByIdAsync($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) + { + return $this->searchRegionsByIdAsyncWithHttpInfo($region_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchRegionsByIdAsyncWithHttpInfo + * + * Информация о регионе + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchRegionsByIdAsyncWithHttpInfo($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByIdRequest($region_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchRegionsById' + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchRegionsByIdRequest($region_id, string $contentType = self::contentTypes['searchRegionsById'][0]) + { + + // verify the required parameter 'region_id' is set + if ($region_id === null || (is_array($region_id) && count($region_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $region_id when calling searchRegionsById' + ); + } + + + $resourcePath = '/v2/regions/{regionId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($region_id !== null) { + $resourcePath = str_replace( + '{' . 'regionId' . '}', + ObjectSerializer::toPathValue($region_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchRegionsByName + * + * Поиск регионов по их имени + * + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function searchRegionsByName($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) + { + list($response) = $this->searchRegionsByNameWithHttpInfo($name, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation searchRegionsByNameWithHttpInfo + * + * Поиск регионов по их имени + * + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionsResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchRegionsByNameWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) + { + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation searchRegionsByNameAsync + * + * Поиск регионов по их имени + * + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchRegionsByNameAsync($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) + { + return $this->searchRegionsByNameAsyncWithHttpInfo($name, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchRegionsByNameAsyncWithHttpInfo + * + * Поиск регионов по их имени + * + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchRegionsByNameAsyncWithHttpInfo($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; + $request = $this->searchRegionsByNameRequest($name, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchRegionsByName' + * + * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchRegionsByNameRequest($name, $page_token = null, $limit = null, string $contentType = self::contentTypes['searchRegionsByName'][0]) + { + + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling searchRegionsByName' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LaasApi.searchRegionsByName, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/regions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $name, + 'name', // param base name + 'string', // openApiType + '', // style + false, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateBusinessPrices + * + * Установка цен на товары для всех магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateBusinessPrices($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) + { + list($response) = $this->updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, $contentType); + return $response; + } + + /** + * Operation updateBusinessPricesWithHttpInfo + * + * Установка цен на товары для всех магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateBusinessPricesWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) + { + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateBusinessPricesAsync + * + * Установка цен на товары для всех магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateBusinessPricesAsync($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) + { + return $this->updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateBusinessPricesAsyncWithHttpInfo + * + * Установка цен на товары для всех магазинов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateBusinessPricesAsyncWithHttpInfo($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) + { + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateBusinessPricesRequest($business_id, $update_business_prices_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateBusinessPrices' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateBusinessPricesRequest($business_id, $update_business_prices_request, string $contentType = self::contentTypes['updateBusinessPrices'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling updateBusinessPrices' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.updateBusinessPrices, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_business_prices_request' is set + if ($update_business_prices_request === null || (is_array($update_business_prices_request) && count($update_business_prices_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_business_prices_request when calling updateBusinessPrices' + ); + } + + + $resourcePath = '/v2/businesses/{businessId}/offer-prices/updates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_business_prices_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_business_prices_request)); + } else { + $httpBody = $update_business_prices_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCampaignOffers + * + * Изменение условий продажи товаров в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateCampaignOffers($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) + { + list($response) = $this->updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType); + return $response; + } + + /** + * Operation updateCampaignOffersWithHttpInfo + * + * Изменение условий продажи товаров в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCampaignOffersWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) + { + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateCampaignOffersAsync + * + * Изменение условий продажи товаров в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateCampaignOffersAsync($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) + { + return $this->updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCampaignOffersAsyncWithHttpInfo + * + * Изменение условий продажи товаров в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateCampaignOffersAsyncWithHttpInfo($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) + { + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCampaignOffers' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateCampaignOffersRequest($campaign_id, $update_campaign_offers_request, string $contentType = self::contentTypes['updateCampaignOffers'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling updateCampaignOffers' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.updateCampaignOffers, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_campaign_offers_request' is set + if ($update_campaign_offers_request === null || (is_array($update_campaign_offers_request) && count($update_campaign_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_campaign_offers_request when calling updateCampaignOffers' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/offers/update'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_campaign_offers_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_campaign_offers_request)); + } else { + $httpBody = $update_campaign_offers_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOfferContent + * + * Редактирование категорийных характеристик товара + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateOfferContent($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) + { + list($response) = $this->updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, $contentType); + return $response; + } + + /** + * Operation updateOfferContentWithHttpInfo + * + * Редактирование категорийных характеристик товара + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\UpdateOfferContentResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOfferContentWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) + { + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOfferContentResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateOfferContentAsync + * + * Редактирование категорийных характеристик товара + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOfferContentAsync($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) + { + return $this->updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOfferContentAsyncWithHttpInfo + * + * Редактирование категорийных характеристик товара + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOfferContentAsyncWithHttpInfo($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) + { + $returnType = '\OpenAPI\Client\Model\UpdateOfferContentResponse'; + $request = $this->updateOfferContentRequest($business_id, $update_offer_content_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOfferContent' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferContentRequest $update_offer_content_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferContent'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOfferContentRequest($business_id, $update_offer_content_request, string $contentType = self::contentTypes['updateOfferContent'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling updateOfferContent' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.updateOfferContent, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_offer_content_request' is set + if ($update_offer_content_request === null || (is_array($update_offer_content_request) && count($update_offer_content_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_offer_content_request when calling updateOfferContent' + ); + } + + + $resourcePath = '/v2/businesses/{businessId}/offer-cards/update'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_offer_content_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_content_request)); + } else { + $httpBody = $update_offer_content_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOfferMappings + * + * Добавление товаров в каталог и изменение информации о них + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateOfferMappings($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) + { + list($response) = $this->updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType); + return $response; + } + + /** + * Operation updateOfferMappingsWithHttpInfo + * + * Добавление товаров в каталог и изменение информации о них + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\UpdateOfferMappingsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOfferMappingsWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) + { + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOfferMappingsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateOfferMappingsAsync + * + * Добавление товаров в каталог и изменение информации о них + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOfferMappingsAsync($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) + { + return $this->updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOfferMappingsAsyncWithHttpInfo + * + * Добавление товаров в каталог и изменение информации о них + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOfferMappingsAsyncWithHttpInfo($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) + { + $returnType = '\OpenAPI\Client\Model\UpdateOfferMappingsResponse'; + $request = $this->updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOfferMappings' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\UpdateOfferMappingsRequest $update_offer_mappings_request (required) + * @param \OpenAPI\Client\Model\CatalogLanguageType|null $language Язык, на котором принимаются и возвращаются значения в параметрах `name` и `description`. Значение по умолчанию: `RU`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOfferMappingsRequest($business_id, $update_offer_mappings_request, $language = null, string $contentType = self::contentTypes['updateOfferMappings'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling updateOfferMappings' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling LaasApi.updateOfferMappings, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_offer_mappings_request' is set + if ($update_offer_mappings_request === null || (is_array($update_offer_mappings_request) && count($update_offer_mappings_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_offer_mappings_request when calling updateOfferMappings' + ); + } + + + + $resourcePath = '/v2/businesses/{businessId}/offer-mappings/update'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'CatalogLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_offer_mappings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_offer_mappings_request)); + } else { + $httpBody = $update_offer_mappings_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOrderStatus + * + * Изменение статуса одного заказа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateOrderStatus($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) + { + list($response) = $this->updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType); + return $response; + } + + /** + * Operation updateOrderStatusWithHttpInfo + * + * Изменение статуса одного заказа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOrderStatusWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) + { + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateOrderStatusAsync + * + * Изменение статуса одного заказа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOrderStatusAsync($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) + { + return $this->updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOrderStatusAsyncWithHttpInfo + * + * Изменение статуса одного заказа + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOrderStatusAsyncWithHttpInfo($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; + $request = $this->updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOrderStatus' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOrderStatusRequest($campaign_id, $order_id, $update_order_status_request, string $contentType = self::contentTypes['updateOrderStatus'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling updateOrderStatus' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.updateOrderStatus, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling updateOrderStatus' + ); + } + + // verify the required parameter 'update_order_status_request' is set + if ($update_order_status_request === null || (is_array($update_order_status_request) && count($update_order_status_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_order_status_request when calling updateOrderStatus' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_order_status_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_status_request)); + } else { + $httpBody = $update_order_status_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOrderStatuses + * + * Изменение статусов нескольких заказов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateOrderStatuses($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) + { + list($response) = $this->updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType); + return $response; + } + + /** + * Operation updateOrderStatusesWithHttpInfo + * + * Изменение статусов нескольких заказов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\UpdateOrderStatusesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOrderStatusesWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) + { + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateOrderStatusesAsync + * + * Изменение статусов нескольких заказов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOrderStatusesAsync($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) + { + return $this->updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOrderStatusesAsyncWithHttpInfo + * + * Изменение статусов нескольких заказов + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоÐ¼Ð°Ñ‚изированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateOrderStatusesAsyncWithHttpInfo($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) + { + $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; + $request = $this->updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOrderStatuses' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateOrderStatusesRequest($campaign_id, $update_order_statuses_request, string $contentType = self::contentTypes['updateOrderStatuses'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling updateOrderStatuses' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.updateOrderStatuses, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_order_statuses_request' is set + if ($update_order_statuses_request === null || (is_array($update_order_statuses_request) && count($update_order_statuses_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_order_statuses_request when calling updateOrderStatuses' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/status-update'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_order_statuses_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_statuses_request)); + } else { + $httpBody = $update_order_statuses_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePrices + * + * Установка цен на товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updatePrices($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) + { + list($response) = $this->updatePricesWithHttpInfo($campaign_id, $update_prices_request, $contentType); + return $response; + } + + /** + * Operation updatePricesWithHttpInfo + * + * Установка цен на товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiLockedErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePricesWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) + { + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 423: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 423: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updatePricesAsync + * + * Установка цен на товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updatePricesAsync($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) + { + return $this->updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePricesAsyncWithHttpInfo + * + * Установка цен на товары в конкретном магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updatePricesAsyncWithHttpInfo($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) + { + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updatePricesRequest($campaign_id, $update_prices_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePrices' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePricesRequest($campaign_id, $update_prices_request, string $contentType = self::contentTypes['updatePrices'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling updatePrices' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling LaasApi.updatePrices, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_prices_request' is set + if ($update_prices_request === null || (is_array($update_prices_request) && count($update_prices_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_prices_request when calling updatePrices' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices/updates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_prices_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_prices_request)); + } else { + $httpBody = $update_prices_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/erp24/lib/yandex_market_api/Api/OfferMappingsApi.php b/erp24/lib/yandex_market_api/Api/OfferMappingsApi.php index 91850027..27f779ed 100644 --- a/erp24/lib/yandex_market_api/Api/OfferMappingsApi.php +++ b/erp24/lib/yandex_market_api/Api/OfferMappingsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -133,16 +136,16 @@ class OfferMappingsApi * * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -161,16 +164,16 @@ class OfferMappingsApi * * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -207,196 +210,51 @@ class OfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -410,34 +268,11 @@ class OfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -447,7 +282,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -455,7 +290,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -463,7 +298,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -471,7 +306,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -479,7 +314,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -487,7 +322,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -495,8 +330,10 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -506,16 +343,16 @@ class OfferMappingsApi * * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -537,16 +374,16 @@ class OfferMappingsApi * * Список товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -597,16 +434,16 @@ class OfferMappingsApi /** * Create request for operation 'getOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string[] $offer_id Идентификатор товара в каталоге. (optional) - * @param string[] $shop_sku Ваш SKU товара. Параметр может быть указан несколько раз, например: ``` ...shop_sku=123&shop_sku=129&shop_sku=141... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferMappingKindType $mapping_kind Тип маппинга. (optional) - * @param \OpenAPI\Client\Model\OfferProcessingStatusType[] $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете marketSku нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[] $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param int[] $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) - * @param string[] $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ``` ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд Schwarzkopf, то в результатах не будет товаров Schwarzkopf Professional. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string[]|null $offer_id Идентификаторы товаров в каталоге. (optional) + * @param string[]|null $shop_sku Идентификаторы товаров в каталоге. Используйте параметр `offer_id` вместо этого параметра. (optional) (deprecated) + * @param \OpenAPI\Client\Model\OfferMappingKindType|null $mapping_kind Тип маппинга. (optional) + * @param \OpenAPI\Client\Model\OfferProcessingStatusType[]|null $status Фильтрация по статусу публикации товара: * `READY` — товар прошел модерацию. * `IN_WORK` — товар проходит модерацию. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно или создать ее. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `OTHER` — товар не прошел модерацию по другой причине. Можно указать несколько статусов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...status=READY,IN_WORK... ...status=READY&status=IN_WORK... ``` В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра shopSku и параметров для фильтрации приведет к ошибке. (optional) + * @param \OpenAPI\Client\Model\OfferAvailabilityStatusType[]|null $availability Фильтрация по планам поставок товара: * `ACTIVE` — поставки будут. * `INACTIVE` — поставок не будет: товар есть на складе, но вы больше не планируете его поставлять. * `DELISTED` — архив: товар закончился на складе, и его поставок больше не будет. Можно указать несколько значений в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...availability=INACTIVE,DELISTED... ...availability=INACTIVE&availability=DELISTED... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param int[]|null $category_id Фильтрация по идентификатору категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). Можно указать несколько идентификаторов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...category_id=14727164,14382343... ...category_id=14727164&category_id=14382343... ``` В запросе можно указать либо параметр `shopSku`, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string[]|null $vendor Фильтрация по бренду товара. Можно указать несколько брендов в одном параметре, через запятую, или в нескольких одинаковых параметрах. Например: ```text translate=no ...vendor=Aqua%20Minerale,Borjomi... ...vendor=Aqua%20Minerale&vendor=Borjomi... ``` Чтобы товар попал в результаты фильтрации, его бренд должен точно совпадать с одним из указанных в запросе. Например, если указан бренд :no-translate[Schwarzkopf], то в результатах не будет товаров :no-translate[Schwarzkopf Professional]. Если в названии бренда есть символы, которые не входят в таблицу ASCII (в том числе кириллические символы), используйте для них URL-кодирование. Например, пробел — %20, апостроф «'» — %27 и т. д. Подробнее см. в разделе [Кодирование URL русскоязычной Википедии](https://ru.wikipedia.org/wiki/URL#Кодирование_URL). В запросе можно указать либо параметр shopSku, либо любые параметры для фильтрации товаров. Совместное использование параметра `shopSku` и параметров для фильтрации приведет к ошибке. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferMappingEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -626,17 +463,20 @@ class OfferMappingsApi throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OfferMappingsApi.getOfferMappingEntries, must be bigger than or equal to 1.'); } + + + + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OfferMappingsApi.getOfferMappingEntries, must be bigger than or equal to 1.'); + } + - - - - - - - - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries'; $formParams = []; $queryParams = []; $headerParams = []; @@ -803,7 +643,7 @@ class OfferMappingsApi * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request get_suggested_offer_mapping_entries_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * @@ -823,7 +663,7 @@ class OfferMappingsApi * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * @@ -861,196 +701,51 @@ class OfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1064,34 +759,11 @@ class OfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1101,7 +773,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1109,7 +781,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1117,7 +789,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1125,7 +797,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1133,7 +805,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1141,7 +813,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1149,8 +821,10 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1160,7 +834,7 @@ class OfferMappingsApi * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * @@ -1183,7 +857,7 @@ class OfferMappingsApi * * Рекомендованные карточки для товаров * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * @@ -1235,7 +909,7 @@ class OfferMappingsApi /** * Create request for operation 'getSuggestedOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetSuggestedOfferMappingEntriesRequest $get_suggested_offer_mapping_entries_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedOfferMappingEntries'] to see the possible values for this operation * @@ -1264,7 +938,7 @@ class OfferMappingsApi } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/suggestions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1357,7 +1031,7 @@ class OfferMappingsApi * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request update_offer_mapping_entry_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * @@ -1377,7 +1051,7 @@ class OfferMappingsApi * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * @@ -1415,223 +1089,57 @@ class OfferMappingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1645,34 +1153,11 @@ class OfferMappingsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1682,7 +1167,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1690,7 +1175,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1698,7 +1183,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1706,7 +1191,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1714,7 +1199,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1722,7 +1207,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1730,7 +1215,7 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1738,8 +1223,10 @@ class OfferMappingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1749,7 +1236,7 @@ class OfferMappingsApi * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * @@ -1772,7 +1259,7 @@ class OfferMappingsApi * * Добавление и редактирование товаров в каталоге * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * @@ -1824,7 +1311,7 @@ class OfferMappingsApi /** * Create request for operation 'updateOfferMappingEntries' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOfferMappingEntryRequest $update_offer_mapping_entry_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOfferMappingEntries'] to see the possible values for this operation * @@ -1853,7 +1340,7 @@ class OfferMappingsApi } - $resourcePath = '/campaigns/{campaignId}/offer-mapping-entries/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-mapping-entries/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1957,6 +1444,57 @@ class OfferMappingsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OffersApi.php b/erp24/lib/yandex_market_api/Api/OffersApi.php index 33863068..6c2ccd2e 100644 --- a/erp24/lib/yandex_market_api/Api/OffersApi.php +++ b/erp24/lib/yandex_market_api/Api/OffersApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], - 'getAllOffers' => [ - 'application/json', - ], 'getCampaignOffers' => [ 'application/json', ], 'getOfferRecommendations' => [ 'application/json', ], - 'getOffers' => [ - 'application/json', - ], 'updateCampaignOffers' => [ 'application/json', ], @@ -98,10 +95,10 @@ class OffersApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -142,7 +139,7 @@ class OffersApi * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request delete_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * @@ -161,7 +158,7 @@ class OffersApi * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * @@ -198,223 +195,57 @@ class OffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeleteCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -428,34 +259,11 @@ class OffersApi ); } - $returnType = '\OpenAPI\Client\Model\DeleteCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeleteCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -465,7 +273,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -473,7 +281,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -481,7 +289,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -489,7 +297,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -497,7 +305,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -505,7 +313,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -513,7 +321,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -521,8 +329,10 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -532,7 +342,7 @@ class OffersApi * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * @@ -554,7 +364,7 @@ class OffersApi * * Удаление товаров из ассортимента магазина * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * @@ -605,7 +415,7 @@ class OffersApi /** * Create request for operation 'deleteCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\DeleteCampaignOffersRequest $delete_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteCampaignOffers'] to see the possible values for this operation * @@ -633,7 +443,7 @@ class OffersApi } - $resourcePath = '/campaigns/{campaignId}/offers/delete'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -722,44 +532,44 @@ class OffersApi } /** - * Operation getAllOffers + * Operation getCampaignOffers * - * Все предложения магазина + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getAllOffers($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers'][0]) + public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - list($response) = $this->getAllOffersWithHttpInfo($campaign_id, $feed_id, $chunk, $contentType); + list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getAllOffersWithHttpInfo + * Operation getCampaignOffersWithHttpInfo * - * Все предложения магазина + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetAllOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getAllOffersWithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers'][0]) + public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $request = $this->getAllOffersRequest($campaign_id, $feed_id, $chunk, $contentType); + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -786,196 +596,51 @@ class OffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetAllOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetAllOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetAllOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -989,44 +654,21 @@ class OffersApi ); } - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetCampaignOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetAllOffersResponse', + '\OpenAPI\Client\Model\GetCampaignOffersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1034,7 +676,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1042,7 +684,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1050,7 +692,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1058,7 +700,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1066,7 +708,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1074,29 +716,31 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllOffersAsync + * Operation getCampaignOffersAsync * - * Все предложения магазина + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffersAsync($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers'][0]) + public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - return $this->getAllOffersAsyncWithHttpInfo($campaign_id, $feed_id, $chunk, $contentType) + return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -1105,23 +749,23 @@ class OffersApi } /** - * Operation getAllOffersAsyncWithHttpInfo + * Operation getCampaignOffersAsyncWithHttpInfo * - * Все предложения магазина + * Информация о товарах, которые размещены в заданном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getAllOffersAsyncWithHttpInfo($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers'][0]) + public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { - $returnType = '\OpenAPI\Client\Model\GetAllOffersResponse'; - $request = $this->getAllOffersRequest($campaign_id, $feed_id, $chunk, $contentType); + $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; + $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1160,34 +804,44 @@ class OffersApi } /** - * Create request for operation 'getAllOffers' + * Create request for operation 'getCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param int $chunk Номер сегмента с результатами. Значение по умолчанию: `0`. {% note info %} Номера сегментов запрашиваются последовательно, пока не будет получен сегмент с пустым ответом. Пустой ответ означает, что все предложения магазина получены. {% endnote %} {% note alert %} Нумерация начинается с 0. Чтобы запросить первую страницу, необходимо указать `chunk=0` и т. д. {% endnote %} (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllOffers'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getAllOffersRequest($campaign_id, $feed_id = null, $chunk = null, string $contentType = self::contentTypes['getAllOffers'][0]) + public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getAllOffers' + 'Missing the required parameter $campaign_id when calling getCampaignOffers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OffersApi.getAllOffers, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OffersApi.getCampaignOffers, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_campaign_offers_request' is set + if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' + ); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OffersApi.getCampaignOffers, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns/{campaignId}/offers/all'; + $resourcePath = '/v2/campaigns/{campaignId}/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1196,17 +850,17 @@ class OffersApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType + $page_token, + 'page_token', // param base name + 'string', // openApiType '', // style false, // explode false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $chunk, - 'chunk', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -1231,1163 +885,12 @@ class OffersApi ); // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); - if ($apiKey !== null) { - $headers['Api-Key'] = $apiKey; - } - // this endpoint requires OAuth (access token) - if (!empty($this->config->getAccessToken())) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getCampaignOffers - * - * Информация о товарах, которые размещены в заданном магазине - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - */ - public function getCampaignOffers($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) - { - list($response) = $this->getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); - return $response; - } - - /** - * Operation getCampaignOffersWithHttpInfo - * - * Информация о товарах, которые размещены в заданном магазине - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetCampaignOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getCampaignOffersWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) - { - $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetCampaignOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetCampaignOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\GetCampaignOffersResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 420: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLimitErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiServerErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getCampaignOffersAsync - * - * Информация о товарах, которые размещены в заданном магазине - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCampaignOffersAsync($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) - { - return $this->getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getCampaignOffersAsyncWithHttpInfo - * - * Информация о товарах, которые размещены в заданном магазине - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getCampaignOffersAsyncWithHttpInfo($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) - { - $returnType = '\OpenAPI\Client\Model\GetCampaignOffersResponse'; - $request = $this->getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token, $limit, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getCampaignOffers' - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetCampaignOffersRequest $get_campaign_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignOffers'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getCampaignOffersRequest($campaign_id, $get_campaign_offers_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getCampaignOffers'][0]) - { - - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getCampaignOffers' - ); - } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OffersApi.getCampaignOffers, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_campaign_offers_request' is set - if ($get_campaign_offers_request === null || (is_array($get_campaign_offers_request) && count($get_campaign_offers_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_campaign_offers_request when calling getCampaignOffers' - ); - } - - - - - $resourcePath = '/campaigns/{campaignId}/offers'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - - - // path params - if ($campaign_id !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (isset($get_campaign_offers_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); - } else { - $httpBody = $get_campaign_offers_request; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); - if ($apiKey !== null) { - $headers['Api-Key'] = $apiKey; - } - // this endpoint requires OAuth (access token) - if (!empty($this->config->getAccessToken())) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'POST', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getOfferRecommendations - * - * Рекомендации Маркета, касающиеся цен - * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - */ - public function getOfferRecommendations($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) - { - list($response) = $this->getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); - return $response; - } - - /** - * Operation getOfferRecommendationsWithHttpInfo - * - * Рекомендации Маркета, касающиеся цен - * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation - * - * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) - { - $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOfferRecommendationsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiClientDataErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 420: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiLimitErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiServerErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getOfferRecommendationsAsync - * - * Рекомендации Маркета, касающиеся цен - * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getOfferRecommendationsAsync($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) - { - return $this->getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getOfferRecommendationsAsyncWithHttpInfo - * - * Рекомендации Маркета, касающиеся цен - * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) - { - $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; - $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getOfferRecommendations' - * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) - { - - // verify the required parameter 'business_id' is set - if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getOfferRecommendations' - ); - } - if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling OffersApi.getOfferRecommendations, must be bigger than or equal to 1.'); - } - - // verify the required parameter 'get_offer_recommendations_request' is set - if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations' - ); - } - - - - - $resourcePath = '/businesses/{businessId}/offers/recommendations'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_token, - 'page_token', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - - - // path params - if ($business_id !== null) { - $resourcePath = str_replace( - '{' . 'businessId' . '}', - ObjectSerializer::toPathValue($business_id), - $resourcePath - ); - } - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (isset($get_offer_recommendations_request)) { + if (isset($get_campaign_offers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_campaign_offers_request)); } else { - $httpBody = $get_offer_recommendations_request; + $httpBody = $get_campaign_offers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2445,54 +948,44 @@ class OffersApi } /** - * Operation getOffers + * Operation getOfferRecommendations * - * Предложения магазина + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOffers($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers'][0]) + public function getOfferRecommendations($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - list($response) = $this->getOffersWithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + list($response) = $this->getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOffersWithHttpInfo + * Operation getOfferRecommendationsWithHttpInfo * - * Предложения магазина + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOffersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetOfferRecommendationsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOffersWithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers'][0]) + public function getOfferRecommendationsWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $request = $this->getOffersRequest($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -2519,196 +1012,51 @@ class OffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2722,44 +1070,21 @@ class OffersApi ); } - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOffersResponse', + '\OpenAPI\Client\Model\GetOfferRecommendationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2767,7 +1092,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2775,7 +1100,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2783,7 +1108,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2791,7 +1116,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2799,7 +1124,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2807,34 +1132,31 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOffersAsync + * Operation getOfferRecommendationsAsync * - * Предложения магазина + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffersAsync($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers'][0]) + public function getOfferRecommendationsAsync($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - return $this->getOffersAsyncWithHttpInfo($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType) + return $this->getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -2843,28 +1165,23 @@ class OffersApi } /** - * Operation getOffersAsyncWithHttpInfo + * Operation getOfferRecommendationsAsyncWithHttpInfo * - * Предложения магазина + * Рекомендации Маркета, касающиеся цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getOffersAsyncWithHttpInfo($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers'][0]) + public function getOfferRecommendationsAsyncWithHttpInfo($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOffersResponse'; - $request = $this->getOffersRequest($campaign_id, $query, $feed_id, $shop_category_id, $currency, $matched, $page, $page_size, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOfferRecommendationsResponse'; + $request = $this->getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2903,47 +1220,44 @@ class OffersApi } /** - * Create request for operation 'getOffers' + * Create request for operation 'getOfferRecommendations' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $query Поисковый запрос. Поддерживается язык запросов. Значение по умолчанию: все предложения магазина, размещенные на Маркете. (optional) - * @param int $feed_id Идентификатор прайс-листа. (optional) - * @param string $shop_category_id Идентификатор категории предложения, указанный магазином в прайс-листе. Параметр выводится только для предложений, у которых указана категория в прайс-листе. Параметр доступен начиная с версии 2.0 партнерского API. (optional) - * @param \OpenAPI\Client\Model\CurrencyType $currency Валюта, в которой указана цена предложения. Возможные значения: * `BYN` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. (optional) - * @param bool $matched Фильтр по признаку соотнесения предложения и карточки модели. Возможные значения: * `0 / FALSE / NO` — поиск выполняется среди предложений, не соотнесенных ни с какой карточкой модели. * `1 / TRUE / YES` — поиск выполняется среди предложений, соотнесенных с карточками моделей). (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOffers'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetOfferRecommendationsRequest $get_offer_recommendations_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOfferRecommendations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getOffersRequest($campaign_id, $query = null, $feed_id = null, $shop_category_id = null, $currency = null, $matched = null, $page = 1, $page_size = null, string $contentType = self::contentTypes['getOffers'][0]) + public function getOfferRecommendationsRequest($business_id, $get_offer_recommendations_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOfferRecommendations'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOffers' + 'Missing the required parameter $business_id when calling getOfferRecommendations' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OffersApi.getOffers, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling OffersApi.getOfferRecommendations, must be bigger than or equal to 1.'); } + // verify the required parameter 'get_offer_recommendations_request' is set + if ($get_offer_recommendations_request === null || (is_array($get_offer_recommendations_request) && count($get_offer_recommendations_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_offer_recommendations_request when calling getOfferRecommendations' + ); + } - - - - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling OffersApi.getOffers, must be smaller than or equal to 10000.'); + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OffersApi.getOfferRecommendations, must be bigger than or equal to 1.'); } - - $resourcePath = '/campaigns/{campaignId}/offers'; + $resourcePath = '/v2/businesses/{businessId}/offers/recommendations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2952,26 +1266,8 @@ class OffersApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name - 'string', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $feed_id, - 'feedId', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $shop_category_id, - 'shopCategoryId', // param base name + $page_token, + 'page_token', // param base name 'string', // openApiType '', // style false, // explode @@ -2979,35 +1275,8 @@ class OffersApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $currency, - 'currency', // param base name - 'CurrencyType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $matched, - 'matched', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page_size, - 'pageSize', // param base name + $limit, + 'limit', // param base name 'integer', // openApiType '', // style false, // explode @@ -3016,10 +1285,10 @@ class OffersApi // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -3032,7 +1301,14 @@ class OffersApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_offer_recommendations_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_offer_recommendations_request)); + } else { + $httpBody = $get_offer_recommendations_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3080,7 +1356,7 @@ class OffersApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3092,7 +1368,7 @@ class OffersApi * * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request update_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * @@ -3111,7 +1387,7 @@ class OffersApi * * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * @@ -3148,223 +1424,57 @@ class OffersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3378,34 +1488,11 @@ class OffersApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3415,7 +1502,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3423,7 +1510,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3431,7 +1518,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3439,7 +1526,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3447,7 +1534,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3455,7 +1542,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3463,7 +1550,7 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3471,8 +1558,10 @@ class OffersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3482,7 +1571,7 @@ class OffersApi * * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * @@ -3504,7 +1593,7 @@ class OffersApi * * Изменение условий продажи товаров в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * @@ -3555,7 +1644,7 @@ class OffersApi /** * Create request for operation 'updateCampaignOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateCampaignOffersRequest $update_campaign_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateCampaignOffers'] to see the possible values for this operation * @@ -3583,7 +1672,7 @@ class OffersApi } - $resourcePath = '/campaigns/{campaignId}/offers/update'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3687,6 +1776,57 @@ class OffersApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OrderBusinessInformationApi.php b/erp24/lib/yandex_market_api/Api/OrderBusinessInformationApi.php index 61a05e20..b82c2098 100644 --- a/erp24/lib/yandex_market_api/Api/OrderBusinessInformationApi.php +++ b/erp24/lib/yandex_market_api/Api/OrderBusinessInformationApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -130,7 +133,7 @@ class OrderBusinessInformationApi * * Информация о покупателе — юридическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * @@ -149,7 +152,7 @@ class OrderBusinessInformationApi * * Информация о покупателе — юридическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * @@ -186,196 +189,51 @@ class OrderBusinessInformationApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -389,34 +247,11 @@ class OrderBusinessInformationApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessBuyerInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -426,7 +261,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -434,7 +269,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -442,7 +277,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -450,7 +285,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -458,7 +293,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -466,7 +301,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -474,8 +309,10 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -485,7 +322,7 @@ class OrderBusinessInformationApi * * Информация о покупателе — юридическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * @@ -507,7 +344,7 @@ class OrderBusinessInformationApi * * Информация о покупателе — юридическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * @@ -558,7 +395,7 @@ class OrderBusinessInformationApi /** * Create request for operation 'getOrderBusinessBuyerInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessBuyerInfo'] to see the possible values for this operation * @@ -586,7 +423,7 @@ class OrderBusinessInformationApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/business-buyer'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/business-buyer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -680,7 +517,7 @@ class OrderBusinessInformationApi * * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * @@ -699,7 +536,7 @@ class OrderBusinessInformationApi * * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * @@ -736,196 +573,51 @@ class OrderBusinessInformationApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -939,34 +631,11 @@ class OrderBusinessInformationApi ); } - $returnType = '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessDocumentsInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -976,7 +645,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -984,7 +653,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -992,7 +661,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1000,7 +669,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1008,7 +677,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1016,7 +685,7 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1024,8 +693,10 @@ class OrderBusinessInformationApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1035,7 +706,7 @@ class OrderBusinessInformationApi * * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * @@ -1057,7 +728,7 @@ class OrderBusinessInformationApi * * Информация о документах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * @@ -1108,7 +779,7 @@ class OrderBusinessInformationApi /** * Create request for operation 'getOrderBusinessDocumentsInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBusinessDocumentsInfo'] to see the possible values for this operation * @@ -1136,7 +807,7 @@ class OrderBusinessInformationApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/documents'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/documents'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1241,6 +912,57 @@ class OrderBusinessInformationApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OrderDeliveryApi.php b/erp24/lib/yandex_market_api/Api/OrderDeliveryApi.php index 044a3539..97a3db5b 100644 --- a/erp24/lib/yandex_market_api/Api/OrderDeliveryApi.php +++ b/erp24/lib/yandex_market_api/Api/OrderDeliveryApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -139,7 +142,7 @@ class OrderDeliveryApi * * Информация о покупателе — физическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation * @@ -158,7 +161,7 @@ class OrderDeliveryApi * * Информация о покупателе — физическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation * @@ -195,196 +198,51 @@ class OrderDeliveryApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderBuyerInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderBuyerInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -398,34 +256,11 @@ class OrderDeliveryApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderBuyerInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -435,7 +270,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +278,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +286,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +294,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +302,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,7 +310,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -483,8 +318,10 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -494,7 +331,7 @@ class OrderDeliveryApi * * Информация о покупателе — физическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation * @@ -516,7 +353,7 @@ class OrderDeliveryApi * * Информация о покупателе — физическом лице * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation * @@ -567,7 +404,7 @@ class OrderDeliveryApi /** * Create request for operation 'getOrderBuyerInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderBuyerInfo'] to see the possible values for this operation * @@ -595,7 +432,7 @@ class OrderDeliveryApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/buyer'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/buyer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -689,7 +526,7 @@ class OrderDeliveryApi * * Изменение даты доставки заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request set_order_delivery_date_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation @@ -709,7 +546,7 @@ class OrderDeliveryApi * * Изменение даты доставки заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation @@ -747,196 +584,51 @@ class OrderDeliveryApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -950,34 +642,11 @@ class OrderDeliveryApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -987,7 +656,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -995,7 +664,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1003,7 +672,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1011,7 +680,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1019,7 +688,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1027,7 +696,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1035,8 +704,10 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1046,7 +717,7 @@ class OrderDeliveryApi * * Изменение даты доставки заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation @@ -1069,7 +740,7 @@ class OrderDeliveryApi * * Изменение даты доставки заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation @@ -1121,7 +792,7 @@ class OrderDeliveryApi /** * Create request for operation 'setOrderDeliveryDate' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryDateRequest $set_order_delivery_date_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryDate'] to see the possible values for this operation @@ -1157,7 +828,7 @@ class OrderDeliveryApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/date'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/date'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1258,7 +929,7 @@ class OrderDeliveryApi * * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request set_order_delivery_track_code_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation @@ -1278,7 +949,7 @@ class OrderDeliveryApi * * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation @@ -1316,196 +987,51 @@ class OrderDeliveryApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1519,34 +1045,11 @@ class OrderDeliveryApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1556,7 +1059,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1564,7 +1067,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1572,7 +1075,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1580,7 +1083,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1588,7 +1091,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1596,7 +1099,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1604,8 +1107,10 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1615,7 +1120,7 @@ class OrderDeliveryApi * * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation @@ -1638,7 +1143,7 @@ class OrderDeliveryApi * * Передача трек‑номера посылки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation @@ -1690,7 +1195,7 @@ class OrderDeliveryApi /** * Create request for operation 'setOrderDeliveryTrackCode' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\SetOrderDeliveryTrackCodeRequest $set_order_delivery_track_code_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderDeliveryTrackCode'] to see the possible values for this operation @@ -1726,7 +1231,7 @@ class OrderDeliveryApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/track'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/track'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1827,7 +1332,7 @@ class OrderDeliveryApi * * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request update_order_storage_limit_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation @@ -1847,7 +1352,7 @@ class OrderDeliveryApi * * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation @@ -1885,196 +1390,51 @@ class OrderDeliveryApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2088,34 +1448,11 @@ class OrderDeliveryApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2125,7 +1462,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2133,7 +1470,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2141,7 +1478,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2149,7 +1486,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2157,7 +1494,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2165,7 +1502,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2173,8 +1510,10 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2184,7 +1523,7 @@ class OrderDeliveryApi * * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation @@ -2207,7 +1546,7 @@ class OrderDeliveryApi * * Продление срока хранения заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation @@ -2259,7 +1598,7 @@ class OrderDeliveryApi /** * Create request for operation 'updateOrderStorageLimit' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStorageLimitRequest $update_order_storage_limit_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStorageLimit'] to see the possible values for this operation @@ -2295,7 +1634,7 @@ class OrderDeliveryApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/storage-limit'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/storage-limit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2396,7 +1735,7 @@ class OrderDeliveryApi * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request verify_order_eac_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation @@ -2416,7 +1755,7 @@ class OrderDeliveryApi * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation @@ -2454,196 +1793,51 @@ class OrderDeliveryApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\VerifyOrderEacResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\VerifyOrderEacResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\VerifyOrderEacResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\VerifyOrderEacResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2657,34 +1851,11 @@ class OrderDeliveryApi ); } - $returnType = '\OpenAPI\Client\Model\VerifyOrderEacResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\VerifyOrderEacResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2694,7 +1865,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2702,7 +1873,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2710,7 +1881,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2718,7 +1889,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2726,7 +1897,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2734,7 +1905,7 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2742,8 +1913,10 @@ class OrderDeliveryApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2753,7 +1926,7 @@ class OrderDeliveryApi * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation @@ -2776,7 +1949,7 @@ class OrderDeliveryApi * * Передача кода подтверждения * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation @@ -2828,7 +2001,7 @@ class OrderDeliveryApi /** * Create request for operation 'verifyOrderEac' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\VerifyOrderEacRequest $verify_order_eac_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyOrderEac'] to see the possible values for this operation @@ -2864,7 +2037,7 @@ class OrderDeliveryApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/verifyEac'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/verifyEac'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2976,6 +2149,57 @@ class OrderDeliveryApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OrderLabelsApi.php b/erp24/lib/yandex_market_api/Api/OrderLabelsApi.php index 42ba4535..aabe267f 100644 --- a/erp24/lib/yandex_market_api/Api/OrderLabelsApi.php +++ b/erp24/lib/yandex_market_api/Api/OrderLabelsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -133,11 +136,11 @@ class OrderLabelsApi * * Готовый ярлык‑наклейка для коробки в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -155,11 +158,11 @@ class OrderLabelsApi * * Готовый ярлык‑наклейка для коробки в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -195,196 +198,51 @@ class OrderLabelsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -398,34 +256,11 @@ class OrderLabelsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -435,7 +270,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +278,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +286,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +294,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +302,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,7 +310,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -483,8 +318,10 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -494,11 +331,11 @@ class OrderLabelsApi * * Готовый ярлык‑наклейка для коробки в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -519,11 +356,11 @@ class OrderLabelsApi * * Готовый ярлык‑наклейка для коробки в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -573,11 +410,11 @@ class OrderLabelsApi /** * Create request for operation 'generateOrderLabel' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Идентификатор грузоместа. (required) + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) (deprecated) * @param int $box_id Идентификатор коробки. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabel'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -619,7 +456,7 @@ class OrderLabelsApi - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label'; $formParams = []; $queryParams = []; $headerParams = []; @@ -738,9 +575,9 @@ class OrderLabelsApi * * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -758,9 +595,9 @@ class OrderLabelsApi * * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -796,196 +633,51 @@ class OrderLabelsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -999,34 +691,11 @@ class OrderLabelsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1036,7 +705,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1044,7 +713,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1052,7 +721,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1060,7 +729,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1068,7 +737,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1076,7 +745,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1084,8 +753,10 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1095,9 +766,9 @@ class OrderLabelsApi * * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1118,9 +789,9 @@ class OrderLabelsApi * * Готовые ярлыки‑наклейки на все коробки в одном заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1170,9 +841,9 @@ class OrderLabelsApi /** * Create request for operation 'generateOrderLabels' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A6. (optional) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateOrderLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1200,7 +871,7 @@ class OrderLabelsApi - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1303,7 +974,7 @@ class OrderLabelsApi * * Данные для самостоятельного изготовления ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * @@ -1322,7 +993,7 @@ class OrderLabelsApi * * Данные для самостоятельного изготовления ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * @@ -1359,196 +1030,51 @@ class OrderLabelsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderLabelsDataResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1562,34 +1088,11 @@ class OrderLabelsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderLabelsDataResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderLabelsDataResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1599,7 +1102,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1607,7 +1110,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1615,7 +1118,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1623,7 +1126,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1631,7 +1134,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1639,7 +1142,7 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1647,8 +1150,10 @@ class OrderLabelsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1658,7 +1163,7 @@ class OrderLabelsApi * * Данные для самостоятельного изготовления ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * @@ -1680,7 +1185,7 @@ class OrderLabelsApi * * Данные для самостоятельного изготовления ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * @@ -1731,7 +1236,7 @@ class OrderLabelsApi /** * Create request for operation 'getOrderLabelsData' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderLabelsData'] to see the possible values for this operation * @@ -1759,7 +1264,7 @@ class OrderLabelsApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/labels/data'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1864,6 +1369,57 @@ class OrderLabelsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OrdersApi.php b/erp24/lib/yandex_market_api/Api/OrdersApi.php index 65c2701d..51b08cf5 100644 --- a/erp24/lib/yandex_market_api/Api/OrdersApi.php +++ b/erp24/lib/yandex_market_api/Api/OrdersApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], + 'getBusinessOrders' => [ + 'application/json', + ], 'getOrder' => [ 'application/json', ], + 'getOrderIdentifiersStatus' => [ + 'application/json', + ], 'getOrders' => [ 'application/json', ], @@ -92,6 +101,9 @@ class OrdersApi 'setOrderShipmentBoxes' => [ 'application/json', ], + 'updateExternalOrderId' => [ + 'application/json', + ], 'updateOrderItems' => [ 'application/json', ], @@ -110,10 +122,10 @@ class OrdersApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -154,7 +166,7 @@ class OrdersApi * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request accept_order_cancellation_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation @@ -174,7 +186,7 @@ class OrdersApi * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation @@ -212,196 +224,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -415,34 +282,11 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -452,7 +296,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -460,7 +304,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -468,7 +312,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -476,7 +320,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -484,7 +328,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -492,7 +336,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -500,8 +344,10 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -511,7 +357,7 @@ class OrdersApi * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation @@ -534,7 +380,7 @@ class OrdersApi * * Отмена заказа покупателем * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation @@ -586,7 +432,7 @@ class OrdersApi /** * Create request for operation 'acceptOrderCancellation' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\AcceptOrderCancellationRequest $accept_order_cancellation_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acceptOrderCancellation'] to see the possible values for this operation @@ -622,7 +468,7 @@ class OrdersApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/cancellation/accept'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept'; $formParams = []; $queryParams = []; $headerParams = []; @@ -719,40 +565,44 @@ class OrdersApi } /** - * Operation getOrder + * Operation getBusinessOrders * - * Информация об одном заказе + * Информация о заказах в кабинете * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + public function getBusinessOrders($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); + list($response) = $this->getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $response; } /** - * Operation getOrderWithHttpInfo + * Operation getBusinessOrdersWithHttpInfo * - * Информация об одном заказе + * Информация о заказах в кабинете * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetBusinessOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + public function getBusinessOrdersWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); try { $options = $this->createHttpClientOption(); @@ -779,196 +629,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrderResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrderResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrderResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -982,44 +687,21 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrderResponse', + '\OpenAPI\Client\Model\GetBusinessOrdersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1027,7 +709,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1035,7 +717,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1043,7 +725,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1051,7 +733,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1059,7 +741,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1067,27 +749,31 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrderAsync + * Operation getBusinessOrdersAsync * - * Информация об одном заказе + * Информация о заказах в кабинете * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + public function getBusinessOrdersAsync($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + return $this->getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token, $limit, $contentType) ->then( function ($response) { return $response[0]; @@ -1096,21 +782,23 @@ class OrdersApi } /** - * Operation getOrderAsyncWithHttpInfo + * Operation getBusinessOrdersAsyncWithHttpInfo * - * Информация об одном заказе + * Информация о заказах в кабинете * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + public function getBusinessOrdersAsyncWithHttpInfo($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; - $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetBusinessOrdersResponse'; + $request = $this->getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token, $limit, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1149,58 +837,75 @@ class OrdersApi } /** - * Create request for operation 'getOrder' + * Create request for operation 'getBusinessOrders' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $order_id Идентификатор заказа. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetBusinessOrdersRequest $get_business_orders_request Параметры фильтрации заказов. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessOrders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) + public function getBusinessOrdersRequest($business_id, $get_business_orders_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getBusinessOrders'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrder' + 'Missing the required parameter $business_id when calling getBusinessOrders' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.getOrder, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling OrdersApi.getBusinessOrders, must be bigger than or equal to 1.'); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + // verify the required parameter 'get_business_orders_request' is set + if ($get_business_orders_request === null || (is_array($get_business_orders_request) && count($get_business_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrder' + 'Missing the required parameter $get_business_orders_request when calling getBusinessOrders' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}'; + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OrdersApi.getBusinessOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v1/businesses/{businessId}/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), - $resourcePath - ); - } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'orderId' . '}', - ObjectSerializer::toPathValue($order_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -1213,7 +918,14 @@ class OrdersApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_business_orders_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_business_orders_request)); + } else { + $httpBody = $get_business_orders_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1261,7 +973,7 @@ class OrdersApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1269,76 +981,42 @@ class OrdersApi } /** - * Operation getOrders + * Operation getOrder * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + public function getOrder($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + list($response) = $this->getOrderWithHttpInfo($campaign_id, $order_id, $contentType); return $response; } /** - * Operation getOrdersWithHttpInfo + * Operation getOrderWithHttpInfo * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetOrderResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + public function getOrderWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1365,196 +1043,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1568,44 +1101,21 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetOrdersResponse', + '\OpenAPI\Client\Model\GetOrderResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1613,7 +1123,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1621,7 +1131,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1629,7 +1139,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1637,7 +1147,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1645,7 +1155,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1653,45 +1163,30 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getOrdersAsync + * Operation getOrderAsync * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + public function getOrderAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + return $this->getOrderAsyncWithHttpInfo($campaign_id, $order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1700,39 +1195,22 @@ class OrdersApi } /** - * Operation getOrdersAsyncWithHttpInfo + * Operation getOrderAsyncWithHttpInfo * - * Информация о нескольких заказах - * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * Информация об одном заказе в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + public function getOrderAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { - $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; - $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + $returnType = '\OpenAPI\Client\Model\GetOrderResponse'; + $request = $this->getOrderRequest($campaign_id, $order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1771,75 +1249,930 @@ class OrdersApi } /** - * Create request for operation 'getOrders' + * Create request for operation 'getOrder' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) - * @param \OpenAPI\Client\Model\OrderStatusType[] $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт самовывоза. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \OpenAPI\Client\Model\OrderSubstatusType[] $substatus Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. Также могут возвращаться другие значения. Обрабатывать их не требуется. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. (optional) - * @param \DateTime $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) - * @param \DateTime $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) - * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType $dispatch_type Способ отгрузки (optional) - * @param bool $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. (optional, default to false) - * @param bool $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) - * @param bool $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтрация заказов по наличию запросов покупателей на отмену. При значение `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) - * @param bool $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) - * @param \OpenAPI\Client\Model\OrderBuyerType $buyer_type Фильтрация заказов по типу покупателя. (optional) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + public function getOrderRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrder'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getOrders' + 'Missing the required parameter $campaign_id when calling getOrder' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.getOrders, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.getOrder, must be bigger than or equal to 1.'); } - - - - - - + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrder' + ); + } + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); - if ($page !== null && $page > 10000) { - throw new \InvalidArgumentException('invalid value for "$page" when calling OrdersApi.getOrders, must be smaller than or equal to 10000.'); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } } - - + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - $resourcePath = '/campaigns/{campaignId}/orders'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrderIdentifiersStatus + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getOrderIdentifiersStatus($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + list($response) = $this->getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, $contentType); + return $response; + } + + /** + * Operation getOrderIdentifiersStatusWithHttpInfo + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrderIdentifiersStatusWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrderIdentifiersStatusAsync + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderIdentifiersStatusAsync($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + return $this->getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrderIdentifiersStatusAsyncWithHttpInfo + * + * Статусы проверки кодов маркировки + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrderIdentifiersStatusAsyncWithHttpInfo($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrderIdentifiersStatusResponse'; + $request = $this->getOrderIdentifiersStatusRequest($campaign_id, $order_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrderIdentifiersStatus' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderIdentifiersStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrderIdentifiersStatusRequest($campaign_id, $order_id, string $contentType = self::contentTypes['getOrderIdentifiersStatus'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrderIdentifiersStatus' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.getOrderIdentifiersStatus, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderIdentifiersStatus' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrders + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function getOrders($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + list($response) = $this->getOrdersWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getOrdersWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetOrdersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOrdersWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetOrdersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrdersAsync + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsync($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + return $this->getOrdersAsyncWithHttpInfo($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrdersAsyncWithHttpInfo + * + * Информация о заказах в магазине + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOrdersAsyncWithHttpInfo($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetOrdersResponse'; + $request = $this->getOrdersRequest($campaign_id, $order_ids, $status, $substatus, $from_date, $to_date, $supplier_shipment_date_from, $supplier_shipment_date_to, $updated_at_from, $updated_at_to, $dispatch_type, $fake, $has_cis, $only_waiting_for_cancellation_approve, $only_estimated_delivery, $buyer_type, $page, $page_size, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrders' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $order_ids Фильтрация заказов по идентификаторам. <br><br> ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. (optional) + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $status Статус заказа: * `CANCELLED` — заказ отменен. * `DELIVERED` — заказ получен покупателем. * `DELIVERY` — заказ передан в службу доставки. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ находится в обработке. * `UNPAID` — заказ оформлен, но еще не оплачен (если выбрана оплата при оформлении). (optional) + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatus Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). Возможные значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * `SHIPPED` — заказ передан службе доставки. Возможные значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400 * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в ПВЗ. * `DELIVERY_SERVICE_UNDELIVERED` — служба доставки не смогла доставить заказ. * `CANCELLED_COURIER_NOT_FOUND` — не удалось найти курьера. * `USER_WANTS_TO_CHANGE_DELIVERY_DATE` — покупатель хочет получить заказ в другой день. * `RESERVATION_FAILED` — Маркет не может продолжить дальнейшую обработку заказа. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации заказов по дате оформления. Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `toDate`) должно быть не больше 30 дней. Значение по умолчанию: 30 дней назад от текущей даты. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации заказов по дате оформления. Показываются заказы, созданные до 00:00 указанного дня. Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `fromDate`) и конечной датой должно быть не больше 30 дней. Значение по умолчанию: текущая дата. Если промежуток времени между `toDate` и `fromDate` меньше суток, то `toDate` равен `fromDate` + сутки. (optional) + * @param \DateTime|null $supplier_shipment_date_from Начальная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной и конечной датой (параметр `supplierShipmentDateTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $supplier_shipment_date_to Конечная дата для фильтрации заказов по дате отгрузки в службу доставки (параметр `shipmentDate`). Формат даты: `ДД-ММ-ГГГГ`. Между начальной (параметр `supplierShipmentDateFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. Если промежуток времени между `supplierShipmentDateTo` и `supplierShipmentDateFrom` меньше суток, то `supplierShipmentDateTo` равен `supplierShipmentDateFrom` + сутки. (optional) + * @param \DateTime|null $updated_at_from Начальная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной и конечной датой (параметр `updatedAtTo`) должно быть не больше 30 дней. Начальная дата включается в интервал для фильтрации. (optional) + * @param \DateTime|null $updated_at_to Конечная дата для фильтрации заказов по дате и времени обновления (параметр `updatedAt`). Формат даты: ISO 8601 со смещением относительно UTC. Например, `2017-11-21T00:42:42+03:00`. Между начальной (параметр `updatedAtFrom`) и конечной датой должно быть не больше 30 дней. Конечная дата не включается в интервал для фильтрации. (optional) + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type Способ отгрузки (optional) + * @param bool|null $fake Фильтрация заказов по типам: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. (optional, default to false) + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. (optional, default to false) + * @param bool|null $only_waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым был запрос на отмену. При значении `true` возвращаются только заказы, которые находятся в статусе `DELIVERY` или `PICKUP` и которые пользователи решили отменить. Чтобы подтвердить или отклонить отмену, отправьте запрос [PUT v2/campaigns/{campaignId}/orders/{orderId}/cancellation/accept](../../reference/orders/acceptOrderCancellation). (optional, default to false) + * @param bool|null $only_estimated_delivery Фильтрация заказов с долгой доставкой (31-60 дней) по подтвержденной дате доставки: * `true` — возвращаются только заказы с неподтвержденной датой доставки. * `false` — фильтрация не применяется. (optional, default to false) + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type Фильтрация заказов по типу покупателя. (optional) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrders'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOrdersRequest($campaign_id, $order_ids = null, $status = null, $substatus = null, $from_date = null, $to_date = null, $supplier_shipment_date_from = null, $supplier_shipment_date_to = null, $updated_at_from = null, $updated_at_to = null, $dispatch_type = null, $fake = false, $has_cis = false, $only_waiting_for_cancellation_approve = false, $only_estimated_delivery = false, $buyer_type = null, $page = 1, $page_size = null, $page_token = null, $limit = null, string $contentType = self::contentTypes['getOrders'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getOrders' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.getOrders, must be bigger than or equal to 1.'); + } + + if ($order_ids !== null && count($order_ids) > 50) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling OrdersApi.getOrders, number of items must be less than or equal to 50.'); + } + if ($order_ids !== null && count($order_ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$order_ids" when calling OrdersApi.getOrders, number of items must be greater than or equal to 1.'); + } + + + + + + + + + + + + + + + + if ($page !== null && $page > 10000) { + throw new \InvalidArgumentException('invalid value for "$page" when calling OrdersApi.getOrders, must be smaller than or equal to 10000.'); + } + + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OrdersApi.getOrders, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( @@ -2031,7 +2364,410 @@ class OrdersApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation provideOrderDigitalCodes + * + * Передача ключей цифровых товаров + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request provide_order_digital_codes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function provideOrderDigitalCodes($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + { + list($response) = $this->provideOrderDigitalCodesWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + return $response; + } + + /** + * Operation provideOrderDigitalCodesWithHttpInfo + * + * Передача ключей цифровых товаров + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function provideOrderDigitalCodesWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + { + $request = $this->provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\EmptyApiResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation provideOrderDigitalCodesAsync + * + * Передача ключей цифровых товаров + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function provideOrderDigitalCodesAsync($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + { + return $this->provideOrderDigitalCodesAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation provideOrderDigitalCodesAsyncWithHttpInfo + * + * Передача ключей цифровых товаров + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function provideOrderDigitalCodesAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'provideOrderDigitalCodes' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int $order_id Идентификатор заказа. (required) + * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling provideOrderDigitalCodes' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.provideOrderDigitalCodes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling provideOrderDigitalCodes' + ); + } + + // verify the required parameter 'provide_order_digital_codes_request' is set + if ($provide_order_digital_codes_request === null || (is_array($provide_order_digital_codes_request) && count($provide_order_digital_codes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $provide_order_digital_codes_request when calling provideOrderDigitalCodes' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/deliverDigitalGoods'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'orderId' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($provide_order_digital_codes_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_digital_codes_request)); + } else { + $httpBody = $provide_order_digital_codes_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2079,7 +2815,7 @@ class OrdersApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2087,42 +2823,42 @@ class OrdersApi } /** - * Operation provideOrderDigitalCodes + * Operation provideOrderItemIdentifiers * - * Передача ключей цифровых товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function provideOrderDigitalCodes($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + public function provideOrderItemIdentifiers($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - list($response) = $this->provideOrderDigitalCodesWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + list($response) = $this->provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $response; } /** - * Operation provideOrderDigitalCodesWithHttpInfo + * Operation provideOrderItemIdentifiersWithHttpInfo * - * Передача ключей цифровых товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function provideOrderDigitalCodesWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + public function provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $request = $this->provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2149,196 +2885,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2352,44 +2943,21 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\EmptyApiResponse', + '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2397,7 +2965,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2405,7 +2973,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2413,7 +2981,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2421,7 +2989,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2429,7 +2997,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2437,28 +3005,30 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation provideOrderDigitalCodesAsync + * Operation provideOrderItemIdentifiersAsync * - * Передача ключей цифровых товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderDigitalCodesAsync($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + public function provideOrderItemIdentifiersAsync($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - return $this->provideOrderDigitalCodesAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType) + return $this->provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2467,22 +3037,22 @@ class OrdersApi } /** - * Operation provideOrderDigitalCodesAsyncWithHttpInfo + * Operation provideOrderItemIdentifiersAsyncWithHttpInfo * - * Передача ключей цифровых товаров + * Передача кодов маркировки единиц товара * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderDigitalCodesAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + public function provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, $contentType); + $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; + $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2521,45 +3091,45 @@ class OrdersApi } /** - * Create request for operation 'provideOrderDigitalCodes' + * Create request for operation 'provideOrderItemIdentifiers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderDigitalCodesRequest $provide_order_digital_codes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderDigitalCodes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function provideOrderDigitalCodesRequest($campaign_id, $order_id, $provide_order_digital_codes_request, string $contentType = self::contentTypes['provideOrderDigitalCodes'][0]) + public function provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling provideOrderDigitalCodes' + 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.provideOrderDigitalCodes, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.provideOrderItemIdentifiers, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling provideOrderDigitalCodes' + 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers' ); } - // verify the required parameter 'provide_order_digital_codes_request' is set - if ($provide_order_digital_codes_request === null || (is_array($provide_order_digital_codes_request) && count($provide_order_digital_codes_request) === 0)) { + // verify the required parameter 'provide_order_item_identifiers_request' is set + if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $provide_order_digital_codes_request when calling provideOrderDigitalCodes' + 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/deliverDigitalGoods'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/identifiers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2593,12 +3163,12 @@ class OrdersApi ); // for model (json/xml) - if (isset($provide_order_digital_codes_request)) { + if (isset($provide_order_item_identifiers_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_digital_codes_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_item_identifiers_request)); } else { - $httpBody = $provide_order_digital_codes_request; + $httpBody = $provide_order_item_identifiers_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2648,7 +3218,7 @@ class OrdersApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2656,42 +3226,42 @@ class OrdersApi } /** - * Operation provideOrderItemIdentifiers + * Operation setOrderBoxLayout * - * Передача кодов маркировки единиц товара + * Подготовка заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function provideOrderItemIdentifiers($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) + public function setOrderBoxLayout($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - list($response) = $this->provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + list($response) = $this->setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $response; } /** - * Operation provideOrderItemIdentifiersWithHttpInfo + * Operation setOrderBoxLayoutWithHttpInfo * - * Передача кодов маркировки единиц товара + * Подготовка заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function provideOrderItemIdentifiersWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) + public function setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2718,196 +3288,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2921,44 +3346,21 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse', + '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2966,7 +3368,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2974,7 +3376,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2982,7 +3384,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2990,7 +3392,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2998,7 +3400,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3006,28 +3408,30 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation provideOrderItemIdentifiersAsync + * Operation setOrderBoxLayoutAsync * - * Передача кодов маркировки единиц товара + * Подготовка заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiersAsync($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) + public function setOrderBoxLayoutAsync($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - return $this->provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType) + return $this->setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3036,22 +3440,22 @@ class OrdersApi } /** - * Operation provideOrderItemIdentifiersAsyncWithHttpInfo + * Operation setOrderBoxLayoutAsyncWithHttpInfo * - * Передача кодов маркировки единиц товара + * Подготовка заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function provideOrderItemIdentifiersAsyncWithHttpInfo($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) + public function setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { - $returnType = '\OpenAPI\Client\Model\ProvideOrderItemIdentifiersResponse'; - $request = $this->provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; + $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3090,45 +3494,45 @@ class OrdersApi } /** - * Create request for operation 'provideOrderItemIdentifiers' + * Create request for operation 'setOrderBoxLayout' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\ProvideOrderItemIdentifiersRequest $provide_order_item_identifiers_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['provideOrderItemIdentifiers'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function provideOrderItemIdentifiersRequest($campaign_id, $order_id, $provide_order_item_identifiers_request, string $contentType = self::contentTypes['provideOrderItemIdentifiers'][0]) + public function setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling provideOrderItemIdentifiers' + 'Missing the required parameter $campaign_id when calling setOrderBoxLayout' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.provideOrderItemIdentifiers, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.setOrderBoxLayout, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling provideOrderItemIdentifiers' + 'Missing the required parameter $order_id when calling setOrderBoxLayout' ); } - // verify the required parameter 'provide_order_item_identifiers_request' is set - if ($provide_order_item_identifiers_request === null || (is_array($provide_order_item_identifiers_request) && count($provide_order_item_identifiers_request) === 0)) { + // verify the required parameter 'set_order_box_layout_request' is set + if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $provide_order_item_identifiers_request when calling provideOrderItemIdentifiers' + 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/identifiers'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3162,12 +3566,12 @@ class OrdersApi ); // for model (json/xml) - if (isset($provide_order_item_identifiers_request)) { + if (isset($set_order_box_layout_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($provide_order_item_identifiers_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); } else { - $httpBody = $provide_order_item_identifiers_request; + $httpBody = $set_order_box_layout_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3225,42 +3629,46 @@ class OrdersApi } /** - * Operation setOrderBoxLayout + * Operation setOrderShipmentBoxes * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function setOrderBoxLayout($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) + public function setOrderShipmentBoxes($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - list($response) = $this->setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + list($response) = $this->setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $response; } /** - * Operation setOrderBoxLayoutWithHttpInfo + * Operation setOrderShipmentBoxesWithHttpInfo * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderBoxLayoutResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function setOrderBoxLayoutWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) + public function setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3285,198 +3693,53 @@ class OrdersApi $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderBoxLayoutResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3490,44 +3753,21 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse', + '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3535,7 +3775,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3543,7 +3783,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3551,7 +3791,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3559,7 +3799,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3567,7 +3807,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3575,28 +3815,32 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderBoxLayoutAsync + * Operation setOrderShipmentBoxesAsync * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function setOrderBoxLayoutAsync($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) + public function setOrderShipmentBoxesAsync($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - return $this->setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, $contentType) + return $this->setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3605,22 +3849,24 @@ class OrdersApi } /** - * Operation setOrderBoxLayoutAsyncWithHttpInfo + * Operation setOrderShipmentBoxesAsyncWithHttpInfo * - * Подготовка заказа + * Передача количества грузовых мест в заказе * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function setOrderBoxLayoutAsyncWithHttpInfo($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) + public function setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderBoxLayoutResponse'; - $request = $this->setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, $contentType); + $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; + $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3659,45 +3905,54 @@ class OrdersApi } /** - * Create request for operation 'setOrderBoxLayout' + * Create request for operation 'setOrderShipmentBoxes' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param \OpenAPI\Client\Model\SetOrderBoxLayoutRequest $set_order_box_layout_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderBoxLayout'] to see the possible values for this operation + * @param int $shipment_id { % note warning \"Параметр больше не используется\" % } Передайте любое число, чтобы получился корректный URL. { % endnote % } Идентификатор грузового места. (required) + * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function setOrderBoxLayoutRequest($campaign_id, $order_id, $set_order_box_layout_request, string $contentType = self::contentTypes['setOrderBoxLayout'][0]) + public function setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderBoxLayout' + 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.setOrderBoxLayout, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.setOrderShipmentBoxes, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderBoxLayout' + 'Missing the required parameter $order_id when calling setOrderShipmentBoxes' ); } - // verify the required parameter 'set_order_box_layout_request' is set - if ($set_order_box_layout_request === null || (is_array($set_order_box_layout_request) && count($set_order_box_layout_request) === 0)) { + // verify the required parameter 'shipment_id' is set + if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_box_layout_request when calling setOrderBoxLayout' + 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes' + ); + } + + // verify the required parameter 'set_order_shipment_boxes_request' is set + if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/boxes'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3722,6 +3977,14 @@ class OrdersApi $resourcePath ); } + // path params + if ($shipment_id !== null) { + $resourcePath = str_replace( + '{' . 'shipmentId' . '}', + ObjectSerializer::toPathValue($shipment_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -3731,12 +3994,12 @@ class OrdersApi ); // for model (json/xml) - if (isset($set_order_box_layout_request)) { + if (isset($set_order_shipment_boxes_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_box_layout_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); } else { - $httpBody = $set_order_box_layout_request; + $httpBody = $set_order_shipment_boxes_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3794,44 +4057,42 @@ class OrdersApi } /** - * Operation setOrderShipmentBoxes + * Operation updateExternalOrderId * - * Передача количества грузовых мест в заказе + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function setOrderShipmentBoxes($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) + public function updateExternalOrderId($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - list($response) = $this->setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + list($response) = $this->updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $response; } /** - * Operation setOrderShipmentBoxesWithHttpInfo + * Operation updateExternalOrderIdWithHttpInfo * - * Передача количества грузовых мест в заказе + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SetOrderShipmentBoxesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function setOrderShipmentBoxesWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) + public function updateExternalOrderIdWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3858,196 +4119,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4061,44 +4177,21 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse', + '\OpenAPI\Client\Model\EmptyApiResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4106,7 +4199,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4114,7 +4207,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4122,7 +4215,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4130,7 +4223,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4138,7 +4231,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4146,29 +4239,30 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation setOrderShipmentBoxesAsync + * Operation updateExternalOrderIdAsync * - * Передача количества грузовых мест в заказе + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxesAsync($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) + public function updateExternalOrderIdAsync($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - return $this->setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType) + return $this->updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4177,23 +4271,22 @@ class OrdersApi } /** - * Operation setOrderShipmentBoxesAsyncWithHttpInfo + * Operation updateExternalOrderIdAsyncWithHttpInfo * - * Передача количества грузовых мест в заказе + * Передача внешнего идентификатора заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setOrderShipmentBoxesAsyncWithHttpInfo($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) + public function updateExternalOrderIdAsyncWithHttpInfo($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { - $returnType = '\OpenAPI\Client\Model\SetOrderShipmentBoxesResponse'; - $request = $this->setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, $contentType); + $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; + $request = $this->updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4232,53 +4325,45 @@ class OrdersApi } /** - * Create request for operation 'setOrderShipmentBoxes' + * Create request for operation 'updateExternalOrderId' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $shipment_id Параметр больше не используется. Вставьте любое число — просто чтобы получился корректный URL. (required) - * @param \OpenAPI\Client\Model\SetOrderShipmentBoxesRequest $set_order_shipment_boxes_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setOrderShipmentBoxes'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\UpdateExternalOrderIdRequest $update_external_order_id_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateExternalOrderId'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setOrderShipmentBoxesRequest($campaign_id, $order_id, $shipment_id, $set_order_shipment_boxes_request, string $contentType = self::contentTypes['setOrderShipmentBoxes'][0]) + public function updateExternalOrderIdRequest($campaign_id, $order_id, $update_external_order_id_request, string $contentType = self::contentTypes['updateExternalOrderId'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling setOrderShipmentBoxes' + 'Missing the required parameter $campaign_id when calling updateExternalOrderId' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.setOrderShipmentBoxes, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling OrdersApi.updateExternalOrderId, must be bigger than or equal to 1.'); } // verify the required parameter 'order_id' is set if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling setOrderShipmentBoxes' - ); - } - - // verify the required parameter 'shipment_id' is set - if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $shipment_id when calling setOrderShipmentBoxes' + 'Missing the required parameter $order_id when calling updateExternalOrderId' ); } - // verify the required parameter 'set_order_shipment_boxes_request' is set - if ($set_order_shipment_boxes_request === null || (is_array($set_order_shipment_boxes_request) && count($set_order_shipment_boxes_request) === 0)) { + // verify the required parameter 'update_external_order_id_request' is set + if ($update_external_order_id_request === null || (is_array($update_external_order_id_request) && count($update_external_order_id_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $set_order_shipment_boxes_request when calling setOrderShipmentBoxes' + 'Missing the required parameter $update_external_order_id_request when calling updateExternalOrderId' ); } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/external-id'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4303,14 +4388,6 @@ class OrdersApi $resourcePath ); } - // path params - if ($shipment_id !== null) { - $resourcePath = str_replace( - '{' . 'shipmentId' . '}', - ObjectSerializer::toPathValue($shipment_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -4320,12 +4397,12 @@ class OrdersApi ); // for model (json/xml) - if (isset($set_order_shipment_boxes_request)) { + if (isset($update_external_order_id_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_order_shipment_boxes_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_external_order_id_request)); } else { - $httpBody = $set_order_shipment_boxes_request; + $httpBody = $update_external_order_id_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4375,7 +4452,7 @@ class OrdersApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4385,9 +4462,9 @@ class OrdersApi /** * Operation updateOrderItems * - * Удаление товара из заказа или уменьшение числа единиц + * Удаление товаров из заказа или уменьшение их числа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request update_order_item_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation @@ -4404,9 +4481,9 @@ class OrdersApi /** * Operation updateOrderItemsWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Удаление товаров из заказа или уменьшение их числа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation @@ -4443,7 +4520,6 @@ class OrdersApi return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { case 400: @@ -4453,7 +4529,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4461,7 +4537,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4469,7 +4545,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4477,7 +4553,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4485,7 +4561,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4493,8 +4569,10 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -4502,9 +4580,9 @@ class OrdersApi /** * Operation updateOrderItemsAsync * - * Удаление товара из заказа или уменьшение числа единиц + * Удаление товаров из заказа или уменьшение их числа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation @@ -4525,9 +4603,9 @@ class OrdersApi /** * Operation updateOrderItemsAsyncWithHttpInfo * - * Удаление товара из заказа или уменьшение числа единиц + * Удаление товаров из заказа или уменьшение их числа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation @@ -4566,7 +4644,7 @@ class OrdersApi /** * Create request for operation 'updateOrderItems' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderItemRequest $update_order_item_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderItems'] to see the possible values for this operation @@ -4602,7 +4680,7 @@ class OrdersApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/items'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/items'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4703,7 +4781,7 @@ class OrdersApi * * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request update_order_status_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation @@ -4723,7 +4801,7 @@ class OrdersApi * * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation @@ -4761,196 +4839,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4964,34 +4897,11 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5001,7 +4911,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5009,7 +4919,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5017,7 +4927,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5025,7 +4935,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5033,7 +4943,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5041,7 +4951,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5049,8 +4959,10 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -5060,7 +4972,7 @@ class OrdersApi * * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation @@ -5083,7 +4995,7 @@ class OrdersApi * * Изменение статуса одного заказа * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation @@ -5135,7 +5047,7 @@ class OrdersApi /** * Create request for operation 'updateOrderStatus' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusRequest $update_order_status_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatus'] to see the possible values for this operation @@ -5171,7 +5083,7 @@ class OrdersApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/status'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5272,7 +5184,7 @@ class OrdersApi * * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request update_order_statuses_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * @@ -5291,7 +5203,7 @@ class OrdersApi * * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * @@ -5328,196 +5240,51 @@ class OrdersApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdateOrderStatusesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5531,34 +5298,11 @@ class OrdersApi ); } - $returnType = '\OpenAPI\Client\Model\UpdateOrderStatusesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateOrderStatusesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5568,7 +5312,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5576,7 +5320,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5584,7 +5328,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5592,7 +5336,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5600,7 +5344,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5608,7 +5352,7 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5616,8 +5360,10 @@ class OrdersApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -5627,7 +5373,7 @@ class OrdersApi * * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * @@ -5649,7 +5395,7 @@ class OrdersApi * * Изменение статусов нескольких заказов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * @@ -5700,7 +5446,7 @@ class OrdersApi /** * Create request for operation 'updateOrderStatuses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOrderStatusesRequest $update_order_statuses_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOrderStatuses'] to see the possible values for this operation * @@ -5728,7 +5474,7 @@ class OrdersApi } - $resourcePath = '/campaigns/{campaignId}/orders/status-update'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/status-update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5832,6 +5578,57 @@ class OrdersApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OrdersStatsApi.php b/erp24/lib/yandex_market_api/Api/OrdersStatsApi.php index 1c0020d1..5de40a3b 100644 --- a/erp24/lib/yandex_market_api/Api/OrdersStatsApi.php +++ b/erp24/lib/yandex_market_api/Api/OrdersStatsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -127,10 +130,10 @@ class OrdersStatsApi * * Детальная информация по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request get_orders_stats_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request get_orders_stats_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -148,10 +151,10 @@ class OrdersStatsApi * * Детальная информация по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -187,196 +190,51 @@ class OrdersStatsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOrdersStatsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersStatsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -390,34 +248,11 @@ class OrdersStatsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOrdersStatsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOrdersStatsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -427,7 +262,7 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -435,7 +270,7 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +278,7 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +286,7 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +294,7 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +302,7 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,8 +310,10 @@ class OrdersStatsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -486,10 +323,10 @@ class OrdersStatsApi * * Детальная информация по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -510,10 +347,10 @@ class OrdersStatsApi * * Детальная информация по заказам * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -563,10 +400,10 @@ class OrdersStatsApi /** * Create request for operation 'getOrdersStats' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetOrdersStatsRequest $get_orders_stats_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetOrdersStatsRequest|null $get_orders_stats_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrdersStats'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -586,10 +423,13 @@ class OrdersStatsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OrdersStatsApi.getOrdersStats, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/stats/orders'; + $resourcePath = '/v2/campaigns/{campaignId}/stats/orders'; $formParams = []; $queryParams = []; $headerParams = []; @@ -711,6 +551,57 @@ class OrdersStatsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OutletLicensesApi.php b/erp24/lib/yandex_market_api/Api/OutletLicensesApi.php index 681939b3..5c9e95f0 100644 --- a/erp24/lib/yandex_market_api/Api/OutletLicensesApi.php +++ b/erp24/lib/yandex_market_api/Api/OutletLicensesApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -133,7 +136,7 @@ class OutletLicensesApi * * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабÐ¸Ð½ÐµÑ‚е продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int[] $ids Список идентификаторов лицензий для удаления. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * @@ -152,7 +155,7 @@ class OutletLicensesApi * * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int[] $ids Список идентификаторов лицензий для удаления. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * @@ -189,196 +192,51 @@ class OutletLicensesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -392,34 +250,11 @@ class OutletLicensesApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -429,7 +264,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -437,7 +272,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -445,7 +280,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -453,7 +288,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -461,7 +296,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -469,7 +304,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -477,8 +312,10 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -488,7 +325,7 @@ class OutletLicensesApi * * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int[] $ids Список идентификаторов лицензий для удаления. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * @@ -510,7 +347,7 @@ class OutletLicensesApi * * Удаление лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int[] $ids Список идентификаторов лицензий для удаления. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * @@ -561,7 +398,7 @@ class OutletLicensesApi /** * Create request for operation 'deleteOutletLicenses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int[] $ids Список идентификаторов лицензий для удаления. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutletLicenses'] to see the possible values for this operation * @@ -587,12 +424,15 @@ class OutletLicensesApi 'Missing the required parameter $ids when calling deleteOutletLicenses' ); } + if (count($ids) > 500) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling OutletLicensesApi.deleteOutletLicenses, number of items must be less than or equal to 500.'); + } if (count($ids) < 1) { throw new \InvalidArgumentException('invalid value for "$ids" when calling OutletLicensesApi.deleteOutletLicenses, number of items must be greater than or equal to 1.'); } - $resourcePath = '/campaigns/{campaignId}/outlets/licenses'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/licenses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -687,9 +527,9 @@ class OutletLicensesApi * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -707,9 +547,9 @@ class OutletLicensesApi * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -745,196 +585,51 @@ class OutletLicensesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOutletLicensesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOutletLicensesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOutletLicensesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletLicensesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -948,34 +643,11 @@ class OutletLicensesApi ); } - $returnType = '\OpenAPI\Client\Model\GetOutletLicensesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletLicensesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -985,7 +657,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -993,7 +665,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1001,7 +673,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1009,7 +681,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1017,7 +689,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1025,7 +697,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1033,8 +705,10 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1044,9 +718,9 @@ class OutletLicensesApi * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1067,9 +741,9 @@ class OutletLicensesApi * * Информация о лицензиях для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1119,9 +793,9 @@ class OutletLicensesApi /** * Create request for operation 'getOutletLicenses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int[] $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) - * @param int[] $ids Список идентификаторов лицензий. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int[]|null $outlet_ids Список идентификаторов точек продаж, для которых нужно получить информацию о лицензиях. Идентификаторы указываются через запятую. В запросе должен быть либо параметр `outletIds`, либо параметр `ids`. Запрос с обоими параметрами или без них приведет к ошибке. (optional) + * @param int[]|null $ids Список идентификаторов лицензий. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutletLicenses'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1147,9 +821,15 @@ class OutletLicensesApi throw new \InvalidArgumentException('invalid value for "$outlet_ids" when calling OutletLicensesApi.getOutletLicenses, number of items must be greater than or equal to 1.'); } + if ($ids !== null && count($ids) > 500) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling OutletLicensesApi.getOutletLicenses, number of items must be less than or equal to 500.'); + } + if ($ids !== null && count($ids) < 1) { + throw new \InvalidArgumentException('invalid value for "$ids" when calling OutletLicensesApi.getOutletLicenses, number of items must be greater than or equal to 1.'); + } - $resourcePath = '/campaigns/{campaignId}/outlets/licenses'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/licenses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1253,7 +933,7 @@ class OutletLicensesApi * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request update_outlet_license_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * @@ -1272,7 +952,7 @@ class OutletLicensesApi * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * @@ -1309,196 +989,51 @@ class OutletLicensesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1512,34 +1047,11 @@ class OutletLicensesApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1549,7 +1061,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1557,7 +1069,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1565,7 +1077,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1573,7 +1085,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1581,7 +1093,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1589,7 +1101,7 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1597,8 +1109,10 @@ class OutletLicensesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1608,7 +1122,7 @@ class OutletLicensesApi * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * @@ -1630,7 +1144,7 @@ class OutletLicensesApi * * Создание и изменение лицензий для точек продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * @@ -1681,7 +1195,7 @@ class OutletLicensesApi /** * Create request for operation 'updateOutletLicenses' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateOutletLicenseRequest $update_outlet_license_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutletLicenses'] to see the possible values for this operation * @@ -1709,7 +1223,7 @@ class OutletLicensesApi } - $resourcePath = '/campaigns/{campaignId}/outlets/licenses'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/licenses'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1813,6 +1327,57 @@ class OutletLicensesApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/OutletsApi.php b/erp24/lib/yandex_market_api/Api/OutletsApi.php index 5e3ad953..9e8085ec 100644 --- a/erp24/lib/yandex_market_api/Api/OutletsApi.php +++ b/erp24/lib/yandex_market_api/Api/OutletsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -139,7 +142,7 @@ class OutletsApi * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * @@ -158,7 +161,7 @@ class OutletsApi * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * @@ -195,196 +198,51 @@ class OutletsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CreateOutletResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CreateOutletResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateOutletResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateOutletResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -398,34 +256,11 @@ class OutletsApi ); } - $returnType = '\OpenAPI\Client\Model\CreateOutletResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CreateOutletResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -435,7 +270,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,7 +278,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -451,7 +286,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -459,7 +294,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +302,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,7 +310,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -483,8 +318,10 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -494,7 +331,7 @@ class OutletsApi * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * @@ -516,7 +353,7 @@ class OutletsApi * * Создание точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * @@ -567,7 +404,7 @@ class OutletsApi /** * Create request for operation 'createOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOutlet'] to see the possible values for this operation * @@ -595,7 +432,7 @@ class OutletsApi } - $resourcePath = '/campaigns/{campaignId}/outlets'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets'; $formParams = []; $queryParams = []; $headerParams = []; @@ -688,7 +525,7 @@ class OutletsApi * * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * @@ -707,7 +544,7 @@ class OutletsApi * * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * @@ -744,196 +581,51 @@ class OutletsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -947,34 +639,11 @@ class OutletsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -984,7 +653,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -992,7 +661,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1000,7 +669,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1008,7 +677,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1016,7 +685,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1024,7 +693,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1032,8 +701,10 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1043,7 +714,7 @@ class OutletsApi * * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * @@ -1065,7 +736,7 @@ class OutletsApi * * Удаление точки продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * @@ -1116,7 +787,7 @@ class OutletsApi /** * Create request for operation 'deleteOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOutlet'] to see the possible values for this operation * @@ -1147,7 +818,7 @@ class OutletsApi } - $resourcePath = '/campaigns/{campaignId}/outlets/{outletId}'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/{outletId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1241,7 +912,7 @@ class OutletsApi * * Информация об одной точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation * @@ -1260,7 +931,7 @@ class OutletsApi * * Информация об одной точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation * @@ -1297,196 +968,51 @@ class OutletsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOutletResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOutletResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOutletResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1500,34 +1026,11 @@ class OutletsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOutletResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1537,7 +1040,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1545,7 +1048,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1553,7 +1056,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1561,7 +1064,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1569,7 +1072,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1577,7 +1080,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1585,8 +1088,10 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1596,7 +1101,7 @@ class OutletsApi * * Информация об одной точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation * @@ -1618,7 +1123,7 @@ class OutletsApi * * Информация об одной точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation * @@ -1669,7 +1174,7 @@ class OutletsApi /** * Create request for operation 'getOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlet'] to see the possible values for this operation * @@ -1700,7 +1205,7 @@ class OutletsApi } - $resourcePath = '/campaigns/{campaignId}/outlets/{outletId}'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/{outletId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1794,20 +1299,21 @@ class OutletsApi * * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetOutletsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getOutlets($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) + public function getOutlets($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - list($response) = $this->getOutletsWithHttpInfo($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType); + list($response) = $this->getOutletsWithHttpInfo($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType); return $response; } @@ -1816,20 +1322,21 @@ class OutletsApi * * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetOutletsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOutletsWithHttpInfo($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) + public function getOutletsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - $request = $this->getOutletsRequest($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType); + $request = $this->getOutletsRequest($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType); try { $options = $this->createHttpClientOption(); @@ -1856,196 +1363,51 @@ class OutletsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetOutletsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetOutletsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOutletsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2059,34 +1421,11 @@ class OutletsApi ); } - $returnType = '\OpenAPI\Client\Model\GetOutletsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetOutletsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2096,7 +1435,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2104,7 +1443,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2112,7 +1451,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2120,7 +1459,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2128,7 +1467,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2136,7 +1475,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2144,8 +1483,10 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2155,19 +1496,20 @@ class OutletsApi * * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutletsAsync($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) + public function getOutletsAsync($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { - return $this->getOutletsAsyncWithHttpInfo($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType) + return $this->getOutletsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType) ->then( function ($response) { return $response[0]; @@ -2180,20 +1522,21 @@ class OutletsApi * * Информация о нескольких точках продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOutletsAsyncWithHttpInfo($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) + public function getOutletsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { $returnType = '\OpenAPI\Client\Model\GetOutletsResponse'; - $request = $this->getOutletsRequest($campaign_id, $page_token, $region_id, $shop_outlet_code, $region_id2, $contentType); + $request = $this->getOutletsRequest($campaign_id, $page_token, $limit, $region_id, $shop_outlet_code, $region_id2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2234,17 +1577,18 @@ class OutletsApi /** * Create request for operation 'getOutlets' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET regions](../../reference/regions/searchRegionsByName.md). (optional) - * @param string $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) - * @param int $region_id2 {% note warning \"\" %} Этот параметр устарел. Для указания региона используйте `region_id`. {% endnote %} (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int|null $region_id Идентификатор региона. Если задать идентификатор родительского региона любого уровня, в выходных данных будут отображены точки продаж всех дочерних регионов. Идентификатор региона можно получить c помощью метода [GET v2/regions](../../reference/regions/searchRegionsByName.md). (optional) + * @param string|null $shop_outlet_code Идентификатор точки продаж, присвоенный магазином. (optional) + * @param int|null $region_id2 {% note warning \"Вместо него используйте `region_id`.\" %}   {% endnote %} (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOutlets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOutletsRequest($campaign_id, $page_token = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) + public function getOutletsRequest($campaign_id, $page_token = null, $limit = null, $region_id = null, $shop_outlet_code = null, $region_id2 = null, string $contentType = self::contentTypes['getOutlets'][0]) { // verify the required parameter 'campaign_id' is set @@ -2258,11 +1602,15 @@ class OutletsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling OutletsApi.getOutlets, must be bigger than or equal to 1.'); + } + - $resourcePath = '/campaigns/{campaignId}/outlets'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2279,6 +1627,15 @@ class OutletsApi false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $region_id, 'region_id', // param base name @@ -2384,7 +1741,7 @@ class OutletsApi * * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation @@ -2404,7 +1761,7 @@ class OutletsApi * * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation @@ -2442,196 +1799,51 @@ class OutletsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2645,34 +1857,11 @@ class OutletsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2682,7 +1871,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2690,7 +1879,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2698,7 +1887,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2706,7 +1895,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2714,7 +1903,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2722,7 +1911,7 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2730,8 +1919,10 @@ class OutletsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2741,7 +1932,7 @@ class OutletsApi * * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation @@ -2764,7 +1955,7 @@ class OutletsApi * * Изменение информации о точке продаж * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation @@ -2816,7 +2007,7 @@ class OutletsApi /** * Create request for operation 'updateOutlet' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $outlet_id Идентификатор точки продаж. (required) * @param \OpenAPI\Client\Model\ChangeOutletRequest $change_outlet_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateOutlet'] to see the possible values for this operation @@ -2855,7 +2046,7 @@ class OutletsApi } - $resourcePath = '/campaigns/{campaignId}/outlets/{outletId}'; + $resourcePath = '/v2/campaigns/{campaignId}/outlets/{outletId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2967,6 +2158,57 @@ class OutletsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/PriceQuarantineApi.php b/erp24/lib/yandex_market_api/Api/PriceQuarantineApi.php index 1c7d20f6..dec1096e 100644 --- a/erp24/lib/yandex_market_api/Api/PriceQuarantineApi.php +++ b/erp24/lib/yandex_market_api/Api/PriceQuarantineApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -136,7 +139,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * @@ -155,7 +158,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * @@ -192,223 +195,57 @@ class PriceQuarantineApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -422,34 +259,11 @@ class PriceQuarantineApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -459,7 +273,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -467,7 +281,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -475,7 +289,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -483,7 +297,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -491,7 +305,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -499,7 +313,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -507,7 +321,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -515,8 +329,10 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -526,7 +342,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * @@ -548,7 +364,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * @@ -599,7 +415,7 @@ class PriceQuarantineApi /** * Create request for operation 'confirmBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmBusinessPrices'] to see the possible values for this operation * @@ -627,7 +443,7 @@ class PriceQuarantineApi } - $resourcePath = '/businesses/{businessId}/price-quarantine/confirm'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -720,7 +536,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * @@ -739,7 +555,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * @@ -776,223 +592,57 @@ class PriceQuarantineApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1006,34 +656,11 @@ class PriceQuarantineApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1043,7 +670,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1051,7 +678,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1059,7 +686,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1067,7 +694,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1075,7 +702,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1083,7 +710,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1091,7 +718,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1099,8 +726,10 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1110,7 +739,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * @@ -1132,7 +761,7 @@ class PriceQuarantineApi * * Удаление товара из карантина по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * @@ -1183,7 +812,7 @@ class PriceQuarantineApi /** * Create request for operation 'confirmCampaignPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\ConfirmPricesRequest $confirm_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmCampaignPrices'] to see the possible values for this operation * @@ -1211,7 +840,7 @@ class PriceQuarantineApi } - $resourcePath = '/campaigns/{campaignId}/price-quarantine/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1304,10 +933,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1325,10 +954,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1364,196 +993,51 @@ class PriceQuarantineApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1567,34 +1051,11 @@ class PriceQuarantineApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1604,7 +1065,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1612,7 +1073,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1620,7 +1081,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1628,7 +1089,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1636,7 +1097,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1644,7 +1105,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1652,8 +1113,10 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1663,10 +1126,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1687,10 +1150,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в кабинете * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1740,10 +1203,10 @@ class PriceQuarantineApi /** * Create request for operation 'getBusinessQuarantineOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBusinessQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1770,9 +1233,12 @@ class PriceQuarantineApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PriceQuarantineApi.getBusinessQuarantineOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/price-quarantine'; + $resourcePath = '/v2/businesses/{businessId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1883,10 +1349,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1904,10 +1370,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1943,196 +1409,51 @@ class PriceQuarantineApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQuarantineOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQuarantineOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2146,34 +1467,11 @@ class PriceQuarantineApi ); } - $returnType = '\OpenAPI\Client\Model\GetQuarantineOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQuarantineOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2183,7 +1481,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2191,7 +1489,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2199,7 +1497,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2207,7 +1505,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2215,7 +1513,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2223,7 +1521,7 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2231,8 +1529,10 @@ class PriceQuarantineApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2242,10 +1542,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2266,10 +1566,10 @@ class PriceQuarantineApi * * Список товаров, находящихся в карантине по цене в магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2319,10 +1619,10 @@ class PriceQuarantineApi /** * Create request for operation 'getCampaignQuarantineOffers' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\GetQuarantineOffersRequest $get_quarantine_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCampaignQuarantineOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2349,9 +1649,12 @@ class PriceQuarantineApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PriceQuarantineApi.getCampaignQuarantineOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/price-quarantine'; + $resourcePath = '/v2/campaigns/{campaignId}/price-quarantine'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2473,6 +1776,57 @@ class PriceQuarantineApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/PricesApi.php b/erp24/lib/yandex_market_api/Api/PricesApi.php index 7121a4b5..80fa796f 100644 --- a/erp24/lib/yandex_market_api/Api/PricesApi.php +++ b/erp24/lib/yandex_market_api/Api/PricesApi.php @@ -1,7 +1,7 @@ [ + 'getDefaultPrices' => [ 'application/json', ], - 'getPricesByOfferIds' => [ + 'getPrices' => [ 'application/json', ], - 'getSuggestedPrices' => [ + 'getPricesByOfferIds' => [ 'application/json', ], 'updateBusinessPrices' => [ @@ -95,10 +98,10 @@ class PricesApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -135,46 +138,44 @@ class PricesApi } /** - * Operation getPrices + * Operation getDefaultPrices * - * Список цен + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getPrices($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + public function getDefaultPrices($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - list($response) = $this->getPricesWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); + list($response) = $this->getDefaultPricesWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $response; } /** - * Operation getPricesWithHttpInfo + * Operation getDefaultPricesWithHttpInfo * - * Список цен + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetDefaultPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getPricesWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + public function getDefaultPricesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -201,196 +202,51 @@ class PricesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -404,44 +260,21 @@ class PricesApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetDefaultPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesResponse', + '\OpenAPI\Client\Model\GetDefaultPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -449,7 +282,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -457,7 +290,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -465,7 +298,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -473,7 +306,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -481,7 +314,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -489,30 +322,31 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPricesAsync + * Operation getDefaultPricesAsync * - * Список цен + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPricesAsync($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + public function getDefaultPricesAsync($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - return $this->getPricesAsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) + return $this->getDefaultPricesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_default_prices_request, $contentType) ->then( function ($response) { return $response[0]; @@ -521,24 +355,23 @@ class PricesApi } /** - * Operation getPricesAsyncWithHttpInfo + * Operation getDefaultPricesAsyncWithHttpInfo * - * Список цен + * Просмотр цен на указанные товары во всех магазинах * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getPricesAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + public function getDefaultPricesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; - $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); + $returnType = '\OpenAPI\Client\Model\GetDefaultPricesResponse'; + $request = $this->getDefaultPricesRequest($business_id, $page_token, $limit, $get_default_prices_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -577,36 +410,38 @@ class PricesApi } /** - * Create request for operation 'getPrices' + * Create request for operation 'getDefaultPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param bool $archived Фильтр по нахождению в архиве. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetDefaultPricesRequest|null $get_default_prices_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDefaultPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getPricesRequest($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) + public function getDefaultPricesRequest($business_id, $page_token = null, $limit = null, $get_default_prices_request = null, string $contentType = self::contentTypes['getDefaultPrices'][0]) { - // verify the required parameter 'campaign_id' is set - if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPrices' + 'Missing the required parameter $business_id when calling getDefaultPrices' ); } - if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling PricesApi.getPrices, must be bigger than or equal to 1.'); + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling PricesApi.getDefaultPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PricesApi.getDefaultPrices, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -631,22 +466,13 @@ class PricesApi false, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $archived, - 'archived', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); // path params - if ($campaign_id !== null) { + if ($business_id !== null) { $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaign_id), + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), $resourcePath ); } @@ -659,7 +485,14 @@ class PricesApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_default_prices_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_default_prices_request)); + } else { + $httpBody = $get_default_prices_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -707,7 +540,7 @@ class PricesApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -715,44 +548,46 @@ class PricesApi } /** - * Operation getPricesByOfferIds + * Operation getPrices * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + public function getPrices($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + list($response) = $this->getPricesWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType); return $response; } /** - * Operation getPricesByOfferIdsWithHttpInfo + * Operation getPricesWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ - public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + public function getPricesWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); try { $options = $this->createHttpClientOption(); @@ -779,196 +614,51 @@ class PricesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPricesByOfferIdsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -982,44 +672,21 @@ class PricesApi ); } - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + '\OpenAPI\Client\Model\GetPricesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1027,7 +694,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1035,7 +702,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1043,7 +710,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1051,7 +718,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1059,7 +726,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1067,29 +734,32 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getPricesByOfferIdsAsync + * Operation getPricesAsync * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + public function getPricesAsync($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) + return $this->getPricesAsyncWithHttpInfo($campaign_id, $page_token, $limit, $archived, $contentType) ->then( function ($response) { return $response[0]; @@ -1098,23 +768,24 @@ class PricesApi } /** - * Operation getPricesByOfferIdsAsyncWithHttpInfo + * Operation getPricesAsyncWithHttpInfo * - * Просмотр цен на указанные товары в магазине + * Список цен * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ - public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + public function getPricesAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { - $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; - $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPricesResponse'; + $request = $this->getPricesRequest($campaign_id, $page_token, $limit, $archived, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1153,35 +824,39 @@ class PricesApi } /** - * Create request for operation 'getPricesByOfferIds' + * Create request for operation 'getPrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest $get_prices_by_offer_ids_request (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param bool|null $archived Фильтр по нахождению в архиве. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPrices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ - public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) + public function getPricesRequest($campaign_id, $page_token = null, $limit = null, $archived = false, string $contentType = self::contentTypes['getPrices'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' + 'Missing the required parameter $campaign_id when calling getPrices' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling PricesApi.getPricesByOfferIds, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling PricesApi.getPrices, must be bigger than or equal to 1.'); } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PricesApi.getPrices, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offer-prices'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1206,6 +881,15 @@ class PricesApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $archived, + 'archived', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -1225,14 +909,7 @@ class PricesApi ); // for model (json/xml) - if (isset($get_prices_by_offer_ids_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); - } else { - $httpBody = $get_prices_by_offer_ids_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1280,7 +957,7 @@ class PricesApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1288,42 +965,44 @@ class PricesApi } /** - * Operation getSuggestedPrices + * Operation getPricesByOfferIds * - * Цены для продвижения товаров + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse - * @deprecated + * @return \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getSuggestedPrices($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices'][0]) + public function getPricesByOfferIds($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - list($response) = $this->getSuggestedPricesWithHttpInfo($campaign_id, $suggest_prices_request, $contentType); + list($response) = $this->getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); return $response; } /** - * Operation getSuggestedPricesWithHttpInfo + * Operation getPricesByOfferIdsWithHttpInfo * - * Цены для продвижения товаров + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SuggestPricesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of \OpenAPI\Client\Model\GetPricesByOfferIdsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getSuggestedPricesWithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices'][0]) + public function getPricesByOfferIdsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - $request = $this->getSuggestedPricesRequest($campaign_id, $suggest_prices_request, $contentType); + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1350,196 +1029,51 @@ class PricesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SuggestPricesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SuggestPricesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuggestPricesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1553,44 +1087,21 @@ class PricesApi ); } - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SuggestPricesResponse', + '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1598,7 +1109,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1606,7 +1117,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1614,7 +1125,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1622,7 +1133,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1630,7 +1141,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1638,28 +1149,31 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getSuggestedPricesAsync + * Operation getPricesByOfferIdsAsync * - * Цены для продвижения товаров + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedPricesAsync($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices'][0]) + public function getPricesByOfferIdsAsync($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - return $this->getSuggestedPricesAsyncWithHttpInfo($campaign_id, $suggest_prices_request, $contentType) + return $this->getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1668,22 +1182,23 @@ class PricesApi } /** - * Operation getSuggestedPricesAsyncWithHttpInfo + * Operation getPricesByOfferIdsAsyncWithHttpInfo * - * Цены для продвижения товаров + * Просмотр цен на указанные товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getSuggestedPricesAsyncWithHttpInfo($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices'][0]) + public function getPricesByOfferIdsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { - $returnType = '\OpenAPI\Client\Model\SuggestPricesResponse'; - $request = $this->getSuggestedPricesRequest($campaign_id, $suggest_prices_request, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPricesByOfferIdsResponse'; + $request = $this->getPricesByOfferIdsRequest($campaign_id, $page_token, $limit, $get_prices_by_offer_ids_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1722,44 +1237,62 @@ class PricesApi } /** - * Create request for operation 'getSuggestedPrices' + * Create request for operation 'getPricesByOfferIds' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\SuggestPricesRequest $suggest_prices_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSuggestedPrices'] to see the possible values for this operation + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPricesByOfferIdsRequest|null $get_prices_by_offer_ids_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPricesByOfferIds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getSuggestedPricesRequest($campaign_id, $suggest_prices_request, string $contentType = self::contentTypes['getSuggestedPrices'][0]) + public function getPricesByOfferIdsRequest($campaign_id, $page_token = null, $limit = null, $get_prices_by_offer_ids_request = null, string $contentType = self::contentTypes['getPricesByOfferIds'][0]) { // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaign_id when calling getSuggestedPrices' + 'Missing the required parameter $campaign_id when calling getPricesByOfferIds' ); } if ($campaign_id < 1) { - throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling PricesApi.getSuggestedPrices, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling PricesApi.getPricesByOfferIds, must be bigger than or equal to 1.'); } - // verify the required parameter 'suggest_prices_request' is set - if ($suggest_prices_request === null || (is_array($suggest_prices_request) && count($suggest_prices_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $suggest_prices_request when calling getSuggestedPrices' - ); + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PricesApi.getPricesByOfferIds, must be bigger than or equal to 1.'); } + - $resourcePath = '/campaigns/{campaignId}/offer-prices/suggestions'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -1779,12 +1312,12 @@ class PricesApi ); // for model (json/xml) - if (isset($suggest_prices_request)) { + if (isset($get_prices_by_offer_ids_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($suggest_prices_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_prices_by_offer_ids_request)); } else { - $httpBody = $suggest_prices_request; + $httpBody = $get_prices_by_offer_ids_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1844,9 +1377,9 @@ class PricesApi /** * Operation updateBusinessPrices * - * Установка цен на товары во всех магазинах + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request update_business_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * @@ -1863,9 +1396,9 @@ class PricesApi /** * Operation updateBusinessPricesWithHttpInfo * - * Установка цен на товары во всех магазинах + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * @@ -1902,223 +1435,57 @@ class PricesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2132,34 +1499,11 @@ class PricesApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2169,7 +1513,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2177,7 +1521,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2185,7 +1529,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2193,7 +1537,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2201,7 +1545,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2209,7 +1553,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2217,7 +1561,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2225,8 +1569,10 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2234,9 +1580,9 @@ class PricesApi /** * Operation updateBusinessPricesAsync * - * Установка цен на товары во всех магазинах + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * @@ -2256,9 +1602,9 @@ class PricesApi /** * Operation updateBusinessPricesAsyncWithHttpInfo * - * Установка цен на товары во всех магазинах + * Установка цен на товары для всех магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * @@ -2309,7 +1655,7 @@ class PricesApi /** * Create request for operation 'updateBusinessPrices' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdateBusinessPricesRequest $update_business_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBusinessPrices'] to see the possible values for this operation * @@ -2337,7 +1683,7 @@ class PricesApi } - $resourcePath = '/businesses/{businessId}/offer-prices/updates'; + $resourcePath = '/v2/businesses/{businessId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2430,7 +1776,7 @@ class PricesApi * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request update_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * @@ -2449,7 +1795,7 @@ class PricesApi * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * @@ -2486,223 +1832,57 @@ class PricesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 423: - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLockedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLockedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLockedErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2716,34 +1896,11 @@ class PricesApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2753,7 +1910,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2761,7 +1918,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2769,7 +1926,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2777,7 +1934,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2785,7 +1942,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2793,7 +1950,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 423: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2801,7 +1958,7 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2809,8 +1966,10 @@ class PricesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2820,7 +1979,7 @@ class PricesApi * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * @@ -2842,7 +2001,7 @@ class PricesApi * * Установка цен на товары в конкретном магазине * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * @@ -2893,7 +2052,7 @@ class PricesApi /** * Create request for operation 'updatePrices' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdatePricesRequest $update_prices_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePrices'] to see the possible values for this operation * @@ -2921,7 +2080,7 @@ class PricesApi } - $resourcePath = '/campaigns/{campaignId}/offer-prices/updates'; + $resourcePath = '/v2/campaigns/{campaignId}/offer-prices/updates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3025,6 +2184,57 @@ class PricesApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/PromosApi.php b/erp24/lib/yandex_market_api/Api/PromosApi.php index ee8fd668..6a13a175 100644 --- a/erp24/lib/yandex_market_api/Api/PromosApi.php +++ b/erp24/lib/yandex_market_api/Api/PromosApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -136,7 +139,7 @@ class PromosApi * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request delete_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * @@ -155,7 +158,7 @@ class PromosApi * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * @@ -192,196 +195,51 @@ class PromosApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\DeletePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\DeletePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -395,34 +253,11 @@ class PromosApi ); } - $returnType = '\OpenAPI\Client\Model\DeletePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\DeletePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -432,7 +267,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -440,7 +275,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -448,7 +283,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -456,7 +291,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -464,7 +299,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -472,7 +307,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -480,8 +315,10 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -491,7 +328,7 @@ class PromosApi * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * @@ -513,7 +350,7 @@ class PromosApi * * Удаление товаров из акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * @@ -564,7 +401,7 @@ class PromosApi /** * Create request for operation 'deletePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\DeletePromoOffersRequest $delete_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePromoOffers'] to see the possible values for this operation * @@ -592,7 +429,7 @@ class PromosApi } - $resourcePath = '/businesses/{businessId}/promos/offers/delete'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -685,10 +522,10 @@ class PromosApi * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -706,10 +543,10 @@ class PromosApi * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -745,196 +582,51 @@ class PromosApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -948,34 +640,11 @@ class PromosApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -985,7 +654,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -993,7 +662,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1001,7 +670,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1009,7 +678,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1017,7 +686,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1025,7 +694,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1033,8 +702,10 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1044,10 +715,10 @@ class PromosApi * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1068,10 +739,10 @@ class PromosApi * * Получение списка товаров, которые участвуют или могут участвовать в акции * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1121,10 +792,10 @@ class PromosApi /** * Create request for operation 'getPromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetPromoOffersRequest $get_promo_offers_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromoOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1151,9 +822,12 @@ class PromosApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PromosApi.getPromoOffers, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/businesses/{businessId}/promos/offers'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1264,8 +938,8 @@ class PromosApi * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request get_promos_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request get_promos_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1283,8 +957,8 @@ class PromosApi * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1320,196 +994,51 @@ class PromosApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetPromosResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetPromosResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetPromosResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1523,34 +1052,11 @@ class PromosApi ); } - $returnType = '\OpenAPI\Client\Model\GetPromosResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPromosResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1560,7 +1066,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1568,7 +1074,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1576,7 +1082,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1584,7 +1090,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1592,7 +1098,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1600,7 +1106,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1608,8 +1114,10 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1619,8 +1127,8 @@ class PromosApi * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1641,8 +1149,8 @@ class PromosApi * * Получение списка акций * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1692,8 +1200,8 @@ class PromosApi /** * Create request for operation 'getPromos' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param \OpenAPI\Client\Model\GetPromosRequest $get_promos_request (optional) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param \OpenAPI\Client\Model\GetPromosRequest|null $get_promos_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPromos'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1714,7 +1222,7 @@ class PromosApi - $resourcePath = '/businesses/{businessId}/promos'; + $resourcePath = '/v2/businesses/{businessId}/promos'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1807,7 +1315,7 @@ class PromosApi * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request update_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * @@ -1826,7 +1334,7 @@ class PromosApi * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * @@ -1863,196 +1371,51 @@ class PromosApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\UpdatePromoOffersResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\UpdatePromoOffersResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2066,34 +1429,11 @@ class PromosApi ); } - $returnType = '\OpenAPI\Client\Model\UpdatePromoOffersResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdatePromoOffersResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2103,7 +1443,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2111,7 +1451,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2119,7 +1459,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2127,7 +1467,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2135,7 +1475,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2143,7 +1483,7 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2151,8 +1491,10 @@ class PromosApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2162,7 +1504,7 @@ class PromosApi * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * @@ -2184,7 +1526,7 @@ class PromosApi * * Добавление товаров в акцию или изменение их цен * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * @@ -2235,7 +1577,7 @@ class PromosApi /** * Create request for operation 'updatePromoOffers' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\UpdatePromoOffersRequest $update_promo_offers_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoOffers'] to see the possible values for this operation * @@ -2263,7 +1605,7 @@ class PromosApi } - $resourcePath = '/businesses/{businessId}/promos/offers/update'; + $resourcePath = '/v2/businesses/{businessId}/promos/offers/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2367,6 +1709,57 @@ class PromosApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/RatingsApi.php b/erp24/lib/yandex_market_api/Api/RatingsApi.php index 2f838ab6..eda36a20 100644 --- a/erp24/lib/yandex_market_api/Api/RatingsApi.php +++ b/erp24/lib/yandex_market_api/Api/RatingsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -130,7 +133,7 @@ class RatingsApi * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -148,7 +151,7 @@ class RatingsApi * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -184,196 +187,51 @@ class RatingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingDetailsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -387,34 +245,11 @@ class RatingsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingDetailsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -424,7 +259,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -432,7 +267,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -440,7 +275,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -448,7 +283,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -456,7 +291,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -464,7 +299,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -472,8 +307,10 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -483,7 +320,7 @@ class RatingsApi * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -504,7 +341,7 @@ class RatingsApi * * Заказы, которые повлияли на индекс качества * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -554,7 +391,7 @@ class RatingsApi /** * Create request for operation 'getQualityRatingDetails' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatingDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -574,7 +411,7 @@ class RatingsApi } - $resourcePath = '/campaigns/{campaignId}/ratings/quality/details'; + $resourcePath = '/v2/campaigns/{campaignId}/ratings/quality/details'; $formParams = []; $queryParams = []; $headerParams = []; @@ -660,7 +497,7 @@ class RatingsApi * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request get_quality_rating_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * @@ -679,7 +516,7 @@ class RatingsApi * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * @@ -716,196 +553,51 @@ class RatingsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetQualityRatingResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetQualityRatingResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -919,34 +611,11 @@ class RatingsApi ); } - $returnType = '\OpenAPI\Client\Model\GetQualityRatingResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetQualityRatingResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -956,7 +625,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -964,7 +633,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -972,7 +641,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -980,7 +649,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -988,7 +657,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -996,7 +665,7 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1004,8 +673,10 @@ class RatingsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1015,7 +686,7 @@ class RatingsApi * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * @@ -1037,7 +708,7 @@ class RatingsApi * * Индекс качества магазинов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * @@ -1088,7 +759,7 @@ class RatingsApi /** * Create request for operation 'getQualityRatings' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) * @param \OpenAPI\Client\Model\GetQualityRatingRequest $get_quality_rating_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getQualityRatings'] to see the possible values for this operation * @@ -1116,7 +787,7 @@ class RatingsApi } - $resourcePath = '/businesses/{businessId}/ratings/quality'; + $resourcePath = '/v2/businesses/{businessId}/ratings/quality'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1220,6 +891,57 @@ class RatingsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/RegionsApi.php b/erp24/lib/yandex_market_api/Api/RegionsApi.php index abcfcfa5..ec757eea 100644 --- a/erp24/lib/yandex_market_api/Api/RegionsApi.php +++ b/erp24/lib/yandex_market_api/Api/RegionsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], 'searchRegionChildren' => [ 'application/json', ], @@ -89,10 +95,10 @@ class RegionsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -129,42 +135,36 @@ class RegionsApi } /** - * Operation searchRegionChildren + * Operation getRegionsCodes * - * Информация о дочерних регионах + * Список допустимых кодов стран * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + public function getRegionsCodes(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); + list($response) = $this->getRegionsCodesWithHttpInfo($contentType); return $response; } /** - * Operation searchRegionChildrenWithHttpInfo + * Operation getRegionsCodesWithHttpInfo * - * Информация о дочерних регионах + * Список допустимых кодов стран * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetRegionsCodesResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + public function getRegionsCodesWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) { - $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); + $request = $this->getRegionsCodesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -191,196 +191,384 @@ class RegionsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionWithChildrenResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetRegionsCodesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getRegionsCodesAsync + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsync(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + return $this->getRegionsCodesAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRegionsCodesAsyncWithHttpInfo + * + * Список допустимых кодов стран + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRegionsCodesAsyncWithHttpInfo(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetRegionsCodesResponse'; + $request = $this->getRegionsCodesRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } + if ($returnType !== 'string') { + $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRegionsCodes' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRegionsCodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRegionsCodesRequest(string $contentType = self::contentTypes['getRegionsCodes'][0]) + { + + + $resourcePath = '/v2/regions/countries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchRegionChildren + * + * Информация о дочерних регионах + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function searchRegionChildren($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + list($response) = $this->searchRegionChildrenWithHttpInfo($region_id, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation searchRegionChildrenWithHttpInfo + * + * Информация о дочерних регионах + * + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetRegionWithChildrenResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchRegionChildrenWithHttpInfo($region_id, $page = 1, $page_size = null, string $contentType = self::contentTypes['searchRegionChildren'][0]) + { + $request = $this->searchRegionChildrenRequest($region_id, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + $statusCode = $response->getStatusCode(); - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -394,34 +582,11 @@ class RegionsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionWithChildrenResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionWithChildrenResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -431,7 +596,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -439,7 +604,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -447,7 +612,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -455,7 +620,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -463,7 +628,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -471,7 +636,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -479,8 +644,10 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -490,9 +657,9 @@ class RegionsApi * * Информация о дочерних регионах * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -513,9 +680,9 @@ class RegionsApi * * Информация о дочерних регионах * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -565,9 +732,9 @@ class RegionsApi /** * Create request for operation 'searchRegionChildren' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) - * @param int $page Номер страницы результатов. Используется вместе с параметром `page_size`. `page_number` игнорируется, если задан `page_token`, `limit` или `offset`. (optional, default to 1) - * @param int $page_size Размер страницы. Используется вместе с параметром `page_number`. `page_size` игнорируется, если задан `page_token`, `limit` или `offset`. (optional) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int|null $page {% note warning \"Если в методе есть `page_token`\" %} Используйте его вместо параметра `page`. [Подробнее о типах пагинации и их использовании](../../concepts/pagination.md) {% endnote %} Номер страницы результатов. Используется вместе с параметром `pageSize`. `page` игнорируется, если задан `page_token` или `limit`. (optional, default to 1) + * @param int|null $page_size Размер страницы. Используется вместе с параметром `page`. `pageSize` игнорируется, если задан `page_token` или `limit`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionChildren'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -589,7 +756,7 @@ class RegionsApi - $resourcePath = '/regions/{regionId}/children'; + $resourcePath = '/v2/regions/{regionId}/children'; $formParams = []; $queryParams = []; $headerParams = []; @@ -693,7 +860,7 @@ class RegionsApi * * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -711,7 +878,7 @@ class RegionsApi * * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -747,169 +914,45 @@ class RegionsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -923,34 +966,11 @@ class RegionsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -960,7 +980,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -968,7 +988,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -976,7 +996,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -984,7 +1004,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -992,7 +1012,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1000,8 +1020,10 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1011,7 +1033,7 @@ class RegionsApi * * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1032,7 +1054,7 @@ class RegionsApi * * Информация о регионе * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1082,7 +1104,7 @@ class RegionsApi /** * Create request for operation 'searchRegionsById' * - * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). (required) + * @param int $region_id Идентификатор региона. Идентификатор региона можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1099,7 +1121,7 @@ class RegionsApi } - $resourcePath = '/regions/{regionId}'; + $resourcePath = '/v2/regions/{regionId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1186,8 +1208,8 @@ class RegionsApi * Поиск регионов по их имени * * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1206,8 +1228,8 @@ class RegionsApi * Поиск регионов по их имени * * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -1243,142 +1265,39 @@ class RegionsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetRegionsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetRegionsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetRegionsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1392,34 +1311,11 @@ class RegionsApi ); } - $returnType = '\OpenAPI\Client\Model\GetRegionsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetRegionsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1429,7 +1325,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1437,7 +1333,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1445,7 +1341,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1453,7 +1349,7 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1461,8 +1357,10 @@ class RegionsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1473,8 +1371,8 @@ class RegionsApi * Поиск регионов по их имени * * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1496,8 +1394,8 @@ class RegionsApi * Поиск регионов по их имени * * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1548,8 +1446,8 @@ class RegionsApi * Create request for operation 'searchRegionsByName' * * @param string $name Название региона. Важно учитывать регистр: первая буква должна быть заглавной, остальные — строчными. Например, `Москва`. (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchRegionsByName'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1566,9 +1464,12 @@ class RegionsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling RegionsApi.searchRegionsByName, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/regions'; + $resourcePath = '/v2/regions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1684,6 +1585,57 @@ class RegionsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/ReportsApi.php b/erp24/lib/yandex_market_api/Api/ReportsApi.php index 448ac311..f0524382 100644 --- a/erp24/lib/yandex_market_api/Api/ReportsApi.php +++ b/erp24/lib/yandex_market_api/Api/ReportsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'generateBarcodesReport' => [ + 'application/json', + ], 'generateBoostConsolidatedReport' => [ 'application/json', ], + 'generateClosureDocumentsDetalizationReport' => [ + 'application/json', + ], + 'generateClosureDocumentsReport' => [ + 'application/json', + ], 'generateCompetitorsPositionReport' => [ 'application/json', ], @@ -83,24 +98,39 @@ class ReportsApi 'generateGoodsMovementReport' => [ 'application/json', ], + 'generateGoodsPricesReport' => [ + 'application/json', + ], 'generateGoodsRealizationReport' => [ 'application/json', ], 'generateGoodsTurnoverReport' => [ 'application/json', ], + 'generateJewelryFiscalReport' => [ + 'application/json', + ], + 'generateKeyIndicatorsReport' => [ + 'application/json', + ], 'generateMassOrderLabelsReport' => [ 'application/json', ], 'generatePricesReport' => [ 'application/json', ], + 'generateSalesGeographyReport' => [ + 'application/json', + ], 'generateShelfsStatisticsReport' => [ 'application/json', ], 'generateShipmentListDocumentReport' => [ 'application/json', ], + 'generateShowsBoostReport' => [ + 'application/json', + ], 'generateShowsSalesReport' => [ 'application/json', ], @@ -116,6 +146,9 @@ class ReportsApi 'generateUnitedOrdersReport' => [ 'application/json', ], + 'generateUnitedReturnsReport' => [ + 'application/json', + ], 'getReportInfo' => [ 'application/json', ], @@ -128,10 +161,10 @@ class ReportsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -168,40 +201,40 @@ class ReportsApi } /** - * Operation generateBoostConsolidatedReport + * Operation generateBannersStatisticsReport * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateBoostConsolidatedReport($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) + public function generateBannersStatisticsReport($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - list($response) = $this->generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format, $contentType); + list($response) = $this->generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format, $contentType); return $response; } /** - * Operation generateBoostConsolidatedReportWithHttpInfo + * Operation generateBannersStatisticsReportWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) + public function generateBannersStatisticsReportWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -228,169 +261,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -404,34 +313,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -441,7 +327,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -449,7 +335,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -457,7 +343,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -465,7 +351,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -473,7 +359,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -481,27 +367,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateBoostConsolidatedReportAsync + * Operation generateBannersStatisticsReportAsync * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReportAsync($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) + public function generateBannersStatisticsReportAsync($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - return $this->generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) + return $this->generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -510,21 +398,21 @@ class ReportsApi } /** - * Operation generateBoostConsolidatedReportAsyncWithHttpInfo + * Operation generateBannersStatisticsReportAsyncWithHttpInfo * - * Отчет по бусту продаж + * Отчет по охватному продвижению * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) + public function generateBannersStatisticsReportAsyncWithHttpInfo($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); + $request = $this->generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -563,28 +451,28 @@ class ReportsApi } /** - * Create request for operation 'generateBoostConsolidatedReport' + * Create request for operation 'generateBannersStatisticsReport' * - * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBannersStatisticsRequest $generate_banners_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBannersStatisticsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) + public function generateBannersStatisticsReportRequest($generate_banners_statistics_request, $format = null, string $contentType = self::contentTypes['generateBannersStatisticsReport'][0]) { - // verify the required parameter 'generate_boost_consolidated_request' is set - if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { + // verify the required parameter 'generate_banners_statistics_request' is set + if ($generate_banners_statistics_request === null || (is_array($generate_banners_statistics_request) && count($generate_banners_statistics_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport' + 'Missing the required parameter $generate_banners_statistics_request when calling generateBannersStatisticsReport' ); } - $resourcePath = '/reports/boost-consolidated/generate'; + $resourcePath = '/v2/reports/banners-statistics/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -611,12 +499,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_boost_consolidated_request)) { + if (isset($generate_banners_statistics_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_banners_statistics_request)); } else { - $httpBody = $generate_boost_consolidated_request; + $httpBody = $generate_banners_statistics_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -674,40 +562,38 @@ class ReportsApi } /** - * Operation generateCompetitorsPositionReport + * Operation generateBarcodesReport * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateCompetitorsPositionReport($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) + public function generateBarcodesReport($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - list($response) = $this->generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format, $contentType); + list($response) = $this->generateBarcodesReportWithHttpInfo($generate_barcodes_report_request, $contentType); return $response; } /** - * Operation generateCompetitorsPositionReportWithHttpInfo + * Operation generateBarcodesReportWithHttpInfo * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) + public function generateBarcodesReportWithHttpInfo($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBarcodesReportRequest($generate_barcodes_report_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -734,169 +620,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -910,34 +672,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -947,7 +686,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -955,7 +694,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -963,7 +702,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -971,7 +710,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -979,7 +718,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -987,27 +726,28 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateCompetitorsPositionReportAsync + * Operation generateBarcodesReportAsync * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReportAsync($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) + public function generateBarcodesReportAsync($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - return $this->generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) + return $this->generateBarcodesReportAsyncWithHttpInfo($generate_barcodes_report_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1016,21 +756,20 @@ class ReportsApi } /** - * Operation generateCompetitorsPositionReportAsyncWithHttpInfo + * Operation generateBarcodesReportAsyncWithHttpInfo * - * Отчет «Конкурентная позиция» + * Получение файла со штрихкодами * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) + public function generateBarcodesReportAsyncWithHttpInfo($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); + $request = $this->generateBarcodesReportRequest($generate_barcodes_report_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1069,43 +808,32 @@ class ReportsApi } /** - * Create request for operation 'generateCompetitorsPositionReport' + * Create request for operation 'generateBarcodesReport' * - * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBarcodesReportRequest $generate_barcodes_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBarcodesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) + public function generateBarcodesReportRequest($generate_barcodes_report_request, string $contentType = self::contentTypes['generateBarcodesReport'][0]) { - // verify the required parameter 'generate_competitors_position_report_request' is set - if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { + // verify the required parameter 'generate_barcodes_report_request' is set + if ($generate_barcodes_report_request === null || (is_array($generate_barcodes_report_request) && count($generate_barcodes_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport' + 'Missing the required parameter $generate_barcodes_report_request when calling generateBarcodesReport' ); } - - $resourcePath = '/reports/competitors-position/generate'; + $resourcePath = '/v1/reports/documents/barcodes/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -1117,12 +845,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_competitors_position_report_request)) { + if (isset($generate_barcodes_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_barcodes_report_request)); } else { - $httpBody = $generate_competitors_position_report_request; + $httpBody = $generate_barcodes_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1180,40 +908,40 @@ class ReportsApi } /** - * Operation generateGoodsFeedbackReport + * Operation generateBoostConsolidatedReport * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsFeedbackReport($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) + public function generateBoostConsolidatedReport($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - list($response) = $this->generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format, $contentType); + list($response) = $this->generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format, $contentType); return $response; } /** - * Operation generateGoodsFeedbackReportWithHttpInfo + * Operation generateBoostConsolidatedReportWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) + public function generateBoostConsolidatedReportWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -1240,169 +968,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1416,34 +1020,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1453,7 +1034,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1461,7 +1042,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1469,7 +1050,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1477,7 +1058,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1485,7 +1066,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1493,27 +1074,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsFeedbackReportAsync + * Operation generateBoostConsolidatedReportAsync * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReportAsync($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) + public function generateBoostConsolidatedReportAsync($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - return $this->generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) + return $this->generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -1522,21 +1105,21 @@ class ReportsApi } /** - * Operation generateGoodsFeedbackReportAsyncWithHttpInfo + * Operation generateBoostConsolidatedReportAsyncWithHttpInfo * - * Отчет по отзывам о товарах + * Отчет по бусту продаж * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) + public function generateBoostConsolidatedReportAsyncWithHttpInfo($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); + $request = $this->generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1575,28 +1158,28 @@ class ReportsApi } /** - * Create request for operation 'generateGoodsFeedbackReport' + * Create request for operation 'generateBoostConsolidatedReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateBoostConsolidatedRequest $generate_boost_consolidated_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateBoostConsolidatedReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) + public function generateBoostConsolidatedReportRequest($generate_boost_consolidated_request, $format = null, string $contentType = self::contentTypes['generateBoostConsolidatedReport'][0]) { - // verify the required parameter 'generate_goods_feedback_request' is set - if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { + // verify the required parameter 'generate_boost_consolidated_request' is set + if ($generate_boost_consolidated_request === null || (is_array($generate_boost_consolidated_request) && count($generate_boost_consolidated_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport' + 'Missing the required parameter $generate_boost_consolidated_request when calling generateBoostConsolidatedReport' ); } - $resourcePath = '/reports/goods-feedback/generate'; + $resourcePath = '/v2/reports/boost-consolidated/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1623,12 +1206,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_goods_feedback_request)) { + if (isset($generate_boost_consolidated_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_boost_consolidated_request)); } else { - $httpBody = $generate_goods_feedback_request; + $httpBody = $generate_boost_consolidated_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1686,40 +1269,40 @@ class ReportsApi } /** - * Operation generateGoodsMovementReport + * Operation generateClosureDocumentsDetalizationReport * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsMovementReport($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + public function generateClosureDocumentsDetalizationReport($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - list($response) = $this->generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType); return $response; } /** - * Operation generateGoodsMovementReportWithHttpInfo + * Operation generateClosureDocumentsDetalizationReportWithHttpInfo * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + public function generateClosureDocumentsDetalizationReportWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -1746,169 +1329,51 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1922,34 +1387,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1959,7 +1401,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1967,7 +1409,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1975,7 +1417,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1983,15 +1425,23 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 420: + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\ApiLimitErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1999,27 +1449,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsMovementReportAsync + * Operation generateClosureDocumentsDetalizationReportAsync * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsMovementReportAsync($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + public function generateClosureDocumentsDetalizationReportAsync($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - return $this->generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format, $contentType) + return $this->generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -2028,21 +1480,21 @@ class ReportsApi } /** - * Operation generateGoodsMovementReportAsyncWithHttpInfo + * Operation generateClosureDocumentsDetalizationReportAsyncWithHttpInfo * - * Отчет по движению товаров + * Отчет по схождению с закрывающими документами * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + public function generateClosureDocumentsDetalizationReportAsyncWithHttpInfo($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2081,28 +1533,28 @@ class ReportsApi } /** - * Create request for operation 'generateGoodsMovementReport' + * Create request for operation 'generateClosureDocumentsDetalizationReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsDetalizationRequest $generate_closure_documents_detalization_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsDetalizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) + public function generateClosureDocumentsDetalizationReportRequest($generate_closure_documents_detalization_request, $format = null, string $contentType = self::contentTypes['generateClosureDocumentsDetalizationReport'][0]) { - // verify the required parameter 'generate_goods_movement_report_request' is set - if ($generate_goods_movement_report_request === null || (is_array($generate_goods_movement_report_request) && count($generate_goods_movement_report_request) === 0)) { + // verify the required parameter 'generate_closure_documents_detalization_request' is set + if ($generate_closure_documents_detalization_request === null || (is_array($generate_closure_documents_detalization_request) && count($generate_closure_documents_detalization_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_movement_report_request when calling generateGoodsMovementReport' + 'Missing the required parameter $generate_closure_documents_detalization_request when calling generateClosureDocumentsDetalizationReport' ); } - $resourcePath = '/reports/goods-movement/generate'; + $resourcePath = '/v2/reports/closure-documents/detalization/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2129,12 +1581,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_goods_movement_report_request)) { + if (isset($generate_closure_documents_detalization_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_movement_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_detalization_request)); } else { - $httpBody = $generate_goods_movement_report_request; + $httpBody = $generate_closure_documents_detalization_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2192,40 +1644,38 @@ class ReportsApi } /** - * Operation generateGoodsRealizationReport + * Operation generateClosureDocumentsReport * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsRealizationReport($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) + public function generateClosureDocumentsReport($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - list($response) = $this->generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format, $contentType); + list($response) = $this->generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, $contentType); return $response; } /** - * Operation generateGoodsRealizationReportWithHttpInfo + * Operation generateClosureDocumentsReportWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) + public function generateClosureDocumentsReportWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2252,169 +1702,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2428,34 +1754,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2465,7 +1768,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2473,7 +1776,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2481,7 +1784,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2489,7 +1792,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2497,7 +1800,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2505,27 +1808,28 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsRealizationReportAsync + * Operation generateClosureDocumentsReportAsync * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReportAsync($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) + public function generateClosureDocumentsReportAsync($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - return $this->generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) + return $this->generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2534,21 +1838,20 @@ class ReportsApi } /** - * Operation generateGoodsRealizationReportAsyncWithHttpInfo + * Operation generateClosureDocumentsReportAsyncWithHttpInfo * - * Отчет по реализации + * Закрывающие документы * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) + public function generateClosureDocumentsReportAsyncWithHttpInfo($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); + $request = $this->generateClosureDocumentsReportRequest($generate_closure_documents_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2587,43 +1890,32 @@ class ReportsApi } /** - * Create request for operation 'generateGoodsRealizationReport' + * Create request for operation 'generateClosureDocumentsReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateClosureDocumentsRequest $generate_closure_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateClosureDocumentsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) + public function generateClosureDocumentsReportRequest($generate_closure_documents_request, string $contentType = self::contentTypes['generateClosureDocumentsReport'][0]) { - // verify the required parameter 'generate_goods_realization_report_request' is set - if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { + // verify the required parameter 'generate_closure_documents_request' is set + if ($generate_closure_documents_request === null || (is_array($generate_closure_documents_request) && count($generate_closure_documents_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport' + 'Missing the required parameter $generate_closure_documents_request when calling generateClosureDocumentsReport' ); } - - $resourcePath = '/reports/goods-realization/generate'; + $resourcePath = '/v2/reports/closure-documents/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $format, - 'format', // param base name - 'ReportFormatType', // openApiType - '', // style - false, // explode - false // required - ) ?? []); @@ -2635,12 +1927,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_goods_realization_report_request)) { + if (isset($generate_closure_documents_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_closure_documents_request)); } else { - $httpBody = $generate_goods_realization_report_request; + $httpBody = $generate_closure_documents_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2698,40 +1990,40 @@ class ReportsApi } /** - * Operation generateGoodsTurnoverReport + * Operation generateCompetitorsPositionReport * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateGoodsTurnoverReport($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + public function generateCompetitorsPositionReport($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - list($response) = $this->generateGoodsTurnoverReportWithHttpInfo($generate_goods_turnover_request, $format, $contentType); + list($response) = $this->generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format, $contentType); return $response; } /** - * Operation generateGoodsTurnoverReportWithHttpInfo + * Operation generateCompetitorsPositionReportWithHttpInfo * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateGoodsTurnoverReportWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + public function generateCompetitorsPositionReportWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - $request = $this->generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -2758,169 +2050,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2934,34 +2102,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2971,7 +2116,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2979,7 +2124,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2987,7 +2132,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2995,7 +2140,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3003,7 +2148,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3011,27 +2156,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateGoodsTurnoverReportAsync + * Operation generateCompetitorsPositionReportAsync * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsTurnoverReportAsync($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + public function generateCompetitorsPositionReportAsync($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - return $this->generateGoodsTurnoverReportAsyncWithHttpInfo($generate_goods_turnover_request, $format, $contentType) + return $this->generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -3040,21 +2187,21 @@ class ReportsApi } /** - * Operation generateGoodsTurnoverReportAsyncWithHttpInfo + * Operation generateCompetitorsPositionReportAsyncWithHttpInfo * - * Отчет по оборачиваемости + * Отчет «Конкурентная позиция» * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateGoodsTurnoverReportAsyncWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + public function generateCompetitorsPositionReportAsyncWithHttpInfo($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format, $contentType); + $request = $this->generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3093,28 +2240,28 @@ class ReportsApi } /** - * Create request for operation 'generateGoodsTurnoverReport' + * Create request for operation 'generateCompetitorsPositionReport' * - * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateCompetitorsPositionReportRequest $generate_competitors_position_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateCompetitorsPositionReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + public function generateCompetitorsPositionReportRequest($generate_competitors_position_report_request, $format = null, string $contentType = self::contentTypes['generateCompetitorsPositionReport'][0]) { - // verify the required parameter 'generate_goods_turnover_request' is set - if ($generate_goods_turnover_request === null || (is_array($generate_goods_turnover_request) && count($generate_goods_turnover_request) === 0)) { + // verify the required parameter 'generate_competitors_position_report_request' is set + if ($generate_competitors_position_report_request === null || (is_array($generate_competitors_position_report_request) && count($generate_competitors_position_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_goods_turnover_request when calling generateGoodsTurnoverReport' + 'Missing the required parameter $generate_competitors_position_report_request when calling generateCompetitorsPositionReport' ); } - $resourcePath = '/reports/goods-turnover/generate'; + $resourcePath = '/v2/reports/competitors-position/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3141,12 +2288,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_goods_turnover_request)) { + if (isset($generate_competitors_position_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_turnover_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_competitors_position_report_request)); } else { - $httpBody = $generate_goods_turnover_request; + $httpBody = $generate_competitors_position_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3204,40 +2351,40 @@ class ReportsApi } /** - * Operation generateMassOrderLabelsReport + * Operation generateGoodsFeedbackReport * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateMassOrderLabelsReport($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + public function generateGoodsFeedbackReport($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - list($response) = $this->generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format, $contentType); + list($response) = $this->generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format, $contentType); return $response; } /** - * Operation generateMassOrderLabelsReportWithHttpInfo + * Operation generateGoodsFeedbackReportWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + public function generateGoodsFeedbackReportWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -3264,169 +2411,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3440,34 +2463,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3477,7 +2477,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3485,7 +2485,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3493,7 +2493,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3501,7 +2501,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3509,7 +2509,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3517,27 +2517,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateMassOrderLabelsReportAsync + * Operation generateGoodsFeedbackReportAsync * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReportAsync($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + public function generateGoodsFeedbackReportAsync($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - return $this->generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) + return $this->generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -3546,21 +2548,21 @@ class ReportsApi } /** - * Operation generateMassOrderLabelsReportAsyncWithHttpInfo + * Operation generateGoodsFeedbackReportAsyncWithHttpInfo * - * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * Отчет по отзывам о товарах * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + public function generateGoodsFeedbackReportAsyncWithHttpInfo($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); + $request = $this->generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3599,28 +2601,28 @@ class ReportsApi } /** - * Create request for operation 'generateMassOrderLabelsReport' + * Create request for operation 'generateGoodsFeedbackReport' * - * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) - * @param \OpenAPI\Client\Model\PageFormatType $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата A7. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsFeedbackRequest $generate_goods_feedback_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsFeedbackReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + public function generateGoodsFeedbackReportRequest($generate_goods_feedback_request, $format = null, string $contentType = self::contentTypes['generateGoodsFeedbackReport'][0]) { - // verify the required parameter 'generate_mass_order_labels_request' is set - if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { + // verify the required parameter 'generate_goods_feedback_request' is set + if ($generate_goods_feedback_request === null || (is_array($generate_goods_feedback_request) && count($generate_goods_feedback_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport' + 'Missing the required parameter $generate_goods_feedback_request when calling generateGoodsFeedbackReport' ); } - $resourcePath = '/reports/documents/labels/generate'; + $resourcePath = '/v2/reports/goods-feedback/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3631,7 +2633,7 @@ class ReportsApi $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $format, 'format', // param base name - 'PageFormatType', // openApiType + 'ReportFormatType', // openApiType '', // style false, // explode false // required @@ -3647,12 +2649,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_mass_order_labels_request)) { + if (isset($generate_goods_feedback_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_feedback_request)); } else { - $httpBody = $generate_mass_order_labels_request; + $httpBody = $generate_goods_feedback_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3710,40 +2712,40 @@ class ReportsApi } /** - * Operation generatePricesReport + * Operation generateGoodsMovementReport * - * Отчет «Цены на рынке» + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generatePricesReport($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + public function generateGoodsMovementReport($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - list($response) = $this->generatePricesReportWithHttpInfo($generate_prices_report_request, $format, $contentType); + list($response) = $this->generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format, $contentType); return $response; } /** - * Operation generatePricesReportWithHttpInfo + * Operation generateGoodsMovementReportWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generatePricesReportWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + public function generateGoodsMovementReportWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -3770,169 +2772,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3946,34 +2824,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3983,7 +2838,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3991,7 +2846,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3999,7 +2854,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4007,7 +2862,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4015,7 +2870,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4023,27 +2878,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generatePricesReportAsync + * Operation generateGoodsMovementReportAsync * - * Отчет «Цены на рынке» + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReportAsync($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + public function generateGoodsMovementReportAsync($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - return $this->generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) + return $this->generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -4052,21 +2909,21 @@ class ReportsApi } /** - * Operation generatePricesReportAsyncWithHttpInfo + * Operation generateGoodsMovementReportAsyncWithHttpInfo * - * Отчет «Цены на рынке» + * Отчет по движению товаров * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + public function generateGoodsMovementReportAsyncWithHttpInfo($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); + $request = $this->generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4105,28 +2962,28 @@ class ReportsApi } /** - * Create request for operation 'generatePricesReport' + * Create request for operation 'generateGoodsMovementReport' * - * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsMovementReportRequest $generate_goods_movement_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsMovementReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generatePricesReportRequest($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + public function generateGoodsMovementReportRequest($generate_goods_movement_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsMovementReport'][0]) { - // verify the required parameter 'generate_prices_report_request' is set - if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { + // verify the required parameter 'generate_goods_movement_report_request' is set + if ($generate_goods_movement_report_request === null || (is_array($generate_goods_movement_report_request) && count($generate_goods_movement_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport' + 'Missing the required parameter $generate_goods_movement_report_request when calling generateGoodsMovementReport' ); } - $resourcePath = '/reports/prices/generate'; + $resourcePath = '/v2/reports/goods-movement/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4153,12 +3010,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_prices_report_request)) { + if (isset($generate_goods_movement_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_movement_report_request)); } else { - $httpBody = $generate_prices_report_request; + $httpBody = $generate_goods_movement_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4216,40 +3073,40 @@ class ReportsApi } /** - * Operation generateShelfsStatisticsReport + * Operation generateGoodsPricesReport * - * Отчет по полкам + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShelfsStatisticsReport($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + public function generateGoodsPricesReport($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - list($response) = $this->generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); + list($response) = $this->generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format, $contentType); return $response; } /** - * Operation generateShelfsStatisticsReportWithHttpInfo + * Operation generateGoodsPricesReportWithHttpInfo * - * Отчет по полкам + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + public function generateGoodsPricesReportWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -4276,169 +3133,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4452,34 +3185,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4489,7 +3199,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4497,7 +3207,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4505,7 +3215,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4513,7 +3223,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4521,7 +3231,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4529,27 +3239,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShelfsStatisticsReportAsync + * Operation generateGoodsPricesReportAsync * - * Отчет по полкам + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReportAsync($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + public function generateGoodsPricesReportAsync($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - return $this->generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) + return $this->generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -4558,21 +3270,21 @@ class ReportsApi } /** - * Operation generateShelfsStatisticsReportAsyncWithHttpInfo + * Operation generateGoodsPricesReportAsyncWithHttpInfo * - * Отчет по полкам + * Отчет «Цены» * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + public function generateGoodsPricesReportAsyncWithHttpInfo($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); + $request = $this->generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4611,28 +3323,28 @@ class ReportsApi } /** - * Create request for operation 'generateShelfsStatisticsReport' + * Create request for operation 'generateGoodsPricesReport' * - * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsPricesReportRequest $generate_goods_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsPricesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + public function generateGoodsPricesReportRequest($generate_goods_prices_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsPricesReport'][0]) { - // verify the required parameter 'generate_shelfs_statistics_request' is set - if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { + // verify the required parameter 'generate_goods_prices_report_request' is set + if ($generate_goods_prices_report_request === null || (is_array($generate_goods_prices_report_request) && count($generate_goods_prices_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport' + 'Missing the required parameter $generate_goods_prices_report_request when calling generateGoodsPricesReport' ); } - $resourcePath = '/reports/shelf-statistics/generate'; + $resourcePath = '/v2/reports/goods-prices/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4659,12 +3371,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_shelfs_statistics_request)) { + if (isset($generate_goods_prices_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_prices_report_request)); } else { - $httpBody = $generate_shelfs_statistics_request; + $httpBody = $generate_goods_prices_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4722,38 +3434,40 @@ class ReportsApi } /** - * Operation generateShipmentListDocumentReport + * Operation generateGoodsRealizationReport * - * Получение листа сборки + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShipmentListDocumentReport($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + public function generateGoodsRealizationReport($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - list($response) = $this->generateShipmentListDocumentReportWithHttpInfo($generate_shipment_list_document_report_request, $contentType); + list($response) = $this->generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format, $contentType); return $response; } /** - * Operation generateShipmentListDocumentReportWithHttpInfo + * Operation generateGoodsRealizationReportWithHttpInfo * - * Получение листа сборки + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShipmentListDocumentReportWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + public function generateGoodsRealizationReportWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - $request = $this->generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -4780,169 +3494,51 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4956,34 +3552,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4993,7 +3566,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5001,7 +3574,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5009,7 +3582,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5017,7 +3590,15 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5025,7 +3606,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5033,26 +3614,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShipmentListDocumentReportAsync + * Operation generateGoodsRealizationReportAsync * - * Получение листа сборки + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShipmentListDocumentReportAsync($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + public function generateGoodsRealizationReportAsync($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - return $this->generateShipmentListDocumentReportAsyncWithHttpInfo($generate_shipment_list_document_report_request, $contentType) + return $this->generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -5061,20 +3645,21 @@ class ReportsApi } /** - * Operation generateShipmentListDocumentReportAsyncWithHttpInfo + * Operation generateGoodsRealizationReportAsyncWithHttpInfo * - * Получение листа сборки + * Отчет по реализации * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShipmentListDocumentReportAsyncWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + public function generateGoodsRealizationReportAsyncWithHttpInfo($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, $contentType); + $request = $this->generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5113,32 +3698,43 @@ class ReportsApi } /** - * Create request for operation 'generateShipmentListDocumentReport' + * Create request for operation 'generateGoodsRealizationReport' * - * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsRealizationReportRequest $generate_goods_realization_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsRealizationReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + public function generateGoodsRealizationReportRequest($generate_goods_realization_report_request, $format = null, string $contentType = self::contentTypes['generateGoodsRealizationReport'][0]) { - // verify the required parameter 'generate_shipment_list_document_report_request' is set - if ($generate_shipment_list_document_report_request === null || (is_array($generate_shipment_list_document_report_request) && count($generate_shipment_list_document_report_request) === 0)) { + // verify the required parameter 'generate_goods_realization_report_request' is set + if ($generate_goods_realization_report_request === null || (is_array($generate_goods_realization_report_request) && count($generate_goods_realization_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shipment_list_document_report_request when calling generateShipmentListDocumentReport' + 'Missing the required parameter $generate_goods_realization_report_request when calling generateGoodsRealizationReport' ); } - $resourcePath = '/reports/documents/shipment-list/generate'; + + $resourcePath = '/v2/reports/goods-realization/generate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -5150,12 +3746,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_shipment_list_document_report_request)) { + if (isset($generate_goods_realization_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shipment_list_document_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_realization_report_request)); } else { - $httpBody = $generate_shipment_list_document_report_request; + $httpBody = $generate_goods_realization_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -5213,40 +3809,40 @@ class ReportsApi } /** - * Operation generateShowsSalesReport + * Operation generateGoodsTurnoverReport * - * Отчет «Аналитика продаж» + * Отчет по оборачиваемости * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateShowsSalesReport($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + public function generateGoodsTurnoverReport($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { - list($response) = $this->generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format, $contentType); + list($response) = $this->generateGoodsTurnoverReportWithHttpInfo($generate_goods_turnover_request, $format, $contentType); return $response; } /** - * Operation generateShowsSalesReportWithHttpInfo + * Operation generateGoodsTurnoverReportWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет по оборачиваемости * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + public function generateGoodsTurnoverReportWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) { - $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -5273,169 +3869,3665 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateGoodsTurnoverReportAsync + * + * Отчет по оборачиваемости + * + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateGoodsTurnoverReportAsync($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + { + return $this->generateGoodsTurnoverReportAsyncWithHttpInfo($generate_goods_turnover_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateGoodsTurnoverReportAsyncWithHttpInfo + * + * Отчет по оборачиваемости + * + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateGoodsTurnoverReportAsyncWithHttpInfo($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateGoodsTurnoverReport' + * + * @param \OpenAPI\Client\Model\GenerateGoodsTurnoverRequest $generate_goods_turnover_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateGoodsTurnoverReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateGoodsTurnoverReportRequest($generate_goods_turnover_request, $format = null, string $contentType = self::contentTypes['generateGoodsTurnoverReport'][0]) + { + + // verify the required parameter 'generate_goods_turnover_request' is set + if ($generate_goods_turnover_request === null || (is_array($generate_goods_turnover_request) && count($generate_goods_turnover_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_goods_turnover_request when calling generateGoodsTurnoverReport' + ); + } + + + + $resourcePath = '/v2/reports/goods-turnover/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_goods_turnover_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_goods_turnover_request)); + } else { + $httpBody = $generate_goods_turnover_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateJewelryFiscalReport + * + * Отчет по заказам с ювелирными изделиями + * + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateJewelryFiscalReport($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) + { + list($response) = $this->generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType); + return $response; + } + + /** + * Operation generateJewelryFiscalReportWithHttpInfo + * + * Отчет по заказам с ювелирными изделиями + * + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateJewelryFiscalReportWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) + { + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateJewelryFiscalReportAsync + * + * Отчет по заказам с ювелирными изделиями + * + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateJewelryFiscalReportAsync($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) + { + return $this->generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateJewelryFiscalReportAsyncWithHttpInfo + * + * Отчет по заказам с ювелирными изделиями + * + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateJewelryFiscalReportAsyncWithHttpInfo($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateJewelryFiscalReport' + * + * @param \OpenAPI\Client\Model\GenerateJewelryFiscalReportRequest $generate_jewelry_fiscal_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateJewelryFiscalReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateJewelryFiscalReportRequest($generate_jewelry_fiscal_report_request, $format = null, string $contentType = self::contentTypes['generateJewelryFiscalReport'][0]) + { + + // verify the required parameter 'generate_jewelry_fiscal_report_request' is set + if ($generate_jewelry_fiscal_report_request === null || (is_array($generate_jewelry_fiscal_report_request) && count($generate_jewelry_fiscal_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_jewelry_fiscal_report_request when calling generateJewelryFiscalReport' + ); + } + + + + $resourcePath = '/v2/reports/jewelry-fiscal/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_jewelry_fiscal_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_jewelry_fiscal_report_request)); + } else { + $httpBody = $generate_jewelry_fiscal_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateKeyIndicatorsReport + * + * Отчет по ключевым показателям + * + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateKeyIndicatorsReport($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) + { + list($response) = $this->generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format, $contentType); + return $response; + } + + /** + * Operation generateKeyIndicatorsReportWithHttpInfo + * + * Отчет по ключевым показателям + * + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateKeyIndicatorsReportWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) + { + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateKeyIndicatorsReportAsync + * + * Отчет по ключевым показателям + * + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateKeyIndicatorsReportAsync($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) + { + return $this->generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateKeyIndicatorsReportAsyncWithHttpInfo + * + * Отчет по ключевым показателям + * + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateKeyIndicatorsReportAsyncWithHttpInfo($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateKeyIndicatorsReport' + * + * @param \OpenAPI\Client\Model\GenerateKeyIndicatorsRequest $generate_key_indicators_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateKeyIndicatorsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateKeyIndicatorsReportRequest($generate_key_indicators_request, $format = null, string $contentType = self::contentTypes['generateKeyIndicatorsReport'][0]) + { + + // verify the required parameter 'generate_key_indicators_request' is set + if ($generate_key_indicators_request === null || (is_array($generate_key_indicators_request) && count($generate_key_indicators_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_key_indicators_request when calling generateKeyIndicatorsReport' + ); + } + + + + $resourcePath = '/v2/reports/key-indicators/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_key_indicators_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_key_indicators_request)); + } else { + $httpBody = $generate_key_indicators_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateMassOrderLabelsReport + * + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateMassOrderLabelsReport($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + { + list($response) = $this->generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format, $contentType); + return $response; + } + + /** + * Operation generateMassOrderLabelsReportWithHttpInfo + * + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateMassOrderLabelsReportWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + { + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateMassOrderLabelsReportAsync + * + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateMassOrderLabelsReportAsync($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + { + return $this->generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateMassOrderLabelsReportAsyncWithHttpInfo + * + * Готовые ярлыки‑наклейки на все коробки в нескольких заказах + * + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateMassOrderLabelsReportAsyncWithHttpInfo($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateMassOrderLabelsReport' + * + * @param \OpenAPI\Client\Model\GenerateMassOrderLabelsRequest $generate_mass_order_labels_request (required) + * @param \OpenAPI\Client\Model\PageFormatType|null $format Настройка размещения ярлыков на странице. Если параметра нет, возвращается PDF с ярлыками формата :no-translate[A7]. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateMassOrderLabelsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateMassOrderLabelsReportRequest($generate_mass_order_labels_request, $format = null, string $contentType = self::contentTypes['generateMassOrderLabelsReport'][0]) + { + + // verify the required parameter 'generate_mass_order_labels_request' is set + if ($generate_mass_order_labels_request === null || (is_array($generate_mass_order_labels_request) && count($generate_mass_order_labels_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_mass_order_labels_request when calling generateMassOrderLabelsReport' + ); + } + + + + $resourcePath = '/v2/reports/documents/labels/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'PageFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_mass_order_labels_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_mass_order_labels_request)); + } else { + $httpBody = $generate_mass_order_labels_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generatePricesReport + * + * Отчет «Цены на рынке» + * + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated + */ + public function generatePricesReport($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + { + list($response) = $this->generatePricesReportWithHttpInfo($generate_prices_report_request, $format, $contentType); + return $response; + } + + /** + * Operation generatePricesReportWithHttpInfo + * + * Отчет «Цены на рынке» + * + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function generatePricesReportWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + { + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generatePricesReportAsync + * + * Отчет «Цены на рынке» + * + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function generatePricesReportAsync($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + { + return $this->generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generatePricesReportAsyncWithHttpInfo + * + * Отчет «Цены на рынке» + * + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function generatePricesReportAsyncWithHttpInfo($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generatePricesReportRequest($generate_prices_report_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generatePricesReport' + * + * @param \OpenAPI\Client\Model\GeneratePricesReportRequest $generate_prices_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePricesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function generatePricesReportRequest($generate_prices_report_request, $format = null, string $contentType = self::contentTypes['generatePricesReport'][0]) + { + + // verify the required parameter 'generate_prices_report_request' is set + if ($generate_prices_report_request === null || (is_array($generate_prices_report_request) && count($generate_prices_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_prices_report_request when calling generatePricesReport' + ); + } + + + + $resourcePath = '/v2/reports/prices/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_prices_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_prices_report_request)); + } else { + $httpBody = $generate_prices_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateSalesGeographyReport + * + * Отчет по географии продаж + * + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateSalesGeographyReport($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) + { + list($response) = $this->generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format, $contentType); + return $response; + } + + /** + * Operation generateSalesGeographyReportWithHttpInfo + * + * Отчет по географии продаж + * + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateSalesGeographyReportWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) + { + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateSalesGeographyReportAsync + * + * Отчет по географии продаж + * + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateSalesGeographyReportAsync($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) + { + return $this->generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateSalesGeographyReportAsyncWithHttpInfo + * + * Отчет по географии продаж + * + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateSalesGeographyReportAsyncWithHttpInfo($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateSalesGeographyReportRequest($generate_sales_geography_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateSalesGeographyReport' + * + * @param \OpenAPI\Client\Model\GenerateSalesGeographyRequest $generate_sales_geography_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSalesGeographyReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateSalesGeographyReportRequest($generate_sales_geography_request, $format = null, string $contentType = self::contentTypes['generateSalesGeographyReport'][0]) + { + + // verify the required parameter 'generate_sales_geography_request' is set + if ($generate_sales_geography_request === null || (is_array($generate_sales_geography_request) && count($generate_sales_geography_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_sales_geography_request when calling generateSalesGeographyReport' + ); + } + + + + $resourcePath = '/v2/reports/sales-geography/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_sales_geography_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_sales_geography_request)); + } else { + $httpBody = $generate_sales_geography_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateShelfsStatisticsReport + * + * Отчет по полкам + * + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateShelfsStatisticsReport($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + { + list($response) = $this->generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType); + return $response; + } + + /** + * Operation generateShelfsStatisticsReportWithHttpInfo + * + * Отчет по полкам + * + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateShelfsStatisticsReportWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + { + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateShelfsStatisticsReportAsync + * + * Отчет по полкам + * + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShelfsStatisticsReportAsync($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + { + return $this->generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateShelfsStatisticsReportAsyncWithHttpInfo + * + * Отчет по полкам + * + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShelfsStatisticsReportAsyncWithHttpInfo($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateShelfsStatisticsReport' + * + * @param \OpenAPI\Client\Model\GenerateShelfsStatisticsRequest $generate_shelfs_statistics_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShelfsStatisticsReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateShelfsStatisticsReportRequest($generate_shelfs_statistics_request, $format = null, string $contentType = self::contentTypes['generateShelfsStatisticsReport'][0]) + { + + // verify the required parameter 'generate_shelfs_statistics_request' is set + if ($generate_shelfs_statistics_request === null || (is_array($generate_shelfs_statistics_request) && count($generate_shelfs_statistics_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_shelfs_statistics_request when calling generateShelfsStatisticsReport' + ); + } + + + + $resourcePath = '/v2/reports/shelf-statistics/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_shelfs_statistics_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shelfs_statistics_request)); + } else { + $httpBody = $generate_shelfs_statistics_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateShipmentListDocumentReport + * + * Получение листа сборки + * + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateShipmentListDocumentReport($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + { + list($response) = $this->generateShipmentListDocumentReportWithHttpInfo($generate_shipment_list_document_report_request, $contentType); + return $response; + } + + /** + * Operation generateShipmentListDocumentReportWithHttpInfo + * + * Получение листа сборки + * + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateShipmentListDocumentReportWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + { + $request = $this->generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateShipmentListDocumentReportAsync + * + * Получение листа сборки + * + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShipmentListDocumentReportAsync($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + { + return $this->generateShipmentListDocumentReportAsyncWithHttpInfo($generate_shipment_list_document_report_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateShipmentListDocumentReportAsyncWithHttpInfo + * + * Получение листа сборки + * + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShipmentListDocumentReportAsyncWithHttpInfo($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateShipmentListDocumentReport' + * + * @param \OpenAPI\Client\Model\GenerateShipmentListDocumentReportRequest $generate_shipment_list_document_report_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShipmentListDocumentReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateShipmentListDocumentReportRequest($generate_shipment_list_document_report_request, string $contentType = self::contentTypes['generateShipmentListDocumentReport'][0]) + { + + // verify the required parameter 'generate_shipment_list_document_report_request' is set + if ($generate_shipment_list_document_report_request === null || (is_array($generate_shipment_list_document_report_request) && count($generate_shipment_list_document_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_shipment_list_document_report_request when calling generateShipmentListDocumentReport' + ); + } + + + $resourcePath = '/v2/reports/documents/shipment-list/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_shipment_list_document_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shipment_list_document_report_request)); + } else { + $httpBody = $generate_shipment_list_document_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateShowsBoostReport + * + * Отчет по бусту показов + * + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateShowsBoostReport($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) + { + list($response) = $this->generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format, $contentType); + return $response; + } + + /** + * Operation generateShowsBoostReportWithHttpInfo + * + * Отчет по бусту показов + * + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateShowsBoostReportWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) + { + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateShowsBoostReportAsync + * + * Отчет по бусту показов + * + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShowsBoostReportAsync($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) + { + return $this->generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateShowsBoostReportAsyncWithHttpInfo + * + * Отчет по бусту показов + * + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShowsBoostReportAsyncWithHttpInfo($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsBoostReportRequest($generate_shows_boost_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateShowsBoostReport' + * + * @param \OpenAPI\Client\Model\GenerateShowsBoostRequest $generate_shows_boost_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsBoostReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateShowsBoostReportRequest($generate_shows_boost_request, $format = null, string $contentType = self::contentTypes['generateShowsBoostReport'][0]) + { + + // verify the required parameter 'generate_shows_boost_request' is set + if ($generate_shows_boost_request === null || (is_array($generate_shows_boost_request) && count($generate_shows_boost_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_shows_boost_request when calling generateShowsBoostReport' + ); + } + + + + $resourcePath = '/v2/reports/shows-boost/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_shows_boost_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_boost_request)); + } else { + $httpBody = $generate_shows_boost_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateShowsSalesReport + * + * Отчет «Аналитика продаж» + * + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateShowsSalesReport($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + { + list($response) = $this->generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format, $contentType); + return $response; + } + + /** + * Operation generateShowsSalesReportWithHttpInfo + * + * Отчет «Аналитика продаж» + * + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateShowsSalesReportWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + { + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GenerateReportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateShowsSalesReportAsync + * + * Отчет «Аналитика продаж» + * + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShowsSalesReportAsync($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + { + return $this->generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateShowsSalesReportAsyncWithHttpInfo + * + * Отчет «Аналитика продаж» + * + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + { + $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; + $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateShowsSalesReport' + * + * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateShowsSalesReportRequest($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + { + + // verify the required parameter 'generate_shows_sales_report_request' is set + if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport' + ); + } + + + + $resourcePath = '/v2/reports/shows-sales/generate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $format, + 'format', // param base name + 'ReportFormatType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($generate_shows_sales_report_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + } else { + $httpBody = $generate_shows_sales_report_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateStocksOnWarehousesReport + * + * Отчет по остаткам на складах + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + return $response; + } + + /** + * Operation generateStocksOnWarehousesReportWithHttpInfo + * + * Отчет по остаткам на складах + * + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + { + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5449,34 +7541,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5486,7 +7555,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5494,7 +7563,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5502,7 +7571,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5510,7 +7579,15 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5518,7 +7595,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5526,27 +7603,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateShowsSalesReportAsync + * Operation generateStocksOnWarehousesReportAsync * - * Отчет «Аналитика продаж» + * Отчет по остаткам на складах * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReportAsync($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - return $this->generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format, $contentType) + return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -5555,21 +7634,21 @@ class ReportsApi } /** - * Operation generateShowsSalesReportAsyncWithHttpInfo + * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo * - * Отчет «Аналитика продаж» + * Отчет по остаткам на складах * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateShowsSalesReportAsyncWithHttpInfo($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateShowsSalesReportRequest($generate_shows_sales_report_request, $format, $contentType); + $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5608,28 +7687,28 @@ class ReportsApi } /** - * Create request for operation 'generateShowsSalesReport' + * Create request for operation 'generateStocksOnWarehousesReport' * - * @param \OpenAPI\Client\Model\GenerateShowsSalesReportRequest $generate_shows_sales_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateShowsSalesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateShowsSalesReportRequest($generate_shows_sales_report_request, $format = null, string $contentType = self::contentTypes['generateShowsSalesReport'][0]) + public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) { - // verify the required parameter 'generate_shows_sales_report_request' is set - if ($generate_shows_sales_report_request === null || (is_array($generate_shows_sales_report_request) && count($generate_shows_sales_report_request) === 0)) { + // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set + if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_shows_sales_report_request when calling generateShowsSalesReport' + 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' ); } - $resourcePath = '/reports/shows-sales/generate'; + $resourcePath = '/v2/reports/stocks-on-warehouses/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5656,12 +7735,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_shows_sales_report_request)) { + if (isset($generate_stocks_on_warehouses_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_shows_sales_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); } else { - $httpBody = $generate_shows_sales_report_request; + $httpBody = $generate_stocks_on_warehouses_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -5719,40 +7798,42 @@ class ReportsApi } /** - * Operation generateStocksOnWarehousesReport + * Operation generateUnitedMarketplaceServicesReport * - * Отчет по остаткам на складах + * Отчет по стоимости услуг * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateStocksOnWarehousesReport($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - list($response) = $this->generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType); + list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $response; } /** - * Operation generateStocksOnWarehousesReportWithHttpInfo + * Operation generateUnitedMarketplaceServicesReportWithHttpInfo * - * Отчет по остаткам на складах + * Отчет по стоимости услуг * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateStocksOnWarehousesReportWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -5779,169 +7860,51 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5955,34 +7918,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5992,7 +7932,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6000,7 +7940,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6008,7 +7948,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6016,7 +7956,15 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6024,7 +7972,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6032,27 +7980,30 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateStocksOnWarehousesReportAsync + * Operation generateUnitedMarketplaceServicesReportAsync * - * Отчет по остаткам на складах + * Отчет по стоимости услуг * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReportAsync($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - return $this->generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format, $contentType) + return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -6061,21 +8012,22 @@ class ReportsApi } /** - * Operation generateStocksOnWarehousesReportAsyncWithHttpInfo + * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo * - * Отчет по остаткам на складах + * Отчет по стоимости услуг * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateStocksOnWarehousesReportAsyncWithHttpInfo($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format, $contentType); + $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6114,28 +8066,30 @@ class ReportsApi } /** - * Create request for operation 'generateStocksOnWarehousesReport' + * Create request for operation 'generateUnitedMarketplaceServicesReport' * - * @param \OpenAPI\Client\Model\GenerateStocksOnWarehousesReportRequest $generate_stocks_on_warehouses_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateStocksOnWarehousesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateStocksOnWarehousesReportRequest($generate_stocks_on_warehouses_report_request, $format = null, string $contentType = self::contentTypes['generateStocksOnWarehousesReport'][0]) + public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) { - // verify the required parameter 'generate_stocks_on_warehouses_report_request' is set - if ($generate_stocks_on_warehouses_report_request === null || (is_array($generate_stocks_on_warehouses_report_request) && count($generate_stocks_on_warehouses_report_request) === 0)) { + // verify the required parameter 'generate_united_marketplace_services_report_request' is set + if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_stocks_on_warehouses_report_request when calling generateStocksOnWarehousesReport' + 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' ); } - $resourcePath = '/reports/stocks-on-warehouses/generate'; + + $resourcePath = '/v2/reports/united-marketplace-services/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6151,6 +8105,15 @@ class ReportsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -6162,12 +8125,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_stocks_on_warehouses_report_request)) { + if (isset($generate_united_marketplace_services_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_stocks_on_warehouses_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); } else { - $httpBody = $generate_stocks_on_warehouses_report_request; + $httpBody = $generate_united_marketplace_services_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6225,40 +8188,42 @@ class ReportsApi } /** - * Operation generateUnitedMarketplaceServicesReport + * Operation generateUnitedNettingReport * - * Отчет по стоимости услуг + * Отчет по платежам * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedMarketplaceServicesReport($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + public function generateUnitedNettingReport($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - list($response) = $this->generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType); + list($response) = $this->generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType); return $response; } /** - * Operation generateUnitedMarketplaceServicesReportWithHttpInfo + * Operation generateUnitedNettingReportWithHttpInfo * - * Отчет по стоимости услуг + * Отчет по платежам * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedMarketplaceServicesReportWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + public function generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -6285,169 +8250,51 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6461,34 +8308,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -6498,7 +8322,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6506,7 +8330,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6514,7 +8338,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6522,7 +8346,15 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6530,7 +8362,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6538,27 +8370,30 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedMarketplaceServicesReportAsync + * Operation generateUnitedNettingReportAsync * - * Отчет по стоимости услуг + * Отчет по платежам * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReportAsync($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + public function generateUnitedNettingReportAsync($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - return $this->generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format, $contentType) + return $this->generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -6567,21 +8402,22 @@ class ReportsApi } /** - * Operation generateUnitedMarketplaceServicesReportAsyncWithHttpInfo + * Operation generateUnitedNettingReportAsyncWithHttpInfo * - * Отчет по стоимости услуг + * Отчет по платежам * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedMarketplaceServicesReportAsyncWithHttpInfo($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + public function generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format, $contentType); + $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6620,28 +8456,30 @@ class ReportsApi } /** - * Create request for operation 'generateUnitedMarketplaceServicesReport' + * Create request for operation 'generateUnitedNettingReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedMarketplaceServicesReportRequest $generate_united_marketplace_services_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedMarketplaceServicesReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedMarketplaceServicesReportRequest($generate_united_marketplace_services_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedMarketplaceServicesReport'][0]) + public function generateUnitedNettingReportRequest($generate_united_netting_report_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) { - // verify the required parameter 'generate_united_marketplace_services_report_request' is set - if ($generate_united_marketplace_services_report_request === null || (is_array($generate_united_marketplace_services_report_request) && count($generate_united_marketplace_services_report_request) === 0)) { + // verify the required parameter 'generate_united_netting_report_request' is set + if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_marketplace_services_report_request when calling generateUnitedMarketplaceServicesReport' + 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport' ); } - $resourcePath = '/reports/united-marketplace-services/generate'; + + $resourcePath = '/v2/reports/united-netting/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6657,6 +8495,15 @@ class ReportsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -6668,12 +8515,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_united_marketplace_services_report_request)) { + if (isset($generate_united_netting_report_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_marketplace_services_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); } else { - $httpBody = $generate_united_marketplace_services_report_request; + $httpBody = $generate_united_netting_report_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6731,40 +8578,42 @@ class ReportsApi } /** - * Operation generateUnitedNettingReport + * Operation generateUnitedOrdersReport * - * Отчет по платежам + * Отчет по заказам * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedNettingReport($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) + public function generateUnitedOrdersReport($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - list($response) = $this->generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format, $contentType); + list($response) = $this->generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format, $language, $contentType); return $response; } /** - * Operation generateUnitedNettingReportWithHttpInfo + * Operation generateUnitedOrdersReportWithHttpInfo * - * Отчет по платежам + * Отчет по заказам * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedNettingReportWithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) + public function generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -6791,169 +8640,51 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6967,34 +8698,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -7004,7 +8712,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7012,7 +8720,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7020,7 +8728,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7028,7 +8736,15 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7036,7 +8752,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7044,27 +8760,30 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedNettingReportAsync + * Operation generateUnitedOrdersReportAsync * - * Отчет по платежам + * Отчет по заказам * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReportAsync($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) + public function generateUnitedOrdersReportAsync($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - return $this->generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format, $contentType) + return $this->generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -7073,21 +8792,22 @@ class ReportsApi } /** - * Operation generateUnitedNettingReportAsyncWithHttpInfo + * Operation generateUnitedOrdersReportAsyncWithHttpInfo * - * Отчет по платежам + * Отчет по заказам * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedNettingReportAsyncWithHttpInfo($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) + public function generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedNettingReportRequest($generate_united_netting_report_request, $format, $contentType); + $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7126,28 +8846,30 @@ class ReportsApi } /** - * Create request for operation 'generateUnitedNettingReport' + * Create request for operation 'generateUnitedOrdersReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedNettingReportRequest $generate_united_netting_report_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedNettingReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param \OpenAPI\Client\Model\ReportLanguageType|null $language Язык отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedNettingReportRequest($generate_united_netting_report_request, $format = null, string $contentType = self::contentTypes['generateUnitedNettingReport'][0]) + public function generateUnitedOrdersReportRequest($generate_united_orders_request, $format = null, $language = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) { - // verify the required parameter 'generate_united_netting_report_request' is set - if ($generate_united_netting_report_request === null || (is_array($generate_united_netting_report_request) && count($generate_united_netting_report_request) === 0)) { + // verify the required parameter 'generate_united_orders_request' is set + if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_netting_report_request when calling generateUnitedNettingReport' + 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport' ); } - $resourcePath = '/reports/united-netting/generate'; + + $resourcePath = '/v2/reports/united-orders/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7163,6 +8885,15 @@ class ReportsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $language, + 'language', // param base name + 'ReportLanguageType', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -7174,12 +8905,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_united_netting_report_request)) { + if (isset($generate_united_orders_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_netting_report_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); } else { - $httpBody = $generate_united_netting_report_request; + $httpBody = $generate_united_orders_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7237,40 +8968,40 @@ class ReportsApi } /** - * Operation generateUnitedOrdersReport + * Operation generateUnitedReturnsReport * - * Отчет по заказам + * Отчет по невыкупам и возвратам * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function generateUnitedOrdersReport($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) + public function generateUnitedReturnsReport($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - list($response) = $this->generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format, $contentType); + list($response) = $this->generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format, $contentType); return $response; } /** - * Operation generateUnitedOrdersReportWithHttpInfo + * Operation generateUnitedReturnsReportWithHttpInfo * - * Отчет по заказам + * Отчет по невыкупам и возвратам * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GenerateReportResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generateUnitedOrdersReportWithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) + public function generateUnitedReturnsReportWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $contentType); + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); try { $options = $this->createHttpClientOption(); @@ -7297,169 +9028,45 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GenerateReportResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GenerateReportResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GenerateReportResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -7473,34 +9080,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GenerateReportResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -7510,7 +9094,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7518,7 +9102,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7526,7 +9110,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7534,7 +9118,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7542,7 +9126,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -7550,27 +9134,29 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation generateUnitedOrdersReportAsync + * Operation generateUnitedReturnsReportAsync * - * Отчет по заказам + * Отчет по невыкупам и возвратам * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReportAsync($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) + public function generateUnitedReturnsReportAsync($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - return $this->generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format, $contentType) + return $this->generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format, $contentType) ->then( function ($response) { return $response[0]; @@ -7579,21 +9165,21 @@ class ReportsApi } /** - * Operation generateUnitedOrdersReportAsyncWithHttpInfo + * Operation generateUnitedReturnsReportAsyncWithHttpInfo * - * Отчет по заказам + * Отчет по невыкупам и возвратам * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateUnitedOrdersReportAsyncWithHttpInfo($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) + public function generateUnitedReturnsReportAsyncWithHttpInfo($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { $returnType = '\OpenAPI\Client\Model\GenerateReportResponse'; - $request = $this->generateUnitedOrdersReportRequest($generate_united_orders_request, $format, $contentType); + $request = $this->generateUnitedReturnsReportRequest($generate_united_returns_request, $format, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7632,28 +9218,28 @@ class ReportsApi } /** - * Create request for operation 'generateUnitedOrdersReport' + * Create request for operation 'generateUnitedReturnsReport' * - * @param \OpenAPI\Client\Model\GenerateUnitedOrdersRequest $generate_united_orders_request (required) - * @param \OpenAPI\Client\Model\ReportFormatType $format Формат отчета. (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedOrdersReport'] to see the possible values for this operation + * @param \OpenAPI\Client\Model\GenerateUnitedReturnsRequest $generate_united_returns_request (required) + * @param \OpenAPI\Client\Model\ReportFormatType|null $format Формат отчета или документа. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateUnitedReturnsReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateUnitedOrdersReportRequest($generate_united_orders_request, $format = null, string $contentType = self::contentTypes['generateUnitedOrdersReport'][0]) + public function generateUnitedReturnsReportRequest($generate_united_returns_request, $format = null, string $contentType = self::contentTypes['generateUnitedReturnsReport'][0]) { - // verify the required parameter 'generate_united_orders_request' is set - if ($generate_united_orders_request === null || (is_array($generate_united_orders_request) && count($generate_united_orders_request) === 0)) { + // verify the required parameter 'generate_united_returns_request' is set + if ($generate_united_returns_request === null || (is_array($generate_united_returns_request) && count($generate_united_returns_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generate_united_orders_request when calling generateUnitedOrdersReport' + 'Missing the required parameter $generate_united_returns_request when calling generateUnitedReturnsReport' ); } - $resourcePath = '/reports/united-orders/generate'; + $resourcePath = '/v2/reports/united-returns/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7680,12 +9266,12 @@ class ReportsApi ); // for model (json/xml) - if (isset($generate_united_orders_request)) { + if (isset($generate_united_returns_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_orders_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generate_united_returns_request)); } else { - $httpBody = $generate_united_orders_request; + $httpBody = $generate_united_returns_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7745,9 +9331,9 @@ class ReportsApi /** * Operation getReportInfo * - * Получение заданного отчета + * Получение заданного отчета или документа * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -7763,9 +9349,9 @@ class ReportsApi /** * Operation getReportInfoWithHttpInfo * - * Получение заданного отчета + * Получение заданного отчета или документа * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -7801,196 +9387,51 @@ class ReportsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReportInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReportInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReportInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -8004,34 +9445,11 @@ class ReportsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReportInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReportInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -8041,7 +9459,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8049,7 +9467,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8057,7 +9475,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8065,7 +9483,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8073,7 +9491,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8081,7 +9499,7 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -8089,8 +9507,10 @@ class ReportsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -8098,9 +9518,9 @@ class ReportsApi /** * Operation getReportInfoAsync * - * Получение заданного отчета + * Получение заданного отчета или документа * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -8119,9 +9539,9 @@ class ReportsApi /** * Operation getReportInfoAsyncWithHttpInfo * - * Получение заданного отчета + * Получение заданного отчета или документа * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -8171,7 +9591,7 @@ class ReportsApi /** * Create request for operation 'getReportInfo' * - * @param string $report_id Идентификатор отчета, который вы получили после запуска генерации. (required) + * @param string $report_id Идентификатор отчета или документа, который вы получили после запуска генерации. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -8186,9 +9606,15 @@ class ReportsApi 'Missing the required parameter $report_id when calling getReportInfo' ); } + if (strlen($report_id) > 255) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling ReportsApi.getReportInfo, must be smaller than or equal to 255.'); + } + if (strlen($report_id) < 1) { + throw new \InvalidArgumentException('invalid length for "$report_id" when calling ReportsApi.getReportInfo, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/reports/info/{reportId}'; + $resourcePath = '/v2/reports/info/{reportId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8285,6 +9711,57 @@ class ReportsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/ReturnsApi.php b/erp24/lib/yandex_market_api/Api/ReturnsApi.php index fcdbec16..aa3246b6 100644 --- a/erp24/lib/yandex_market_api/Api/ReturnsApi.php +++ b/erp24/lib/yandex_market_api/Api/ReturnsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -142,9 +145,9 @@ class ReturnsApi * * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -162,9 +165,9 @@ class ReturnsApi * * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -200,196 +203,51 @@ class ReturnsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -403,34 +261,11 @@ class ReturnsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -440,7 +275,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -448,7 +283,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -456,7 +291,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -464,7 +299,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -472,7 +307,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -480,7 +315,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -488,8 +323,10 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -499,9 +336,9 @@ class ReturnsApi * * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -522,9 +359,9 @@ class ReturnsApi * * Информация о невыкупе или возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -574,9 +411,9 @@ class ReturnsApi /** * Create request for operation 'getReturn' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturn'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -610,7 +447,7 @@ class ReturnsApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -712,9 +549,9 @@ class ReturnsApi * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -732,9 +569,9 @@ class ReturnsApi * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -770,196 +607,51 @@ class ReturnsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -973,34 +665,11 @@ class ReturnsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1010,7 +679,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1018,7 +687,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1026,7 +695,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1034,7 +703,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1042,7 +711,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1050,7 +719,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1058,8 +727,10 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1069,9 +740,9 @@ class ReturnsApi * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1092,9 +763,9 @@ class ReturnsApi * * Получение заявления на возврат * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1144,9 +815,9 @@ class ReturnsApi /** * Create request for operation 'getReturnApplication' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1180,7 +851,7 @@ class ReturnsApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/application'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1280,11 +951,11 @@ class ReturnsApi /** * Operation getReturnPhoto * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation @@ -1302,11 +973,11 @@ class ReturnsApi /** * Operation getReturnPhotoWithHttpInfo * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation @@ -1344,196 +1015,51 @@ class ReturnsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1547,34 +1073,11 @@ class ReturnsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1584,7 +1087,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1592,7 +1095,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1600,7 +1103,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1608,7 +1111,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1616,7 +1119,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1624,7 +1127,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1632,8 +1135,10 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1641,11 +1146,11 @@ class ReturnsApi /** * Operation getReturnPhotoAsync * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation @@ -1666,11 +1171,11 @@ class ReturnsApi /** * Operation getReturnPhotoAsyncWithHttpInfo * - * Получение фотографии возврата + * Получение фотографий товаров в возврате * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation @@ -1722,9 +1227,9 @@ class ReturnsApi /** * Create request for operation 'getReturnPhoto' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param int $item_id Идентификатор товара в возврате. (required) * @param string $image_hash Хеш ссылки изображения для загрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturnPhoto'] to see the possible values for this operation @@ -1774,7 +1279,7 @@ class ReturnsApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/{itemId}/image/{imageHash}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1892,25 +1397,26 @@ class ReturnsApi * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + public function getReturns($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + list($response) = $this->getReturnsWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $response; } @@ -1919,25 +1425,26 @@ class ReturnsApi * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetReturnsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + public function getReturnsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); try { $options = $this->createHttpClientOption(); @@ -1964,196 +1471,51 @@ class ReturnsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetReturnsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetReturnsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetReturnsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2167,34 +1529,11 @@ class ReturnsApi ); } - $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetReturnsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2204,7 +1543,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2212,7 +1551,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2220,7 +1559,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2228,7 +1567,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2236,7 +1575,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2244,7 +1583,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2252,8 +1591,10 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2263,24 +1604,25 @@ class ReturnsApi * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + public function getReturnsAsync($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { - return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) + return $this->getReturnsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType) ->then( function ($response) { return $response[0]; @@ -2293,25 +1635,26 @@ class ReturnsApi * * Список невыкупов и возвратов * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + public function getReturnsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { $returnType = '\OpenAPI\Client\Model\GetReturnsResponse'; - $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); + $request = $this->getReturnsRequest($campaign_id, $page_token, $limit, $order_ids, $statuses, $shipment_statuses, $type, $from_date, $to_date, $from_date2, $to_date2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2352,22 +1695,23 @@ class ReturnsApi /** * Create request for operation 'getReturns' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param int[] $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) - * @param \OpenAPI\Client\Model\RefundStatusType[] $statuses Статусы возвратов или невыкупов — для фильтрации результатов. Несколько статусов перечисляются через запятую. (optional) - * @param \OpenAPI\Client\Model\ReturnType $type Тип заказа для фильтрации: * `RETURN` — возврат. * `UNREDEEMED` — невыкуп. Если не указывать, в ответе будут и возвраты, и невыкупы. (optional) - * @param \DateTime $from_date Начальная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $to_date Конечная дата для фильтрации возвратов или невыкупов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) - * @param \DateTime $from_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `fromDate`. {% endnote %} Начальная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) - * @param \DateTime $to_date2 {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `toDate`. {% endnote %} Конечная дата для фильтрации возвратов или невыкупов по дате обновления. (optional) (deprecated) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param int[]|null $order_ids Идентификаторы заказов — для фильтрации результатов. Несколько идентификаторов перечисляются через запятую без пробела. (optional) + * @param \OpenAPI\Client\Model\RefundStatusType[]|null $statuses Фильтр по статусам возврата денег за возвраты. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $shipment_statuses Фильтр по логистическим статусам невыкупов и возвратов. Несколько статусов перечисляются через запятую. (optional) + * @param \OpenAPI\Client\Model\ReturnType|null $type Тип заказа для фильтрации: * `UNREDEEMED` — невыкуп. * `RETURN` — возврат. Если не указать, в ответе будут и невыкупы, и возвраты. (optional) + * @param \DateTime|null $from_date Начальная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $to_date Конечная дата для фильтрации невыкупов или возвратов по дате обновления. Формат: `ГГГГ-ММ-ДД`. (optional) + * @param \DateTime|null $from_date2 {% note warning \"Вместо него используйте `fromDate`.\" %}   {% endnote %} Начальная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) + * @param \DateTime|null $to_date2 {% note warning \"Вместо него используйте `toDate`.\" %}   {% endnote %} Конечная дата для фильтрации невыкупов или возвратов по дате обновления. (optional) (deprecated) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReturns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) + public function getReturnsRequest($campaign_id, $page_token = null, $limit = null, $order_ids = null, $statuses = null, $shipment_statuses = null, $type = null, $from_date = null, $to_date = null, $from_date2 = null, $to_date2 = null, string $contentType = self::contentTypes['getReturns'][0]) { // verify the required parameter 'campaign_id' is set @@ -2381,19 +1725,23 @@ class ReturnsApi } - + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ReturnsApi.getReturns, must be bigger than or equal to 1.'); + } + if ($order_ids !== null && count($order_ids) > 50) { throw new \InvalidArgumentException('invalid value for "$order_ids" when calling ReturnsApi.getReturns, number of items must be less than or equal to 50.'); } + - $resourcePath = '/campaigns/{campaignId}/returns'; + $resourcePath = '/v2/campaigns/{campaignId}/returns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2437,6 +1785,15 @@ class ReturnsApi false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $shipment_statuses, + 'shipmentStatuses', // param base name + 'array', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $type, 'type', // param base name @@ -2560,15 +1917,16 @@ class ReturnsApi * * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request set_return_decision_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ public function setReturnDecision($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { @@ -2581,15 +1939,16 @@ class ReturnsApi * * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function setReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { @@ -2620,196 +1979,51 @@ class ReturnsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2823,34 +2037,11 @@ class ReturnsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2860,7 +2051,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2868,7 +2059,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2876,7 +2067,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2884,7 +2075,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2892,7 +2083,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2900,7 +2091,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2908,8 +2099,10 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2919,14 +2112,15 @@ class ReturnsApi * * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function setReturnDecisionAsync($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { @@ -2943,14 +2137,15 @@ class ReturnsApi * * Принятие или изменение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function setReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { @@ -2996,14 +2191,15 @@ class ReturnsApi /** * Create request for operation 'setReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) * @param \OpenAPI\Client\Model\SetReturnDecisionRequest $set_return_decision_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ public function setReturnDecisionRequest($campaign_id, $order_id, $return_id, $set_return_decision_request, string $contentType = self::contentTypes['setReturnDecision'][0]) { @@ -3040,7 +2236,7 @@ class ReturnsApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision'; + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3147,40 +2343,42 @@ class ReturnsApi /** * Operation submitReturnDecision * - * Подтверждение решения по возврату + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function submitReturnDecision($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision'][0]) + public function submitReturnDecision($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - list($response) = $this->submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $contentType); + list($response) = $this->submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $response; } /** * Operation submitReturnDecisionWithHttpInfo * - * Подтверждение решения по возврату + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmptyApiResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision'][0]) + public function submitReturnDecisionWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3207,196 +2405,51 @@ class ReturnsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3410,34 +2463,11 @@ class ReturnsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3447,7 +2477,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3455,7 +2485,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3463,7 +2493,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3471,7 +2501,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3479,7 +2509,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3487,7 +2517,7 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3495,8 +2525,10 @@ class ReturnsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3504,19 +2536,20 @@ class ReturnsApi /** * Operation submitReturnDecisionAsync * - * Подтверждение решения по возврату + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function submitReturnDecisionAsync($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision'][0]) + public function submitReturnDecisionAsync($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { - return $this->submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $contentType) + return $this->submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3527,20 +2560,21 @@ class ReturnsApi /** * Operation submitReturnDecisionAsyncWithHttpInfo * - * Подтверждение решения по возврату + * Передача и подтверждение решения по возврату * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision'][0]) + public function submitReturnDecisionAsyncWithHttpInfo($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $contentType); + $request = $this->submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3581,15 +2615,16 @@ class ReturnsApi /** * Create request for operation 'submitReturnDecision' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $order_id Идентификатор заказа. (required) - * @param int $return_id Идентификатор возврата. (required) + * @param int $return_id Идентификатор невыкупа или возврата. (required) + * @param \OpenAPI\Client\Model\SubmitReturnDecisionRequest|null $submit_return_decision_request description (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['submitReturnDecision'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function submitReturnDecisionRequest($campaign_id, $order_id, $return_id, string $contentType = self::contentTypes['submitReturnDecision'][0]) + public function submitReturnDecisionRequest($campaign_id, $order_id, $return_id, $submit_return_decision_request = null, string $contentType = self::contentTypes['submitReturnDecision'][0]) { // verify the required parameter 'campaign_id' is set @@ -3617,7 +2652,8 @@ class ReturnsApi } - $resourcePath = '/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; + + $resourcePath = '/v2/campaigns/{campaignId}/orders/{orderId}/returns/{returnId}/decision/submit'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3659,7 +2695,14 @@ class ReturnsApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($submit_return_decision_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($submit_return_decision_request)); + } else { + $httpBody = $submit_return_decision_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -3730,6 +2773,57 @@ class ReturnsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/ShipmentsApi.php b/erp24/lib/yandex_market_api/Api/ShipmentsApi.php index 0bae488e..4c0c9c40 100644 --- a/erp24/lib/yandex_market_api/Api/ShipmentsApi.php +++ b/erp24/lib/yandex_market_api/Api/ShipmentsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -160,9 +163,9 @@ class ShipmentsApi * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request confirm_shipment_request (optional) + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request confirm_shipment_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -180,9 +183,9 @@ class ShipmentsApi * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -218,196 +221,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -421,34 +279,11 @@ class ShipmentsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -458,7 +293,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -466,7 +301,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -474,7 +309,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -482,7 +317,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -490,7 +325,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -498,7 +333,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -506,8 +341,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -517,9 +354,9 @@ class ShipmentsApi * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -540,9 +377,9 @@ class ShipmentsApi * * Подтверждение отгрузки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -592,9 +429,9 @@ class ShipmentsApi /** * Create request for operation 'confirmShipment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ConfirmShipmentRequest $confirm_shipment_request (optional) + * @param \OpenAPI\Client\Model\ConfirmShipmentRequest|null $confirm_shipment_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['confirmShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -625,7 +462,7 @@ class ShipmentsApi - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/confirm'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/confirm'; $formParams = []; $queryParams = []; $headerParams = []; @@ -726,7 +563,7 @@ class ShipmentsApi * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * @@ -745,7 +582,7 @@ class ShipmentsApi * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * @@ -782,196 +619,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -985,34 +677,11 @@ class ShipmentsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1022,7 +691,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1030,7 +699,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1038,7 +707,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1046,7 +715,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1054,7 +723,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1062,7 +731,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1070,8 +739,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1081,7 +752,7 @@ class ShipmentsApi * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * @@ -1103,7 +774,7 @@ class ShipmentsApi * * Получение акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * @@ -1154,7 +825,7 @@ class ShipmentsApi /** * Create request for operation 'downloadShipmentAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentAct'] to see the possible values for this operation * @@ -1185,7 +856,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/act'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1279,7 +950,7 @@ class ShipmentsApi * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * @@ -1298,7 +969,7 @@ class ShipmentsApi * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * @@ -1335,196 +1006,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1538,34 +1064,11 @@ class ShipmentsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1575,7 +1078,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1583,7 +1086,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1591,7 +1094,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1599,7 +1102,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1607,7 +1110,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1615,7 +1118,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1623,8 +1126,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1634,7 +1139,7 @@ class ShipmentsApi * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * @@ -1656,7 +1161,7 @@ class ShipmentsApi * * Получение акта расхождений * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * @@ -1707,7 +1212,7 @@ class ShipmentsApi /** * Create request for operation 'downloadShipmentDiscrepancyAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentDiscrepancyAct'] to see the possible values for this operation * @@ -1738,7 +1243,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/discrepancy-act'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/discrepancy-act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1832,7 +1337,7 @@ class ShipmentsApi * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * @@ -1851,7 +1356,7 @@ class ShipmentsApi * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * @@ -1888,196 +1393,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2091,34 +1451,11 @@ class ShipmentsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2128,7 +1465,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2136,7 +1473,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2144,7 +1481,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2152,7 +1489,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2160,7 +1497,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2168,7 +1505,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2176,8 +1513,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2187,7 +1526,7 @@ class ShipmentsApi * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * @@ -2209,7 +1548,7 @@ class ShipmentsApi * * Получение фактического акта приема-передачи * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * @@ -2260,7 +1599,7 @@ class ShipmentsApi /** * Create request for operation 'downloadShipmentInboundAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentInboundAct'] to see the possible values for this operation * @@ -2291,7 +1630,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/inbound-act'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/inbound-act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2383,11 +1722,11 @@ class ShipmentsApi /** * Operation downloadShipmentPalletLabels * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2403,11 +1742,11 @@ class ShipmentsApi /** * Operation downloadShipmentPalletLabelsWithHttpInfo * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -2443,196 +1782,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2646,34 +1840,11 @@ class ShipmentsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2683,7 +1854,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2691,7 +1862,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2699,7 +1870,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2707,7 +1878,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2715,7 +1886,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2723,7 +1894,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2731,8 +1902,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2740,11 +1913,11 @@ class ShipmentsApi /** * Operation downloadShipmentPalletLabelsAsync * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2763,11 +1936,11 @@ class ShipmentsApi /** * Operation downloadShipmentPalletLabelsAsyncWithHttpInfo * - * Ярлыки для доверительной приемки (FBS) + * Ярлыки для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2817,9 +1990,9 @@ class ShipmentsApi /** * Create request for operation 'downloadShipmentPalletLabels' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) + * @param \OpenAPI\Client\Model\ShipmentPalletLabelPageFormatType|null $format Формат страниц PDF-файла с ярлыками: * `A4` — по 16 ярлыков на странице. * `A8` — по одному ярлыку на странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentPalletLabels'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2850,7 +2023,7 @@ class ShipmentsApi - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallet/labels'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallet/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2953,17 +2126,18 @@ class ShipmentsApi * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function downloadShipmentReceptionTransferAct($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) + public function downloadShipmentReceptionTransferAct($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { - list($response) = $this->downloadShipmentReceptionTransferActWithHttpInfo($campaign_id, $warehouse_id, $contentType); + list($response) = $this->downloadShipmentReceptionTransferActWithHttpInfo($campaign_id, $warehouse_id, $signatory, $contentType); return $response; } @@ -2972,17 +2146,18 @@ class ShipmentsApi * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \SplFileObject|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function downloadShipmentReceptionTransferActWithHttpInfo($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) + public function downloadShipmentReceptionTransferActWithHttpInfo($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { - $request = $this->downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id, $contentType); + $request = $this->downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id, $signatory, $contentType); try { $options = $this->createHttpClientOption(); @@ -3009,196 +2184,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3212,34 +2242,11 @@ class ShipmentsApi ); } - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3249,7 +2256,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3257,7 +2264,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3265,7 +2272,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3273,7 +2280,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3281,7 +2288,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3289,7 +2296,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3297,8 +2304,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3308,16 +2317,17 @@ class ShipmentsApi * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentReceptionTransferActAsync($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) + public function downloadShipmentReceptionTransferActAsync($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { - return $this->downloadShipmentReceptionTransferActAsyncWithHttpInfo($campaign_id, $warehouse_id, $contentType) + return $this->downloadShipmentReceptionTransferActAsyncWithHttpInfo($campaign_id, $warehouse_id, $signatory, $contentType) ->then( function ($response) { return $response[0]; @@ -3330,17 +2340,18 @@ class ShipmentsApi * * Подтверждение ближайшей отгрузки и получение акта приема-передачи для нее * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadShipmentReceptionTransferActAsyncWithHttpInfo($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) + public function downloadShipmentReceptionTransferActAsyncWithHttpInfo($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { $returnType = '\SplFileObject'; - $request = $this->downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id, $contentType); + $request = $this->downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id, $signatory, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3381,14 +2392,15 @@ class ShipmentsApi /** * Create request for operation 'downloadShipmentReceptionTransferAct' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param int $warehouse_id Идентификатор склада. (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param int|null $warehouse_id Идентификатор склада. (optional) + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. {% note info \"Электронная подпись\" %} Если вы указываете параметр `signatory`, акт приема-передачи подписывается электронной подписью и становится электронным документом. В этом случае печатать и подписывать акт вручную не требуется — он уже имеет юридическую силу в электронном виде. Подробнее о работе с актами приема-передачи читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/fbs/process#act). {% endnote %} Где найти логин: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в правом верхнем углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentReceptionTransferAct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) + public function downloadShipmentReceptionTransferActRequest($campaign_id, $warehouse_id = null, $signatory = null, string $contentType = self::contentTypes['downloadShipmentReceptionTransferAct'][0]) { // verify the required parameter 'campaign_id' is set @@ -3406,7 +2418,8 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/shipments/reception-transfer-act'; + + $resourcePath = '/v2/campaigns/{campaignId}/shipments/reception-transfer-act'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3422,6 +2435,15 @@ class ShipmentsApi false, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $signatory, + 'signatory', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -3501,7 +2523,7 @@ class ShipmentsApi * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * @@ -3520,7 +2542,7 @@ class ShipmentsApi * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * @@ -3557,237 +2579,69 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\SplFileObject'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3797,7 +2651,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3805,7 +2659,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3813,7 +2667,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3821,7 +2675,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3829,7 +2683,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3837,7 +2691,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3845,8 +2699,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3856,7 +2712,7 @@ class ShipmentsApi * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * @@ -3878,7 +2734,7 @@ class ShipmentsApi * * Получение транспортной накладной * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * @@ -3929,7 +2785,7 @@ class ShipmentsApi /** * Create request for operation 'downloadShipmentTransportationWaybill' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadShipmentTransportationWaybill'] to see the possible values for this operation * @@ -3960,7 +2816,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/transportation-waybill'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/transportation-waybill'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4054,9 +2910,9 @@ class ShipmentsApi * * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -4074,9 +2930,9 @@ class ShipmentsApi * * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -4112,196 +2968,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetShipmentResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetShipmentResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetShipmentResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4315,34 +3026,11 @@ class ShipmentsApi ); } - $returnType = '\OpenAPI\Client\Model\GetShipmentResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4352,7 +3040,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4360,7 +3048,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4368,7 +3056,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4376,7 +3064,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4384,7 +3072,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4392,7 +3080,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4400,8 +3088,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -4411,9 +3101,9 @@ class ShipmentsApi * * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4434,9 +3124,9 @@ class ShipmentsApi * * Получение информации об одной отгрузке * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4486,9 +3176,9 @@ class ShipmentsApi /** * Create request for operation 'getShipment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) - * @param bool $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. (optional, default to true) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipment'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -4519,7 +3209,7 @@ class ShipmentsApi - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4620,9 +3310,9 @@ class ShipmentsApi /** * Operation getShipmentOrdersInfo * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * @@ -4639,9 +3329,9 @@ class ShipmentsApi /** * Operation getShipmentOrdersInfoWithHttpInfo * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * @@ -4678,196 +3368,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4881,34 +3426,11 @@ class ShipmentsApi ); } - $returnType = '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetShipmentOrdersInfoResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4918,7 +3440,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4926,7 +3448,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4934,7 +3456,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4942,7 +3464,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4950,7 +3472,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4958,7 +3480,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4966,8 +3488,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -4975,9 +3499,9 @@ class ShipmentsApi /** * Operation getShipmentOrdersInfoAsync * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * @@ -4997,9 +3521,9 @@ class ShipmentsApi /** * Operation getShipmentOrdersInfoAsyncWithHttpInfo * - * Получение информации о возможности печати ярлыков (FBS) + * Получение информации о возможности печати ярлыков * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * @@ -5050,7 +3574,7 @@ class ShipmentsApi /** * Create request for operation 'getShipmentOrdersInfo' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getShipmentOrdersInfo'] to see the possible values for this operation * @@ -5081,7 +3605,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/info'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5175,10 +3699,10 @@ class ShipmentsApi * * Получение информации о нескольких отгрузках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -5196,10 +3720,10 @@ class ShipmentsApi * * Получение информации о нескольких отгрузках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -5235,196 +3759,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SearchShipmentsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\SearchShipmentsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SearchShipmentsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SearchShipmentsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5438,34 +3817,11 @@ class ShipmentsApi ); } - $returnType = '\OpenAPI\Client\Model\SearchShipmentsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\SearchShipmentsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5475,7 +3831,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5483,7 +3839,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5491,7 +3847,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5499,7 +3855,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5507,7 +3863,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5515,7 +3871,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5523,8 +3879,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -5534,10 +3892,10 @@ class ShipmentsApi * * Получение информации о нескольких отгрузках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5558,10 +3916,10 @@ class ShipmentsApi * * Получение информации о нескольких отгрузках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5611,10 +3969,10 @@ class ShipmentsApi /** * Create request for operation 'searchShipments' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\SearchShipmentsRequest $search_shipments_request (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchShipments'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -5641,9 +3999,12 @@ class ShipmentsApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ShipmentsApi.searchShipments, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5752,9 +4113,9 @@ class ShipmentsApi /** * Operation setShipmentPalletsCount * - * Передача количества упаковок в отгрузке + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request set_shipment_pallets_count_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation @@ -5772,9 +4133,9 @@ class ShipmentsApi /** * Operation setShipmentPalletsCountWithHttpInfo * - * Передача количества упаковок в отгрузке + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation @@ -5812,196 +4173,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6015,34 +4231,11 @@ class ShipmentsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -6052,7 +4245,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6060,7 +4253,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6068,7 +4261,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6076,7 +4269,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6084,7 +4277,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6092,7 +4285,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6100,8 +4293,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -6109,9 +4304,9 @@ class ShipmentsApi /** * Operation setShipmentPalletsCountAsync * - * Передача количества упаковок в отгрузке + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation @@ -6132,9 +4327,9 @@ class ShipmentsApi /** * Operation setShipmentPalletsCountAsyncWithHttpInfo * - * Передача количества упаковок в отгрузке + * Передача количества упаковок для доверительной приемки * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation @@ -6186,7 +4381,7 @@ class ShipmentsApi /** * Create request for operation 'setShipmentPalletsCount' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\SetShipmentPalletsCountRequest $set_shipment_pallets_count_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setShipmentPalletsCount'] to see the possible values for this operation @@ -6225,7 +4420,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallets'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/pallets'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6326,7 +4521,7 @@ class ShipmentsApi * * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request transfer_orders_from_shipment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation @@ -6346,7 +4541,7 @@ class ShipmentsApi * * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation @@ -6384,196 +4579,51 @@ class ShipmentsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -6587,34 +4637,11 @@ class ShipmentsApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -6624,7 +4651,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6632,7 +4659,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6640,7 +4667,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6648,7 +4675,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6656,7 +4683,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6664,7 +4691,7 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -6672,8 +4699,10 @@ class ShipmentsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -6683,7 +4712,7 @@ class ShipmentsApi * * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation @@ -6706,7 +4735,7 @@ class ShipmentsApi * * Перенос заказов в следующую отгрузку * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation @@ -6758,7 +4787,7 @@ class ShipmentsApi /** * Create request for operation 'transferOrdersFromShipment' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param int $shipment_id Идентификатор отгрузки. (required) * @param \OpenAPI\Client\Model\TransferOrdersFromShipmentRequest $transfer_orders_from_shipment_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['transferOrdersFromShipment'] to see the possible values for this operation @@ -6797,7 +4826,7 @@ class ShipmentsApi } - $resourcePath = '/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/transfer'; + $resourcePath = '/v2/campaigns/{campaignId}/first-mile/shipments/{shipmentId}/orders/transfer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6909,6 +4938,57 @@ class ShipmentsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/StocksApi.php b/erp24/lib/yandex_market_api/Api/StocksApi.php index ed1c5b27..91285c8d 100644 --- a/erp24/lib/yandex_market_api/Api/StocksApi.php +++ b/erp24/lib/yandex_market_api/Api/StocksApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -130,10 +133,10 @@ class StocksApi * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request get_warehouse_stocks_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request get_warehouse_stocks_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -151,10 +154,10 @@ class StocksApi * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format @@ -190,169 +193,45 @@ class StocksApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehouseStocksResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehouseStocksResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -366,34 +245,11 @@ class StocksApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehouseStocksResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehouseStocksResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -403,7 +259,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -411,7 +267,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -419,7 +275,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -427,7 +283,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -435,7 +291,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -443,8 +299,10 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -454,10 +312,10 @@ class StocksApi * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -478,10 +336,10 @@ class StocksApi * * Информация об остатках и оборачиваемости * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -531,10 +389,10 @@ class StocksApi /** * Create request for operation 'getStocks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуется передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `offset`, `page_number` и `page_size`, они игнорируются. (optional) - * @param int $limit Количество значений на одной странице. (optional) - * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest $get_warehouse_stocks_request (optional) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetWarehouseStocksRequest|null $get_warehouse_stocks_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStocks'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -554,10 +412,13 @@ class StocksApi } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling StocksApi.getStocks, must be bigger than or equal to 1.'); + } + - - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -668,7 +529,7 @@ class StocksApi * * Передача информации об остатках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request update_stocks_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * @@ -687,7 +548,7 @@ class StocksApi * * Передача информации об остатках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * @@ -724,196 +585,51 @@ class StocksApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\EmptyApiResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\EmptyApiResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\EmptyApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -927,34 +643,11 @@ class StocksApi ); } - $returnType = '\OpenAPI\Client\Model\EmptyApiResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\EmptyApiResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -964,7 +657,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -972,7 +665,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -980,7 +673,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -988,7 +681,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -996,7 +689,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1004,7 +697,7 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1012,8 +705,10 @@ class StocksApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1023,7 +718,7 @@ class StocksApi * * Передача информации об остатках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * @@ -1045,7 +740,7 @@ class StocksApi * * Передача информации об остатках * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * @@ -1096,7 +791,7 @@ class StocksApi /** * Create request for operation 'updateStocks' * - * @param int $campaign_id Идентификатор кампании в API и магазина в кабинете. Каждая кампания в API соответствует магазину в кабинете. Чтобы узнать идентификаторы своих магазинов, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) * @param \OpenAPI\Client\Model\UpdateStocksRequest $update_stocks_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStocks'] to see the possible values for this operation * @@ -1124,7 +819,7 @@ class StocksApi } - $resourcePath = '/campaigns/{campaignId}/offers/stocks'; + $resourcePath = '/v2/campaigns/{campaignId}/offers/stocks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1228,6 +923,57 @@ class StocksApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/SupplyRequestsApi.php b/erp24/lib/yandex_market_api/Api/SupplyRequestsApi.php new file mode 100644 index 00000000..103ff86a --- /dev/null +++ b/erp24/lib/yandex_market_api/Api/SupplyRequestsApi.php @@ -0,0 +1,1398 @@ + [ + 'application/json', + ], + 'getSupplyRequestItems' => [ + 'application/json', + ], + 'getSupplyRequests' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getSupplyRequestDocuments + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getSupplyRequestDocuments($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + list($response) = $this->getSupplyRequestDocumentsWithHttpInfo($campaign_id, $get_supply_request_documents_request, $contentType); + return $response; + } + + /** + * Operation getSupplyRequestDocumentsWithHttpInfo + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSupplyRequestDocumentsWithHttpInfo($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + $request = $this->getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSupplyRequestDocumentsAsync + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestDocumentsAsync($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + return $this->getSupplyRequestDocumentsAsyncWithHttpInfo($campaign_id, $get_supply_request_documents_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSupplyRequestDocumentsAsyncWithHttpInfo + * + * Получение документов по заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestDocumentsAsyncWithHttpInfo($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestDocumentsResponse'; + $request = $this->getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSupplyRequestDocuments' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsRequest $get_supply_request_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSupplyRequestDocumentsRequest($campaign_id, $get_supply_request_documents_request, string $contentType = self::contentTypes['getSupplyRequestDocuments'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getSupplyRequestDocuments' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling SupplyRequestsApi.getSupplyRequestDocuments, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_supply_request_documents_request' is set + if ($get_supply_request_documents_request === null || (is_array($get_supply_request_documents_request) && count($get_supply_request_documents_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_supply_request_documents_request when calling getSupplyRequestDocuments' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_supply_request_documents_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_request_documents_request)); + } else { + $httpBody = $get_supply_request_documents_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSupplyRequestItems + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetSupplyRequestItemsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getSupplyRequestItems($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + list($response) = $this->getSupplyRequestItemsWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); + return $response; + } + + /** + * Operation getSupplyRequestItemsWithHttpInfo + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetSupplyRequestItemsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSupplyRequestItemsWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + $request = $this->getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSupplyRequestItemsAsync + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestItemsAsync($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + return $this->getSupplyRequestItemsAsyncWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSupplyRequestItemsAsyncWithHttpInfo + * + * Получение товаров в заявке на поставку, вывоз или утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestItemsAsyncWithHttpInfo($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestItemsResponse'; + $request = $this->getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSupplyRequestItems' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsRequest $get_supply_request_items_request (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequestItems'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSupplyRequestItemsRequest($campaign_id, $get_supply_request_items_request, $page_token = null, $limit = null, string $contentType = self::contentTypes['getSupplyRequestItems'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getSupplyRequestItems' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling SupplyRequestsApi.getSupplyRequestItems, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'get_supply_request_items_request' is set + if ($get_supply_request_items_request === null || (is_array($get_supply_request_items_request) && count($get_supply_request_items_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $get_supply_request_items_request when calling getSupplyRequestItems' + ); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SupplyRequestsApi.getSupplyRequestItems, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests/items'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_supply_request_items_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_request_items_request)); + } else { + $httpBody = $get_supply_request_items_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSupplyRequests + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetSupplyRequestsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function getSupplyRequests($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + list($response) = $this->getSupplyRequestsWithHttpInfo($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); + return $response; + } + + /** + * Operation getSupplyRequestsWithHttpInfo + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetSupplyRequestsResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSupplyRequestsWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + $request = $this->getSupplyRequestsRequest($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetSupplyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSupplyRequestsAsync + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestsAsync($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + return $this->getSupplyRequestsAsyncWithHttpInfo($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSupplyRequestsAsyncWithHttpInfo + * + * Получение информации о заявках на поставку, вывоз и утилизацию + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSupplyRequestsAsyncWithHttpInfo($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetSupplyRequestsResponse'; + $request = $this->getSupplyRequestsRequest($campaign_id, $page_token, $limit, $get_supply_requests_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSupplyRequests' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetSupplyRequestsRequest|null $get_supply_requests_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSupplyRequests'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSupplyRequestsRequest($campaign_id, $page_token = null, $limit = null, $get_supply_requests_request = null, string $contentType = self::contentTypes['getSupplyRequests'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling getSupplyRequests' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling SupplyRequestsApi.getSupplyRequests, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SupplyRequestsApi.getSupplyRequests, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/v2/campaigns/{campaignId}/supply-requests'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($get_supply_requests_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_supply_requests_request)); + } else { + $httpBody = $get_supply_requests_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/erp24/lib/yandex_market_api/Api/TariffsApi.php b/erp24/lib/yandex_market_api/Api/TariffsApi.php index 42c1700f..073af829 100644 --- a/erp24/lib/yandex_market_api/Api/TariffsApi.php +++ b/erp24/lib/yandex_market_api/Api/TariffsApi.php @@ -1,7 +1,7 @@ client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -181,196 +184,51 @@ class TariffsApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\CalculateTariffsResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CalculateTariffsResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -384,34 +242,11 @@ class TariffsApi ); } - $returnType = '\OpenAPI\Client\Model\CalculateTariffsResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\CalculateTariffsResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -421,7 +256,7 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -429,7 +264,7 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -437,7 +272,7 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -445,7 +280,7 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -453,7 +288,7 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -461,7 +296,7 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -469,8 +304,10 @@ class TariffsApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -568,7 +405,7 @@ class TariffsApi } - $resourcePath = '/tariffs/calculate'; + $resourcePath = '/v2/tariffs/calculate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -664,6 +501,57 @@ class TariffsApi } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/Api/WarehousesApi.php b/erp24/lib/yandex_market_api/Api/WarehousesApi.php index 055293bc..194b106e 100644 --- a/erp24/lib/yandex_market_api/Api/WarehousesApi.php +++ b/erp24/lib/yandex_market_api/Api/WarehousesApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], + 'getPagedWarehouses' => [ + 'application/json', + ], 'getWarehouses' => [ 'application/json', ], + 'updateWarehouseStatus' => [ + 'application/json', + ], ]; /** @@ -86,10 +95,10 @@ class WarehousesApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: Configuration::getDefaultConfiguration(); @@ -128,34 +137,36 @@ class WarehousesApi /** * Operation getFulfillmentWarehouses * - * Идентификаторы складов Маркета (FBY) + * Идентификаторы складов Маркета * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getFulfillmentWarehouses(string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + public function getFulfillmentWarehouses($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - list($response) = $this->getFulfillmentWarehousesWithHttpInfo($contentType); + list($response) = $this->getFulfillmentWarehousesWithHttpInfo($campaign_id, $contentType); return $response; } /** * Operation getFulfillmentWarehousesWithHttpInfo * - * Идентификаторы складов Маркета (FBY) + * Идентификаторы складов Маркета * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\GetFulfillmentWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getFulfillmentWarehousesWithHttpInfo(string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + public function getFulfillmentWarehousesWithHttpInfo($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - $request = $this->getFulfillmentWarehousesRequest($contentType); + $request = $this->getFulfillmentWarehousesRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -182,196 +193,51 @@ class WarehousesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -385,34 +251,11 @@ class WarehousesApi ); } - $returnType = '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -422,7 +265,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -430,7 +273,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -438,7 +281,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -446,7 +289,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -454,7 +297,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -462,7 +305,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -470,8 +313,10 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -479,16 +324,17 @@ class WarehousesApi /** * Operation getFulfillmentWarehousesAsync * - * Идентификаторы складов Маркета (FBY) + * Идентификаторы складов Маркета * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFulfillmentWarehousesAsync(string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + public function getFulfillmentWarehousesAsync($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { - return $this->getFulfillmentWarehousesAsyncWithHttpInfo($contentType) + return $this->getFulfillmentWarehousesAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -499,17 +345,18 @@ class WarehousesApi /** * Operation getFulfillmentWarehousesAsyncWithHttpInfo * - * Идентификаторы складов Маркета (FBY) + * Идентификаторы складов Маркета * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFulfillmentWarehousesAsyncWithHttpInfo(string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + public function getFulfillmentWarehousesAsyncWithHttpInfo($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { $returnType = '\OpenAPI\Client\Model\GetFulfillmentWarehousesResponse'; - $request = $this->getFulfillmentWarehousesRequest($contentType); + $request = $this->getFulfillmentWarehousesRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -550,22 +397,36 @@ class WarehousesApi /** * Create request for operation 'getFulfillmentWarehouses' * + * @param int|null $campaign_id Идентификатор кампании магазина. Указывается, если нужно вернуть все склады Маркета, которые привязаны к определенной кампании магазина. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFulfillmentWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getFulfillmentWarehousesRequest(string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) + public function getFulfillmentWarehousesRequest($campaign_id = null, string $contentType = self::contentTypes['getFulfillmentWarehouses'][0]) { + if ($campaign_id !== null && $campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling WarehousesApi.getFulfillmentWarehouses, must be bigger than or equal to 1.'); + } + - $resourcePath = '/warehouses'; + $resourcePath = '/v2/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $campaign_id, + 'campaignId', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -633,38 +494,44 @@ class WarehousesApi } /** - * Operation getWarehouses + * Operation getPagedWarehouses * - * Список складов и групп складов + * Список складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @return \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse */ - public function getWarehouses($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + public function getPagedWarehouses($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - list($response) = $this->getWarehousesWithHttpInfo($business_id, $contentType); + list($response) = $this->getPagedWarehousesWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); return $response; } /** - * Operation getWarehousesWithHttpInfo + * Operation getPagedWarehousesWithHttpInfo * - * Список складов и групп складов + * Список складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\GetPagedWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getWarehousesWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + public function getPagedWarehousesWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - $request = $this->getWarehousesRequest($business_id, $contentType); + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -691,196 +558,45 @@ class WarehousesApi switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\GetWarehousesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\GetWarehousesResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetWarehousesResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); case 400: - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiClientDataErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiClientDataErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); case 401: - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); case 403: - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiForbiddenErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiNotFoundErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); case 420: - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiLimitErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiLimitErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); case 500: - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\OpenAPI\Client\Model\ApiServerErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiServerErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -894,44 +610,21 @@ class WarehousesApi ); } - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\GetWarehousesResponse', + '\OpenAPI\Client\Model\GetPagedWarehousesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -939,7 +632,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -947,7 +640,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -955,15 +648,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; case 420: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -971,7 +656,7 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -979,26 +664,31 @@ class WarehousesApi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getWarehousesAsync + * Operation getPagedWarehousesAsync * - * Список складов и групп складов + * Список складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWarehousesAsync($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + public function getPagedWarehousesAsync($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - return $this->getWarehousesAsyncWithHttpInfo($business_id, $contentType) + return $this->getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1007,20 +697,23 @@ class WarehousesApi } /** - * Operation getWarehousesAsyncWithHttpInfo + * Operation getPagedWarehousesAsyncWithHttpInfo * - * Список складов и групп складов + * Список складов * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getWarehousesAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + public function getPagedWarehousesAsyncWithHttpInfo($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { - $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; - $request = $this->getWarehousesRequest($business_id, $contentType); + $returnType = '\OpenAPI\Client\Model\GetPagedWarehousesResponse'; + $request = $this->getPagedWarehousesRequest($business_id, $page_token, $limit, $get_paged_warehouses_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1059,35 +752,62 @@ class WarehousesApi } /** - * Create request for operation 'getWarehouses' + * Create request for operation 'getPagedWarehouses' * - * @param int $business_id Идентификатор кабинета. Чтобы узнать идентификатор, воспользуйтесь запросом [GET campaigns](../../reference/campaigns/getCampaigns.md#businessdto). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string|null $page_token Идентификатор страницы c результатами. Если параметр не указан, возвращается первая страница. Рекомендуем передавать значение выходного параметра `nextPageToken`, полученное при последнем запросе. Если задан `page_token` и в запросе есть параметры `page` и `pageSize`, они игнорируются. (optional) + * @param int|null $limit Количество значений на одной странице. (optional) + * @param \OpenAPI\Client\Model\GetPagedWarehousesRequest|null $get_paged_warehouses_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPagedWarehouses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getWarehousesRequest($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + public function getPagedWarehousesRequest($business_id, $page_token = null, $limit = null, $get_paged_warehouses_request = null, string $contentType = self::contentTypes['getPagedWarehouses'][0]) { // verify the required parameter 'business_id' is set if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $business_id when calling getWarehouses' + 'Missing the required parameter $business_id when calling getPagedWarehouses' ); } if ($business_id < 1) { - throw new \InvalidArgumentException('invalid value for "$business_id" when calling WarehousesApi.getWarehouses, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException('invalid value for "$business_id" when calling WarehousesApi.getPagedWarehouses, must be bigger than or equal to 1.'); + } + + + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling WarehousesApi.getPagedWarehouses, must be bigger than or equal to 1.'); } - $resourcePath = '/businesses/{businessId}/warehouses'; + + $resourcePath = '/v2/businesses/{businessId}/warehouses'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_token, + 'page_token', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // path params @@ -1107,7 +827,14 @@ class WarehousesApi ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($get_paged_warehouses_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($get_paged_warehouses_request)); + } else { + $httpBody = $get_paged_warehouses_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1155,7 +882,7 @@ class WarehousesApi $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1163,21 +890,810 @@ class WarehousesApi } /** - * Create http client option + * Operation getWarehouses * - * @throws \RuntimeException on file opening failure - * @return array of http client options + * Список складов и групп складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + * @deprecated */ - protected function createHttpClientOption() + public function getWarehouses($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + list($response) = $this->getWarehousesWithHttpInfo($business_id, $contentType); + return $response; + } + + /** + * Operation getWarehousesWithHttpInfo + * + * Список складов и групп складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\GetWarehousesResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiNotFoundErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getWarehousesWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + { + $request = $this->getWarehousesRequest($business_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\GetWarehousesResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\GetWarehousesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiNotFoundErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getWarehousesAsync + * + * Список складов и групп складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWarehousesAsync($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + { + return $this->getWarehousesAsyncWithHttpInfo($business_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWarehousesAsyncWithHttpInfo + * + * Список складов и групп складов + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWarehousesAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + { + $returnType = '\OpenAPI\Client\Model\GetWarehousesResponse'; + $request = $this->getWarehousesRequest($business_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWarehouses' + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getWarehouses'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getWarehousesRequest($business_id, string $contentType = self::contentTypes['getWarehouses'][0]) + { + + // verify the required parameter 'business_id' is set + if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $business_id when calling getWarehouses' + ); + } + if ($business_id < 1) { + throw new \InvalidArgumentException('invalid value for "$business_id" when calling WarehousesApi.getWarehouses, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/v2/businesses/{businessId}/warehouses'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($business_id !== null) { + $resourcePath = str_replace( + '{' . 'businessId' . '}', + ObjectSerializer::toPathValue($business_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateWarehouseStatus + * + * Изменение статуса склада + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse + */ + public function updateWarehouseStatus($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) + { + list($response) = $this->updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType); + return $response; + } + + /** + * Operation updateWarehouseStatusWithHttpInfo + * + * Изменение статуса склада + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\UpdateWarehouseStatusResponse|\OpenAPI\Client\Model\ApiClientDataErrorResponse|\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse|\OpenAPI\Client\Model\ApiForbiddenErrorResponse|\OpenAPI\Client\Model\ApiLimitErrorResponse|\OpenAPI\Client\Model\ApiServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateWarehouseStatusWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) + { + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $request, + $response, + ); + case 401: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $request, + $response, + ); + case 420: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $request, + $response, + ); + case 500: + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiClientDataErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiUnauthorizedErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiForbiddenErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 420: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiLimitErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ApiServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateWarehouseStatusAsync + * + * Изменение статуса склада + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateWarehouseStatusAsync($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) + { + return $this->updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWarehouseStatusAsyncWithHttpInfo + * + * Изменение статуса склада + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateWarehouseStatusAsyncWithHttpInfo($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) + { + $returnType = '\OpenAPI\Client\Model\UpdateWarehouseStatusResponse'; + $request = $this->updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateWarehouseStatus' + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. (required) + * @param \OpenAPI\Client\Model\UpdateWarehouseStatusRequest $update_warehouse_status_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateWarehouseStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateWarehouseStatusRequest($campaign_id, $update_warehouse_status_request, string $contentType = self::contentTypes['updateWarehouseStatus'][0]) + { + + // verify the required parameter 'campaign_id' is set + if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaign_id when calling updateWarehouseStatus' + ); + } + if ($campaign_id < 1) { + throw new \InvalidArgumentException('invalid value for "$campaign_id" when calling WarehousesApi.updateWarehouseStatus, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'update_warehouse_status_request' is set + if ($update_warehouse_status_request === null || (is_array($update_warehouse_status_request) && count($update_warehouse_status_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_warehouse_status_request when calling updateWarehouseStatus' + ); + } + + + $resourcePath = '/v2/campaigns/{campaignId}/warehouse/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($campaign_id !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaign_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_warehouse_status_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_warehouse_status_request)); + } else { + $httpBody = $update_warehouse_status_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Api-Key'); + if ($apiKey !== null) { + $headers['Api-Key'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/erp24/lib/yandex_market_api/ApiException.php b/erp24/lib/yandex_market_api/ApiException.php index d9d1f974..e59bb0fd 100644 --- a/erp24/lib/yandex_market_api/ApiException.php +++ b/erp24/lib/yandex_market_api/ApiException.php @@ -1,7 +1,7 @@ tempFolderPath; } + /** + * Sets the certificate file path, for mTLS + * + * @return $this + */ + public function setCertFile($certFile) + { + $this->certFile = $certFile; + return $this; + } + + /** + * Gets the certificate file path, for mTLS + * + * @return string Certificate file path + */ + public function getCertFile() + { + return $this->certFile; + } + + /** + * Sets the certificate key path, for mTLS + * + * @return $this + */ + public function setKeyFile($keyFile) + { + $this->keyFile = $keyFile; + return $this; + } + + /** + * Gets the certificate key path, for mTLS + * + * @return string Certificate key path + */ + public function getKeyFile() + { + return $this->keyFile; + } + + /** * Gets the default configuration instance * @@ -486,7 +543,7 @@ class Configuration * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; diff --git a/erp24/lib/yandex_market_api/FormDataProcessor.php b/erp24/lib/yandex_market_api/FormDataProcessor.php new file mode 100644 index 00000000..57f1eb5b --- /dev/null +++ b/erp24/lib/yandex_market_api/FormDataProcessor.php @@ -0,0 +1,246 @@ + $values the value of the form parameter + * + * @return array [key => value] of formdata + */ + public function prepare(array $values): array + { + $this->has_file = false; + $result = []; + + foreach ($values as $k => $v) { + if ($v === null) { + continue; + } + + $result[$k] = $this->makeFormSafe($v); + } + + return $result; + } + + /** + * Flattens a multi-level array of data and generates a single-level array + * compatible with formdata - a single-level array where the keys use bracket + * notation to signify nested data. + * + * credit: https://github.com/FranBar1966/FlatPHP + */ + public static function flatten(array $source, string $start = ''): array + { + $opt = [ + 'prefix' => '[', + 'suffix' => ']', + 'suffix-end' => true, + 'prefix-list' => '[', + 'suffix-list' => ']', + 'suffix-list-end' => true, + ]; + + if ($start === '') { + $currentPrefix = ''; + $currentSuffix = ''; + $currentSuffixEnd = false; + } elseif (array_is_list($source)) { + $currentPrefix = $opt['prefix-list']; + $currentSuffix = $opt['suffix-list']; + $currentSuffixEnd = $opt['suffix-list-end']; + } else { + $currentPrefix = $opt['prefix']; + $currentSuffix = $opt['suffix']; + $currentSuffixEnd = $opt['suffix-end']; + } + + $currentName = $start; + $result = []; + + foreach ($source as $key => $val) { + $currentName .= $currentPrefix.$key; + + if (is_array($val) && !empty($val)) { + $currentName .= $currentSuffix; + $result += self::flatten($val, $currentName); + } else { + if ($currentSuffixEnd) { + $currentName .= $currentSuffix; + } + + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } + } + + $currentName = $start; + } + + return $result; + } + + /** + * formdata must be limited to scalars or arrays of scalar values, + * or a resource for a file upload. Here we iterate through all available + * data and identify how to handle each scenario + */ + protected function makeFormSafe($value) + { + if ($value instanceof SplFileObject) { + return $this->processFiles([$value])[0]; + } + + if (is_resource($value)) { + $this->has_file = true; + + return $value; + } + + if ($value instanceof ModelInterface) { + return $this->processModel($value); + } + + if (is_array($value) || (is_object($value) && !$value instanceof \DateTimeInterface)) { + $data = []; + + foreach ($value as $k => $v) { + $data[$k] = $this->makeFormSafe($v); + } + + return $data; + } + + return ObjectSerializer::toString($value); + } + + /** + * We are able to handle nested ModelInterface. We do not simply call + * json_decode(json_encode()) because any given model may have binary data + * or other data that cannot be serialized to a JSON string + */ + protected function processModel(ModelInterface $model): array + { + $result = []; + + foreach ($model::openAPITypes() as $name => $type) { + $value = $model->offsetGet($name); + + if ($value === null) { + continue; + } + + if (strpos($type, '\SplFileObject') !== false) { + $file = is_array($value) ? $value : [$value]; + $result[$name] = $this->processFiles($file); + + continue; + } + + if ($value instanceof ModelInterface) { + $result[$name] = $this->processModel($value); + + continue; + } + + if (is_array($value) || is_object($value)) { + $result[$name] = $this->makeFormSafe($value); + + continue; + } + + $result[$name] = ObjectSerializer::toString($value); + } + + return $result; + } + + /** + * Handle file data + */ + protected function processFiles(array $files): array + { + $this->has_file = true; + + $result = []; + + foreach ($files as $i => $file) { + if (is_array($file)) { + $result[$i] = $this->processFiles($file); + + continue; + } + + if ($file instanceof StreamInterface) { + $result[$i] = $file; + + continue; + } + + if ($file instanceof SplFileObject) { + $result[$i] = $this->tryFopen($file); + } + } + + return $result; + } + + private function tryFopen(SplFileObject $file) + { + return Utils::tryFopen($file->getRealPath(), 'rb'); + } +} diff --git a/erp24/lib/yandex_market_api/HeaderSelector.php b/erp24/lib/yandex_market_api/HeaderSelector.php index f4ef0012..cf2c0b8d 100644 --- a/erp24/lib/yandex_market_api/HeaderSelector.php +++ b/erp24/lib/yandex_market_api/HeaderSelector.php @@ -1,7 +1,7 @@ setIfExists('accepted', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); @@ -355,11 +355,11 @@ class AcceptOrderCancellationRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -367,12 +367,12 @@ class AcceptOrderCancellationRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -397,11 +397,11 @@ class AcceptOrderCancellationRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AddHiddenOffersRequest.php b/erp24/lib/yandex_market_api/Model/AddHiddenOffersRequest.php index 59791cae..f00e2eba 100644 --- a/erp24/lib/yandex_market_api/Model/AddHiddenOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/AddHiddenOffersRequest.php @@ -2,7 +2,7 @@ /** * AddHiddenOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class AddHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('hidden_offers', $data ?? [], null); } @@ -314,7 +314,7 @@ class AddHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets hidden_offers * - * @param \OpenAPI\Client\Model\HiddenOfferDTO[] $hidden_offers Список скрытых товаров. + * @param \OpenAPI\Client\Model\HiddenOfferDTO[] $hidden_offers Список скрытых товаров. В рамках одного запроса все значения `offerId` должны быть уникальными. Не допускается передача двух объектов с одинаковым `offerId`. * * @return self */ @@ -337,11 +337,11 @@ class AddHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class AddHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class AddHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveDTO.php b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveDTO.php index 7fe4bc36..7c158110 100644 --- a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveDTO.php +++ b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveDTO.php @@ -2,7 +2,7 @@ /** * AddOffersToArchiveDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class AddOffersToArchiveDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('not_archived_offers', $data ?? [], null); } @@ -275,6 +275,10 @@ class AddOffersToArchiveDTO implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if (!is_null($this->container['not_archived_offers']) && (count($this->container['not_archived_offers']) < 1)) { + $invalidProperties[] = "invalid value for 'not_archived_offers', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -319,6 +323,11 @@ class AddOffersToArchiveDTO implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($not_archived_offers) && (count($not_archived_offers) < 1)) { + throw new \InvalidArgumentException('invalid length for $not_archived_offers when calling AddOffersToArchiveDTO., number of items must be greater than or equal to 1.'); + } $this->container['not_archived_offers'] = $not_archived_offers; return $this; @@ -326,11 +335,11 @@ class AddOffersToArchiveDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class AddOffersToArchiveDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class AddOffersToArchiveDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorDTO.php b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorDTO.php index fc4da560..ba96e4f1 100644 --- a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorDTO.php +++ b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorDTO.php @@ -2,7 +2,7 @@ /** * AddOffersToArchiveErrorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('error', $data ?? [], null); @@ -293,8 +293,8 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['error'] === null) { @@ -328,7 +328,7 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -343,8 +343,8 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling AddOffersToArchiveErrorDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling AddOffersToArchiveErrorDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling AddOffersToArchiveErrorDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -381,11 +381,11 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -393,12 +393,12 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -423,11 +423,11 @@ class AddOffersToArchiveErrorDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorType.php b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorType.php index 121dd3cd..49ab21f5 100644 --- a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorType.php +++ b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveErrorType.php @@ -2,7 +2,7 @@ /** * AddOffersToArchiveErrorType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * AddOffersToArchiveErrorType Class Doc Comment * * @category Class - * @description Причина, по которой товар не удалось поместить в архив: * `OFFER_HAS_STOCKS` — товар хранится на складе Маркета. + * @description Причина, по которой товар не удалось поместить в архив: * `OFFER_HAS_STOCKS` — товар хранится на складе Маркета. * `UNKNOWN` — неизвестная причина ошибки. Скорее всего произошел сбой на стороне Маркета. Если ошибка повторяется долгое время, обратитесь в поддержку. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveRequest.php b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveRequest.php index 70ba424a..9bc62d9a 100644 --- a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveRequest.php +++ b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveRequest.php @@ -2,7 +2,7 @@ /** * AddOffersToArchiveRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class AddOffersToArchiveRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class AddOffersToArchiveRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class AddOffersToArchiveRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class AddOffersToArchiveRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveResponse.php b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveResponse.php index 3fbef7fe..23566c7d 100644 --- a/erp24/lib/yandex_market_api/Model/AddOffersToArchiveResponse.php +++ b/erp24/lib/yandex_market_api/Model/AddOffersToArchiveResponse.php @@ -2,7 +2,7 @@ /** * AddOffersToArchiveResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class AddOffersToArchiveResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AffectedOrderQualityRatingComponentType.php b/erp24/lib/yandex_market_api/Model/AffectedOrderQualityRatingComponentType.php index 8daf2afd..06b9c26e 100644 --- a/erp24/lib/yandex_market_api/Model/AffectedOrderQualityRatingComponentType.php +++ b/erp24/lib/yandex_market_api/Model/AffectedOrderQualityRatingComponentType.php @@ -2,7 +2,7 @@ /** * AffectedOrderQualityRatingComponentType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/AgeDTO.php b/erp24/lib/yandex_market_api/Model/AgeDTO.php index 5bb276ea..db020c1e 100644 --- a/erp24/lib/yandex_market_api/Model/AgeDTO.php +++ b/erp24/lib/yandex_market_api/Model/AgeDTO.php @@ -2,7 +2,7 @@ /** * AgeDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class AgeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('age_unit', $data ?? [], null); @@ -368,11 +368,11 @@ class AgeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -380,12 +380,12 @@ class AgeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -410,11 +410,11 @@ class AgeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/AgeUnitType.php b/erp24/lib/yandex_market_api/Model/AgeUnitType.php index 851f143f..31a7ac08 100644 --- a/erp24/lib/yandex_market_api/Model/AgeUnitType.php +++ b/erp24/lib/yandex_market_api/Model/AgeUnitType.php @@ -2,7 +2,7 @@ /** * AgeUnitType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/AnswerDTO.php b/erp24/lib/yandex_market_api/Model/AnswerDTO.php new file mode 100644 index 00000000..bd85f5fb --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/AnswerDTO.php @@ -0,0 +1,758 @@ + + */ +class AnswerDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AnswerDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'text' => 'string', + 'can_modify' => 'bool', + 'author' => '\OpenAPI\Client\Model\QuestionsTextContentAuthorDTO', + 'status' => '\OpenAPI\Client\Model\QuestionsTextContentModerationStatusType', + 'question_id' => 'int', + 'created_at' => '\DateTime', + 'votes' => '\OpenAPI\Client\Model\VotesDTO', + 'comments' => '\OpenAPI\Client\Model\CommentDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'text' => null, + 'can_modify' => null, + 'author' => null, + 'status' => null, + 'question_id' => 'int64', + 'created_at' => 'date-time', + 'votes' => null, + 'comments' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'text' => false, + 'can_modify' => false, + 'author' => false, + 'status' => false, + 'question_id' => false, + 'created_at' => false, + 'votes' => false, + 'comments' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'text' => 'text', + 'can_modify' => 'canModify', + 'author' => 'author', + 'status' => 'status', + 'question_id' => 'questionId', + 'created_at' => 'createdAt', + 'votes' => 'votes', + 'comments' => 'comments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'text' => 'setText', + 'can_modify' => 'setCanModify', + 'author' => 'setAuthor', + 'status' => 'setStatus', + 'question_id' => 'setQuestionId', + 'created_at' => 'setCreatedAt', + 'votes' => 'setVotes', + 'comments' => 'setComments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'text' => 'getText', + 'can_modify' => 'getCanModify', + 'author' => 'getAuthor', + 'status' => 'getStatus', + 'question_id' => 'getQuestionId', + 'created_at' => 'getCreatedAt', + 'votes' => 'getVotes', + 'comments' => 'getComments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('can_modify', $data ?? [], null); + $this->setIfExists('author', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('question_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('votes', $data ?? [], null); + $this->setIfExists('comments', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + + if ($this->container['text'] === null) { + $invalidProperties[] = "'text' can't be null"; + } + if ((mb_strlen($this->container['text']) > 5000)) { + $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 5000."; + } + + if ((mb_strlen($this->container['text']) < 1)) { + $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1."; + } + + if ($this->container['can_modify'] === null) { + $invalidProperties[] = "'can_modify' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['question_id'] === null) { + $invalidProperties[] = "'question_id' can't be null"; + } + if (($this->container['question_id'] < 1)) { + $invalidProperties[] = "invalid value for 'question_id', must be bigger than or equal to 1."; + } + + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['votes'] === null) { + $invalidProperties[] = "'votes' can't be null"; + } + if (!is_null($this->container['comments']) && (count($this->container['comments']) > 100)) { + $invalidProperties[] = "invalid value for 'comments', number of items must be less than or equal to 100."; + } + + if (!is_null($this->container['comments']) && (count($this->container['comments']) < 0)) { + $invalidProperties[] = "invalid value for 'comments', number of items must be greater than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор ответа на вопрос. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling AnswerDTO., must be bigger than or equal to 1.'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets text + * + * @return string + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string $text Текстовое содержимое. + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + if ((mb_strlen($text) > 5000)) { + throw new \InvalidArgumentException('invalid length for $text when calling AnswerDTO., must be smaller than or equal to 5000.'); + } + if ((mb_strlen($text) < 1)) { + throw new \InvalidArgumentException('invalid length for $text when calling AnswerDTO., must be bigger than or equal to 1.'); + } + + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets can_modify + * + * @return bool + */ + public function getCanModify() + { + return $this->container['can_modify']; + } + + /** + * Sets can_modify + * + * @param bool $can_modify Может ли продавец изменять комментарий или удалять его. + * + * @return self + */ + public function setCanModify($can_modify) + { + if (is_null($can_modify)) { + throw new \InvalidArgumentException('non-nullable can_modify cannot be null'); + } + $this->container['can_modify'] = $can_modify; + + return $this; + } + + /** + * Gets author + * + * @return \OpenAPI\Client\Model\QuestionsTextContentAuthorDTO|null + */ + public function getAuthor() + { + return $this->container['author']; + } + + /** + * Sets author + * + * @param \OpenAPI\Client\Model\QuestionsTextContentAuthorDTO|null $author author + * + * @return self + */ + public function setAuthor($author) + { + if (is_null($author)) { + throw new \InvalidArgumentException('non-nullable author cannot be null'); + } + $this->container['author'] = $author; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\QuestionsTextContentModerationStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\QuestionsTextContentModerationStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets question_id + * + * @return int + */ + public function getQuestionId() + { + return $this->container['question_id']; + } + + /** + * Sets question_id + * + * @param int $question_id Идентификатор вопроса. + * + * @return self + */ + public function setQuestionId($question_id) + { + if (is_null($question_id)) { + throw new \InvalidArgumentException('non-nullable question_id cannot be null'); + } + + if (($question_id < 1)) { + throw new \InvalidArgumentException('invalid value for $question_id when calling AnswerDTO., must be bigger than or equal to 1.'); + } + + $this->container['question_id'] = $question_id; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at Дата и время создания ответа. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets votes + * + * @return \OpenAPI\Client\Model\VotesDTO + */ + public function getVotes() + { + return $this->container['votes']; + } + + /** + * Sets votes + * + * @param \OpenAPI\Client\Model\VotesDTO $votes votes + * + * @return self + */ + public function setVotes($votes) + { + if (is_null($votes)) { + throw new \InvalidArgumentException('non-nullable votes cannot be null'); + } + $this->container['votes'] = $votes; + + return $this; + } + + /** + * Gets comments + * + * @return \OpenAPI\Client\Model\CommentDTO[]|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param \OpenAPI\Client\Model\CommentDTO[]|null $comments Список комментариев. + * + * @return self + */ + public function setComments($comments) + { + if (is_null($comments)) { + array_push($this->openAPINullablesSetToNull, 'comments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('comments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($comments) && (count($comments) > 100)) { + throw new \InvalidArgumentException('invalid value for $comments when calling AnswerDTO., number of items must be less than or equal to 100.'); + } + if (!is_null($comments) && (count($comments) < 0)) { + throw new \InvalidArgumentException('invalid length for $comments when calling AnswerDTO., number of items must be greater than or equal to 0.'); + } + $this->container['comments'] = $comments; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/AnswerListDTO.php b/erp24/lib/yandex_market_api/Model/AnswerListDTO.php new file mode 100644 index 00000000..2d3751eb --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/AnswerListDTO.php @@ -0,0 +1,447 @@ + + */ +class AnswerListDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AnswerListDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'answers' => '\OpenAPI\Client\Model\AnswerDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'answers' => null, + 'paging' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'answers' => false, + 'paging' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'answers' => 'answers', + 'paging' => 'paging' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'answers' => 'setAnswers', + 'paging' => 'setPaging' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'answers' => 'getAnswers', + 'paging' => 'getPaging' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('answers', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['answers'] === null) { + $invalidProperties[] = "'answers' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets answers + * + * @return \OpenAPI\Client\Model\AnswerDTO[] + */ + public function getAnswers() + { + return $this->container['answers']; + } + + /** + * Sets answers + * + * @param \OpenAPI\Client\Model\AnswerDTO[] $answers Список ответов. + * + * @return self + */ + public function setAnswers($answers) + { + if (is_null($answers)) { + throw new \InvalidArgumentException('non-nullable answers cannot be null'); + } + $this->container['answers'] = $answers; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ApiAvailabilityStatusType.php b/erp24/lib/yandex_market_api/Model/ApiAvailabilityStatusType.php new file mode 100644 index 00000000..ae3b1db0 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ApiAvailabilityStatusType.php @@ -0,0 +1,72 @@ +setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiClientDataErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiClientDataErrorResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiErrorDTO.php b/erp24/lib/yandex_market_api/Model/ApiErrorDTO.php index 35c985e8..d8f97463 100644 --- a/erp24/lib/yandex_market_api/Model/ApiErrorDTO.php +++ b/erp24/lib/yandex_market_api/Model/ApiErrorDTO.php @@ -2,7 +2,7 @@ /** * ApiErrorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('code', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); @@ -356,11 +356,11 @@ class ApiErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class ApiErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class ApiErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiErrorResponse.php b/erp24/lib/yandex_market_api/Model/ApiErrorResponse.php index 81004576..fd365f4a 100644 --- a/erp24/lib/yandex_market_api/Model/ApiErrorResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiErrorResponse.php @@ -2,7 +2,7 @@ /** * ApiErrorResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiForbiddenErrorResponse.php b/erp24/lib/yandex_market_api/Model/ApiForbiddenErrorResponse.php index 1637ef0d..244f6698 100644 --- a/erp24/lib/yandex_market_api/Model/ApiForbiddenErrorResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiForbiddenErrorResponse.php @@ -2,7 +2,7 @@ /** * ApiForbiddenErrorResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiForbiddenErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiForbiddenErrorResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiKeyDTO.php b/erp24/lib/yandex_market_api/Model/ApiKeyDTO.php new file mode 100644 index 00000000..a8dea453 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ApiKeyDTO.php @@ -0,0 +1,467 @@ + + */ +class ApiKeyDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApiKeyDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'auth_scopes' => '\OpenAPI\Client\Model\ApiKeyScopeType[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'auth_scopes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'auth_scopes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'auth_scopes' => 'authScopes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'auth_scopes' => 'setAuthScopes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'auth_scopes' => 'getAuthScopes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('auth_scopes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + + if ((mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if ($this->container['auth_scopes'] === null) { + $invalidProperties[] = "'auth_scopes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Название токена. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 100)) { + throw new \InvalidArgumentException('invalid length for $name when calling ApiKeyDTO., must be smaller than or equal to 100.'); + } + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling ApiKeyDTO., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets auth_scopes + * + * @return \OpenAPI\Client\Model\ApiKeyScopeType[] + */ + public function getAuthScopes() + { + return $this->container['auth_scopes']; + } + + /** + * Sets auth_scopes + * + * @param \OpenAPI\Client\Model\ApiKeyScopeType[] $auth_scopes Доступы к методам по Api-Key-токену. + * + * @return self + */ + public function setAuthScopes($auth_scopes) + { + if (is_null($auth_scopes)) { + throw new \InvalidArgumentException('non-nullable auth_scopes cannot be null'); + } + + + $this->container['auth_scopes'] = $auth_scopes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ApiKeyScopeType.php b/erp24/lib/yandex_market_api/Model/ApiKeyScopeType.php new file mode 100644 index 00000000..c2cd9185 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ApiKeyScopeType.php @@ -0,0 +1,99 @@ +setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiLimitErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiLimitErrorResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiLockedErrorResponse.php b/erp24/lib/yandex_market_api/Model/ApiLockedErrorResponse.php index 92792094..fcda057a 100644 --- a/erp24/lib/yandex_market_api/Model/ApiLockedErrorResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiLockedErrorResponse.php @@ -2,7 +2,7 @@ /** * ApiLockedErrorResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiLockedErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiLockedErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiNotFoundErrorResponse.php b/erp24/lib/yandex_market_api/Model/ApiNotFoundErrorResponse.php index 17b9a94a..c76cb7f6 100644 --- a/erp24/lib/yandex_market_api/Model/ApiNotFoundErrorResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiNotFoundErrorResponse.php @@ -2,7 +2,7 @@ /** * ApiNotFoundErrorResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiNotFoundErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiNotFoundErrorResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiResponse.php b/erp24/lib/yandex_market_api/Model/ApiResponse.php index 6f0899bf..cdd73fab 100644 --- a/erp24/lib/yandex_market_api/Model/ApiResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiResponse.php @@ -2,7 +2,7 @@ /** * ApiResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); } @@ -275,6 +275,9 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -293,7 +296,7 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -303,7 +306,7 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -319,11 +322,11 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +334,12 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +364,11 @@ class ApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiResponseStatusType.php b/erp24/lib/yandex_market_api/Model/ApiResponseStatusType.php index cd41fe09..d0b97ad8 100644 --- a/erp24/lib/yandex_market_api/Model/ApiResponseStatusType.php +++ b/erp24/lib/yandex_market_api/Model/ApiResponseStatusType.php @@ -2,7 +2,7 @@ /** * ApiResponseStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ApiResponseStatusType Class Doc Comment * * @category Class - * @description Тип ответа. + * @description Тип ответа. Возможные значения: * `OK` — ошибок нет. * `ERROR` — при обработке запроса произошла ошибка. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/ApiServerErrorResponse.php b/erp24/lib/yandex_market_api/Model/ApiServerErrorResponse.php index a4c94335..c4ced41f 100644 --- a/erp24/lib/yandex_market_api/Model/ApiServerErrorResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiServerErrorResponse.php @@ -2,7 +2,7 @@ /** * ApiServerErrorResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiServerErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ApiUnauthorizedErrorResponse.php b/erp24/lib/yandex_market_api/Model/ApiUnauthorizedErrorResponse.php index b310c10b..e7eb54c3 100644 --- a/erp24/lib/yandex_market_api/Model/ApiUnauthorizedErrorResponse.php +++ b/erp24/lib/yandex_market_api/Model/ApiUnauthorizedErrorResponse.php @@ -2,7 +2,7 @@ /** * ApiUnauthorizedErrorResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -282,6 +282,13 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling ApiUnauthorizedErrorResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -360,11 +372,11 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class ApiUnauthorizedErrorResponse implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BarcodeFormatType.php b/erp24/lib/yandex_market_api/Model/BarcodeFormatType.php new file mode 100644 index 00000000..fa1b1a4b --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BarcodeFormatType.php @@ -0,0 +1,69 @@ + + */ +class BarcodeOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BarcodeOfferInfoDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offer_id' => 'string', + 'barcode_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offer_id' => null, + 'barcode_count' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_id' => false, + 'barcode_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offer_id' => 'offerId', + 'barcode_count' => 'barcodeCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offer_id' => 'setOfferId', + 'barcode_count' => 'setBarcodeCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offer_id' => 'getOfferId', + 'barcode_count' => 'getBarcodeCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offer_id', $data ?? [], null); + $this->setIfExists('barcode_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if ($this->container['barcode_count'] === null) { + $invalidProperties[] = "'barcode_count' can't be null"; + } + if (($this->container['barcode_count'] > 100)) { + $invalidProperties[] = "invalid value for 'barcode_count', must be smaller than or equal to 100."; + } + + if (($this->container['barcode_count'] < 1)) { + $invalidProperties[] = "invalid value for 'barcode_count', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offer_id + * + * @return string + */ + public function getOfferId() + { + return $this->container['offer_id']; + } + + /** + * Sets offer_id + * + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * + * @return self + */ + public function setOfferId($offer_id) + { + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); + } + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling BarcodeOfferInfoDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling BarcodeOfferInfoDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling BarcodeOfferInfoDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; + + return $this; + } + + /** + * Gets barcode_count + * + * @return int + */ + public function getBarcodeCount() + { + return $this->container['barcode_count']; + } + + /** + * Sets barcode_count + * + * @param int $barcode_count Количество штрихкодов для печати. + * + * @return self + */ + public function setBarcodeCount($barcode_count) + { + if (is_null($barcode_count)) { + throw new \InvalidArgumentException('non-nullable barcode_count cannot be null'); + } + + if (($barcode_count > 100)) { + throw new \InvalidArgumentException('invalid value for $barcode_count when calling BarcodeOfferInfoDTO., must be smaller than or equal to 100.'); + } + if (($barcode_count < 1)) { + throw new \InvalidArgumentException('invalid value for $barcode_count when calling BarcodeOfferInfoDTO., must be bigger than or equal to 1.'); + } + + $this->container['barcode_count'] = $barcode_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BaseCampaignOfferDTO.php b/erp24/lib/yandex_market_api/Model/BaseCampaignOfferDTO.php index 525d00bf..9e3e248e 100644 --- a/erp24/lib/yandex_market_api/Model/BaseCampaignOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/BaseCampaignOfferDTO.php @@ -2,7 +2,7 @@ /** * BaseCampaignOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('quantum', $data ?? [], null); @@ -300,8 +300,8 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -332,7 +332,7 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -347,8 +347,8 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling BaseCampaignOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling BaseCampaignOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling BaseCampaignOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -360,6 +360,7 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ * Gets quantum * * @return \OpenAPI\Client\Model\QuantumDTO|null + * @deprecated */ public function getQuantum() { @@ -372,6 +373,7 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ * @param \OpenAPI\Client\Model\QuantumDTO|null $quantum quantum * * @return self + * @deprecated */ public function setQuantum($quantum) { @@ -387,6 +389,7 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ * Gets available * * @return bool|null + * @deprecated */ public function getAvailable() { @@ -396,9 +399,10 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets available * - * @param bool|null $available Есть ли товар в продаже. + * @param bool|null $available {% note warning \"Вместо него используйте методы скрытия товаров с витрины\" %} * [GET v2/campaigns/{campaignId}/hidden-offers](../../reference/assortment/getHiddenOffers.md) — просмотр скрытых товаров; * [POST v2/campaigns/{campaignId}/hidden-offers](../../reference/assortment/addHiddenOffers.md) — скрытие товаров; * [POST v2/campaigns/{campaignId}/hidden-offers/delete](../../reference/assortment/deleteHiddenOffers.md) — возобновление показа. {% endnote %} Есть ли товар в продаже. * * @return self + * @deprecated */ public function setAvailable($available) { @@ -412,11 +416,11 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -424,12 +428,12 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -454,11 +458,11 @@ class BaseCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BaseOfferDTO.php b/erp24/lib/yandex_market_api/Model/BaseOfferDTO.php index 85d80cca..aa6de605 100644 --- a/erp24/lib/yandex_market_api/Model/BaseOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/BaseOfferDTO.php @@ -2,7 +2,7 @@ /** * BaseOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -76,6 +76,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => '\OpenAPI\Client\Model\TimePeriodDTO', 'guarantee_period' => '\OpenAPI\Client\Model\TimePeriodDTO', 'customs_commodity_code' => 'string', + 'commodity_codes' => '\OpenAPI\Client\Model\CommodityCodeDTO[]', 'certificates' => 'string[]', 'box_count' => 'int', 'condition' => '\OpenAPI\Client\Model\OfferConditionDTO', @@ -112,6 +113,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => null, 'guarantee_period' => null, 'customs_commodity_code' => null, + 'commodity_codes' => null, 'certificates' => null, 'box_count' => 'int32', 'condition' => null, @@ -146,6 +148,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => false, 'guarantee_period' => false, 'customs_commodity_code' => false, + 'commodity_codes' => true, 'certificates' => true, 'box_count' => false, 'condition' => false, @@ -260,6 +263,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'lifeTime', 'guarantee_period' => 'guaranteePeriod', 'customs_commodity_code' => 'customsCommodityCode', + 'commodity_codes' => 'commodityCodes', 'certificates' => 'certificates', 'box_count' => 'boxCount', 'condition' => 'condition', @@ -294,6 +298,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'setLifeTime', 'guarantee_period' => 'setGuaranteePeriod', 'customs_commodity_code' => 'setCustomsCommodityCode', + 'commodity_codes' => 'setCommodityCodes', 'certificates' => 'setCertificates', 'box_count' => 'setBoxCount', 'condition' => 'setCondition', @@ -328,6 +333,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'getLifeTime', 'guarantee_period' => 'getGuaranteePeriod', 'customs_commodity_code' => 'getCustomsCommodityCode', + 'commodity_codes' => 'getCommodityCodes', 'certificates' => 'getCertificates', 'box_count' => 'getBoxCount', 'condition' => 'getCondition', @@ -390,10 +396,10 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -413,6 +419,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('life_time', $data ?? [], null); $this->setIfExists('guarantee_period', $data ?? [], null); $this->setIfExists('customs_commodity_code', $data ?? [], null); + $this->setIfExists('commodity_codes', $data ?? [], null); $this->setIfExists('certificates', $data ?? [], null); $this->setIfExists('box_count', $data ?? [], null); $this->setIfExists('condition', $data ?? [], null); @@ -461,26 +468,82 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) { $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256."; } + if (!is_null($this->container['market_category_id']) && ($this->container['market_category_id'] <= 0)) { + $invalidProperties[] = "invalid value for 'market_category_id', must be bigger than 0."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) > 30)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be less than or equal to 30."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['videos']) && (count($this->container['videos']) > 6)) { $invalidProperties[] = "invalid value for 'videos', number of items must be less than or equal to 6."; } + if (!is_null($this->container['videos']) && (count($this->container['videos']) < 1)) { + $invalidProperties[] = "invalid value for 'videos', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) > 6)) { $invalidProperties[] = "invalid value for 'manuals', number of items must be less than or equal to 6."; } + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) < 1)) { + $invalidProperties[] = "invalid value for 'manuals', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 6000."; } + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) > 50)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['commodity_codes']) && (count($this->container['commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['certificates']) && (count($this->container['certificates']) > 6)) { + $invalidProperties[] = "invalid value for 'certificates', number of items must be less than or equal to 6."; + } + + if (!is_null($this->container['certificates']) && (count($this->container['certificates']) < 1)) { + $invalidProperties[] = "invalid value for 'certificates', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['box_count']) && ($this->container['box_count'] < 1)) { + $invalidProperties[] = "invalid value for 'box_count', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['params']) && (count($this->container['params']) < 1)) { + $invalidProperties[] = "invalid value for 'params', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -509,7 +572,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -524,8 +587,8 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling BaseOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling BaseOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling BaseOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -577,7 +640,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_category_id * - * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. Если не указать `marketCategoryId`, то маркетная категория будет определена автоматически. При изменении информации о товаре передавайте тот же идентификатор категории. Если вы укажете другой, категория товара не поменяется. Изменить ее можно только в кабинете продавца на Маркете. Список категорий Маркета можно получить с помощью запроса [POST categories/tree](../../reference/categories/getCategoriesTree.md). + * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. {% note warning \"Всегда указывайте, когда передаете `parameterValues`\" %} Если при изменении характеристик передать `parameterValues` и не указать `marketCategoryId`, характеристики обновятся, но в ответе придет предупреждение (параметр `warnings`). Если не передать их оба, будет использована информация из устаревших параметров `params` и `category`, а `marketCategoryId` будет определен автоматически. {% endnote %} При изменении категории убедитесь, что характеристики товара и их значения в параметре `parameterValues` вы передаете для новой категории. Список категорий Маркета можно получить с помощью запроса [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). * * @return self */ @@ -586,6 +649,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($market_category_id)) { throw new \InvalidArgumentException('non-nullable market_category_id cannot be null'); } + + if (($market_category_id <= 0)) { + throw new \InvalidArgumentException('invalid value for $market_category_id when calling BaseOfferDTO., must be bigger than 0.'); + } + $this->container['market_category_id'] = $market_category_id; return $this; @@ -595,6 +663,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -604,9 +673,10 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -631,7 +701,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets pictures * - * @param string[]|null $pictures Ссылки на изображения товара. Изображение по первой ссылке считается основным, остальные дополнительными. **Требования к ссылкам** * Ссылок может быть до 30. * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на изображения и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/images/sku12345.jpg` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/images/sku12345.jpg` ❌ `https://www.dropbox.com/s/818f/tovar.jpg` Ссылки на изображение должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить изображение, выложите новое изображение по новой ссылке, а ссылку на старое удалите. Если просто заменить изображение по старой ссылке, оно не обновится. [Требования к изображениям](https://yandex.ru/support/marketplace/assortment/fields/images.html) + * @param string[]|null $pictures Ссылки на изображения товара. Изображение по первой ссылке считается основным, остальные дополнительными. **Требования к ссылкам** * Указывайте ссылку целиком, включая протокол http или https. * Русские буквы в URL можно. * Можно использовать прямые ссылки на изображения и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/images/sku12345.jpg` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/images/sku12345.jpg` ❌ `https://www.dropbox.com/s/818f/tovar.jpg` Ссылки на изображение должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить изображение, выложите новое изображение по новой ссылке, а ссылку на старое удалите. Если просто заменить изображение по старой ссылке, оно не обновится. [Требования к изображениям](https://yandex.ru/support/marketplace/assortment/fields/images.html) * * @return self */ @@ -647,6 +717,13 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($pictures) && (count($pictures) > 30)) { + throw new \InvalidArgumentException('invalid value for $pictures when calling BaseOfferDTO., number of items must be less than or equal to 30.'); + } + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -665,7 +742,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets videos * - * @param string[]|null $videos Ссылка (URL) на видео товара. Максимальное количество ссылок — 6. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) + * @param string[]|null $videos Ссылки (URL) на видео товара. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) * * @return self */ @@ -685,6 +762,9 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (!is_null($videos) && (count($videos) > 6)) { throw new \InvalidArgumentException('invalid value for $videos when calling BaseOfferDTO., number of items must be less than or equal to 6.'); } + if (!is_null($videos) && (count($videos) < 1)) { + throw new \InvalidArgumentException('invalid length for $videos when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['videos'] = $videos; return $this; @@ -703,7 +783,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets manuals * - * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. Максимальное количество инструкций — 6. Если вы передадите пустое поле `manuals`, загруженные ранее инструкции удалятся. + * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. * * @return self */ @@ -723,6 +803,9 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (!is_null($manuals) && (count($manuals) > 6)) { throw new \InvalidArgumentException('invalid value for $manuals when calling BaseOfferDTO., number of items must be less than or equal to 6.'); } + if (!is_null($manuals) && (count($manuals) < 1)) { + throw new \InvalidArgumentException('invalid length for $manuals when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manuals'] = $manuals; return $this; @@ -768,7 +851,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -784,6 +867,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -802,7 +890,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

, \\

и так далее — для заголовков; * \\
и \\

— для переноса строки; * \\

    — для нумерованного списка; * \\
      — для маркированного списка; * \\
    • — для создания элементов списка (должен находиться внутри \\
        или \\
          ); * \\
          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

          , \\

          и так далее — для заголовков; * \\
          и \\

          — для переноса строки; * \\

            — для нумерованного списка; * \\
              — для маркированного списка; * \\
            • — для создания элементов списка (должен находиться внутри \\
                или \\
                  ); * \\
                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -849,6 +937,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -921,7 +1014,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets tags * - * @param string[]|null $tags Метки товара, используемые магазином. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега 20 символов. У одного товара может быть максимум 10 тегов. Всего можно создать не больше 50 разных тегов. + * @param string[]|null $tags Метки товара, которые использует магазин. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега — 20 символов. У одного товара может быть максимум 10 тегов. * * @return self */ @@ -937,6 +1030,13 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($tags) && (count($tags) > 50)) { + throw new \InvalidArgumentException('invalid value for $tags when calling BaseOfferDTO., number of items must be less than or equal to 50.'); + } + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['tags'] = $tags; return $this; @@ -1027,6 +1127,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets customs_commodity_code * * @return string|null + * @deprecated */ public function getCustomsCommodityCode() { @@ -1036,9 +1137,10 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets customs_commodity_code * - * @param string|null $customs_commodity_code Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. + * @param string|null $customs_commodity_code {% note warning \"Вместо него используйте `commodityCodes` с типом `CUSTOMS_COMMODITY_CODE`.\" %}   {% endnote %} Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. * * @return self + * @deprecated */ public function setCustomsCommodityCode($customs_commodity_code) { @@ -1050,6 +1152,45 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets commodity_codes + * + * @return \OpenAPI\Client\Model\CommodityCodeDTO[]|null + */ + public function getCommodityCodes() + { + return $this->container['commodity_codes']; + } + + /** + * Sets commodity_codes + * + * @param \OpenAPI\Client\Model\CommodityCodeDTO[]|null $commodity_codes Товарные коды. + * + * @return self + */ + public function setCommodityCodes($commodity_codes) + { + if (is_null($commodity_codes)) { + array_push($this->openAPINullablesSetToNull, 'commodity_codes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commodity_codes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($commodity_codes) && (count($commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $commodity_codes when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } + $this->container['commodity_codes'] = $commodity_codes; + + return $this; + } + /** * Gets certificates * @@ -1079,6 +1220,13 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($certificates) && (count($certificates) > 6)) { + throw new \InvalidArgumentException('invalid value for $certificates when calling BaseOfferDTO., number of items must be less than or equal to 6.'); + } + if (!is_null($certificates) && (count($certificates) < 1)) { + throw new \InvalidArgumentException('invalid length for $certificates when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['certificates'] = $certificates; return $this; @@ -1106,6 +1254,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($box_count)) { throw new \InvalidArgumentException('non-nullable box_count cannot be null'); } + + if (($box_count < 1)) { + throw new \InvalidArgumentException('invalid value for $box_count when calling BaseOfferDTO., must be bigger than or equal to 1.'); + } + $this->container['box_count'] = $box_count; return $this; @@ -1260,7 +1413,7 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets params * - * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"\" %} Этот параметр устарел. При передаче характеристик используйте `parameterValues`. {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. + * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"При передаче характеристик используйте `parameterValues`.\" %}   {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. * * @return self * @deprecated @@ -1277,6 +1430,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($params) && (count($params) < 1)) { + throw new \InvalidArgumentException('invalid length for $params when calling BaseOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['params'] = $params; return $this; @@ -1284,11 +1442,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1296,12 +1454,12 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1326,11 +1484,11 @@ class BaseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BaseOfferResponseDTO.php b/erp24/lib/yandex_market_api/Model/BaseOfferResponseDTO.php new file mode 100644 index 00000000..3188a3f4 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BaseOfferResponseDTO.php @@ -0,0 +1,1493 @@ + + */ +class BaseOfferResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseOfferResponseDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offer_id' => 'string', + 'name' => 'string', + 'market_category_id' => 'int', + 'category' => 'string', + 'pictures' => 'string[]', + 'videos' => 'string[]', + 'manuals' => '\OpenAPI\Client\Model\OfferManualDTO[]', + 'vendor' => 'string', + 'barcodes' => 'string[]', + 'description' => 'string', + 'manufacturer_countries' => 'string[]', + 'weight_dimensions' => '\OpenAPI\Client\Model\OfferWeightDimensionsDTO', + 'vendor_code' => 'string', + 'tags' => 'string[]', + 'shelf_life' => '\OpenAPI\Client\Model\TimePeriodDTO', + 'life_time' => '\OpenAPI\Client\Model\TimePeriodDTO', + 'guarantee_period' => '\OpenAPI\Client\Model\TimePeriodDTO', + 'customs_commodity_code' => 'string', + 'commodity_codes' => '\OpenAPI\Client\Model\CommodityCodeDTO[]', + 'certificates' => 'string[]', + 'box_count' => 'int', + 'condition' => '\OpenAPI\Client\Model\OfferConditionDTO', + 'type' => '\OpenAPI\Client\Model\OfferType', + 'downloadable' => 'bool', + 'adult' => 'bool', + 'age' => '\OpenAPI\Client\Model\AgeDTO', + 'params' => '\OpenAPI\Client\Model\OfferParamDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offer_id' => null, + 'name' => null, + 'market_category_id' => 'int64', + 'category' => null, + 'pictures' => null, + 'videos' => null, + 'manuals' => null, + 'vendor' => null, + 'barcodes' => null, + 'description' => null, + 'manufacturer_countries' => null, + 'weight_dimensions' => null, + 'vendor_code' => null, + 'tags' => null, + 'shelf_life' => null, + 'life_time' => null, + 'guarantee_period' => null, + 'customs_commodity_code' => null, + 'commodity_codes' => null, + 'certificates' => null, + 'box_count' => 'int32', + 'condition' => null, + 'type' => null, + 'downloadable' => null, + 'adult' => null, + 'age' => null, + 'params' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_id' => false, + 'name' => false, + 'market_category_id' => false, + 'category' => false, + 'pictures' => true, + 'videos' => true, + 'manuals' => true, + 'vendor' => false, + 'barcodes' => true, + 'description' => false, + 'manufacturer_countries' => true, + 'weight_dimensions' => false, + 'vendor_code' => false, + 'tags' => true, + 'shelf_life' => false, + 'life_time' => false, + 'guarantee_period' => false, + 'customs_commodity_code' => false, + 'commodity_codes' => true, + 'certificates' => true, + 'box_count' => false, + 'condition' => false, + 'type' => false, + 'downloadable' => false, + 'adult' => false, + 'age' => false, + 'params' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offer_id' => 'offerId', + 'name' => 'name', + 'market_category_id' => 'marketCategoryId', + 'category' => 'category', + 'pictures' => 'pictures', + 'videos' => 'videos', + 'manuals' => 'manuals', + 'vendor' => 'vendor', + 'barcodes' => 'barcodes', + 'description' => 'description', + 'manufacturer_countries' => 'manufacturerCountries', + 'weight_dimensions' => 'weightDimensions', + 'vendor_code' => 'vendorCode', + 'tags' => 'tags', + 'shelf_life' => 'shelfLife', + 'life_time' => 'lifeTime', + 'guarantee_period' => 'guaranteePeriod', + 'customs_commodity_code' => 'customsCommodityCode', + 'commodity_codes' => 'commodityCodes', + 'certificates' => 'certificates', + 'box_count' => 'boxCount', + 'condition' => 'condition', + 'type' => 'type', + 'downloadable' => 'downloadable', + 'adult' => 'adult', + 'age' => 'age', + 'params' => 'params' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offer_id' => 'setOfferId', + 'name' => 'setName', + 'market_category_id' => 'setMarketCategoryId', + 'category' => 'setCategory', + 'pictures' => 'setPictures', + 'videos' => 'setVideos', + 'manuals' => 'setManuals', + 'vendor' => 'setVendor', + 'barcodes' => 'setBarcodes', + 'description' => 'setDescription', + 'manufacturer_countries' => 'setManufacturerCountries', + 'weight_dimensions' => 'setWeightDimensions', + 'vendor_code' => 'setVendorCode', + 'tags' => 'setTags', + 'shelf_life' => 'setShelfLife', + 'life_time' => 'setLifeTime', + 'guarantee_period' => 'setGuaranteePeriod', + 'customs_commodity_code' => 'setCustomsCommodityCode', + 'commodity_codes' => 'setCommodityCodes', + 'certificates' => 'setCertificates', + 'box_count' => 'setBoxCount', + 'condition' => 'setCondition', + 'type' => 'setType', + 'downloadable' => 'setDownloadable', + 'adult' => 'setAdult', + 'age' => 'setAge', + 'params' => 'setParams' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offer_id' => 'getOfferId', + 'name' => 'getName', + 'market_category_id' => 'getMarketCategoryId', + 'category' => 'getCategory', + 'pictures' => 'getPictures', + 'videos' => 'getVideos', + 'manuals' => 'getManuals', + 'vendor' => 'getVendor', + 'barcodes' => 'getBarcodes', + 'description' => 'getDescription', + 'manufacturer_countries' => 'getManufacturerCountries', + 'weight_dimensions' => 'getWeightDimensions', + 'vendor_code' => 'getVendorCode', + 'tags' => 'getTags', + 'shelf_life' => 'getShelfLife', + 'life_time' => 'getLifeTime', + 'guarantee_period' => 'getGuaranteePeriod', + 'customs_commodity_code' => 'getCustomsCommodityCode', + 'commodity_codes' => 'getCommodityCodes', + 'certificates' => 'getCertificates', + 'box_count' => 'getBoxCount', + 'condition' => 'getCondition', + 'type' => 'getType', + 'downloadable' => 'getDownloadable', + 'adult' => 'getAdult', + 'age' => 'getAge', + 'params' => 'getParams' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offer_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('market_category_id', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('pictures', $data ?? [], null); + $this->setIfExists('videos', $data ?? [], null); + $this->setIfExists('manuals', $data ?? [], null); + $this->setIfExists('vendor', $data ?? [], null); + $this->setIfExists('barcodes', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('manufacturer_countries', $data ?? [], null); + $this->setIfExists('weight_dimensions', $data ?? [], null); + $this->setIfExists('vendor_code', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('shelf_life', $data ?? [], null); + $this->setIfExists('life_time', $data ?? [], null); + $this->setIfExists('guarantee_period', $data ?? [], null); + $this->setIfExists('customs_commodity_code', $data ?? [], null); + $this->setIfExists('commodity_codes', $data ?? [], null); + $this->setIfExists('certificates', $data ?? [], null); + $this->setIfExists('box_count', $data ?? [], null); + $this->setIfExists('condition', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('downloadable', $data ?? [], null); + $this->setIfExists('adult', $data ?? [], null); + $this->setIfExists('age', $data ?? [], null); + $this->setIfExists('params', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['market_category_id']) && ($this->container['market_category_id'] <= 0)) { + $invalidProperties[] = "invalid value for 'market_category_id', must be bigger than 0."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['videos']) && (count($this->container['videos']) < 1)) { + $invalidProperties[] = "invalid value for 'videos', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) < 1)) { + $invalidProperties[] = "invalid value for 'manuals', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) > 50)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['commodity_codes']) && (count($this->container['commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['certificates']) && (count($this->container['certificates']) < 1)) { + $invalidProperties[] = "invalid value for 'certificates', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['box_count']) && ($this->container['box_count'] < 1)) { + $invalidProperties[] = "invalid value for 'box_count', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['params']) && (count($this->container['params']) < 1)) { + $invalidProperties[] = "invalid value for 'params', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offer_id + * + * @return string + */ + public function getOfferId() + { + return $this->container['offer_id']; + } + + /** + * Sets offer_id + * + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * + * @return self + */ + public function setOfferId($offer_id) + { + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); + } + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling BaseOfferResponseDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling BaseOfferResponseDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling BaseOfferResponseDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Составляйте название по схеме: тип + бренд или производитель + модель + особенности, если есть (например, цвет, размер или вес) и количество в упаковке. Не включайте в название условия продажи (например, «скидка», «бесплатная доставка» и т. д.), эмоциональные характеристики («хит», «супер» и т. д.). Не пишите слова большими буквами — кроме устоявшихся названий брендов и моделей. Оптимальная длина — 50–60 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/title.html) + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets market_category_id + * + * @return int|null + */ + public function getMarketCategoryId() + { + return $this->container['market_category_id']; + } + + /** + * Sets market_category_id + * + * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. {% note warning \"Всегда указывайте, когда передаете `parameterValues`\" %} Если при изменении характеристик передать `parameterValues` и не указать `marketCategoryId`, характеристики обновятся, но в ответе придет предупреждение (параметр `warnings`). Если не передать их оба, будет использована информация из устаревших параметров `params` и `category`, а `marketCategoryId` будет определен автоматически. {% endnote %} При изменении категории убедитесь, что характеристики товара и их значения в параметре `parameterValues` вы передаете для новой категории. Список категорий Маркета можно получить с помощью запроса [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). + * + * @return self + */ + public function setMarketCategoryId($market_category_id) + { + if (is_null($market_category_id)) { + throw new \InvalidArgumentException('non-nullable market_category_id cannot be null'); + } + + if (($market_category_id <= 0)) { + throw new \InvalidArgumentException('invalid value for $market_category_id when calling BaseOfferResponseDTO., must be bigger than 0.'); + } + + $this->container['market_category_id'] = $market_category_id; + + return $this; + } + + /** + * Gets category + * + * @return string|null + * @deprecated + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. + * + * @return self + * @deprecated + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets pictures + * + * @return string[]|null + */ + public function getPictures() + { + return $this->container['pictures']; + } + + /** + * Sets pictures + * + * @param string[]|null $pictures Ссылки на изображения товара. Изображение по первой ссылке считается основным, остальные дополнительными. **Требования к ссылкам** * Ссылок может быть до 30. * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на изображения и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/images/sku12345.jpg` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/images/sku12345.jpg` ❌ `https://www.dropbox.com/s/818f/tovar.jpg` Ссылки на изображение должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить изображение, выложите новое изображение по новой ссылке, а ссылку на старое удалите. Если просто заменить изображение по старой ссылке, оно не обновится. [Требования к изображениям](https://yandex.ru/support/marketplace/assortment/fields/images.html) + * + * @return self + */ + public function setPictures($pictures) + { + if (is_null($pictures)) { + array_push($this->openAPINullablesSetToNull, 'pictures'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pictures', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['pictures'] = $pictures; + + return $this; + } + + /** + * Gets videos + * + * @return string[]|null + */ + public function getVideos() + { + return $this->container['videos']; + } + + /** + * Sets videos + * + * @param string[]|null $videos Ссылки (URL) на видео товара. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) + * + * @return self + */ + public function setVideos($videos) + { + if (is_null($videos)) { + array_push($this->openAPINullablesSetToNull, 'videos'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('videos', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($videos) && (count($videos) < 1)) { + throw new \InvalidArgumentException('invalid length for $videos when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['videos'] = $videos; + + return $this; + } + + /** + * Gets manuals + * + * @return \OpenAPI\Client\Model\OfferManualDTO[]|null + */ + public function getManuals() + { + return $this->container['manuals']; + } + + /** + * Sets manuals + * + * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. + * + * @return self + */ + public function setManuals($manuals) + { + if (is_null($manuals)) { + array_push($this->openAPINullablesSetToNull, 'manuals'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('manuals', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($manuals) && (count($manuals) < 1)) { + throw new \InvalidArgumentException('invalid length for $manuals when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['manuals'] = $manuals; + + return $this; + } + + /** + * Gets vendor + * + * @return string|null + */ + public function getVendor() + { + return $this->container['vendor']; + } + + /** + * Sets vendor + * + * @param string|null $vendor Название бренда или производителя. Должно быть записано так, как его пишет сам бренд. + * + * @return self + */ + public function setVendor($vendor) + { + if (is_null($vendor)) { + throw new \InvalidArgumentException('non-nullable vendor cannot be null'); + } + $this->container['vendor'] = $vendor; + + return $this; + } + + /** + * Gets barcodes + * + * @return string[]|null + */ + public function getBarcodes() + { + return $this->container['barcodes']; + } + + /** + * Sets barcodes + * + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) + * + * @return self + */ + public function setBarcodes($barcodes) + { + if (is_null($barcodes)) { + array_push($this->openAPINullablesSetToNull, 'barcodes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('barcodes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['barcodes'] = $barcodes; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                  , \\

                  и так далее — для заголовков; * \\
                  и \\

                  — для переноса строки; * \\

                    — для нумерованного списка; * \\
                      — для маркированного списка; * \\
                    • — для создания элементов списка (должен находиться внутри \\
                        или \\
                          ); * \\
                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets manufacturer_countries + * + * @return string[]|null + */ + public function getManufacturerCountries() + { + return $this->container['manufacturer_countries']; + } + + /** + * Sets manufacturer_countries + * + * @param string[]|null $manufacturer_countries Страна, где был произведен товар. Записывайте названия стран так, как они записаны в [списке](https://yastatic.net/s3/doc-binary/src/support/market/ru/countries.xlsx). + * + * @return self + */ + public function setManufacturerCountries($manufacturer_countries) + { + if (is_null($manufacturer_countries)) { + array_push($this->openAPINullablesSetToNull, 'manufacturer_countries'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('manufacturer_countries', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['manufacturer_countries'] = $manufacturer_countries; + + return $this; + } + + /** + * Gets weight_dimensions + * + * @return \OpenAPI\Client\Model\OfferWeightDimensionsDTO|null + */ + public function getWeightDimensions() + { + return $this->container['weight_dimensions']; + } + + /** + * Sets weight_dimensions + * + * @param \OpenAPI\Client\Model\OfferWeightDimensionsDTO|null $weight_dimensions weight_dimensions + * + * @return self + */ + public function setWeightDimensions($weight_dimensions) + { + if (is_null($weight_dimensions)) { + throw new \InvalidArgumentException('non-nullable weight_dimensions cannot be null'); + } + $this->container['weight_dimensions'] = $weight_dimensions; + + return $this; + } + + /** + * Gets vendor_code + * + * @return string|null + */ + public function getVendorCode() + { + return $this->container['vendor_code']; + } + + /** + * Sets vendor_code + * + * @param string|null $vendor_code Артикул товара от производителя. + * + * @return self + */ + public function setVendorCode($vendor_code) + { + if (is_null($vendor_code)) { + throw new \InvalidArgumentException('non-nullable vendor_code cannot be null'); + } + $this->container['vendor_code'] = $vendor_code; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags Метки товара, которые использует магазин. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега — 20 символов. У одного товара может быть максимум 10 тегов. + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($tags) && (count($tags) > 50)) { + throw new \InvalidArgumentException('invalid value for $tags when calling BaseOfferResponseDTO., number of items must be less than or equal to 50.'); + } + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets shelf_life + * + * @return \OpenAPI\Client\Model\TimePeriodDTO|null + */ + public function getShelfLife() + { + return $this->container['shelf_life']; + } + + /** + * Sets shelf_life + * + * @param \OpenAPI\Client\Model\TimePeriodDTO|null $shelf_life shelf_life + * + * @return self + */ + public function setShelfLife($shelf_life) + { + if (is_null($shelf_life)) { + throw new \InvalidArgumentException('non-nullable shelf_life cannot be null'); + } + $this->container['shelf_life'] = $shelf_life; + + return $this; + } + + /** + * Gets life_time + * + * @return \OpenAPI\Client\Model\TimePeriodDTO|null + */ + public function getLifeTime() + { + return $this->container['life_time']; + } + + /** + * Sets life_time + * + * @param \OpenAPI\Client\Model\TimePeriodDTO|null $life_time life_time + * + * @return self + */ + public function setLifeTime($life_time) + { + if (is_null($life_time)) { + throw new \InvalidArgumentException('non-nullable life_time cannot be null'); + } + $this->container['life_time'] = $life_time; + + return $this; + } + + /** + * Gets guarantee_period + * + * @return \OpenAPI\Client\Model\TimePeriodDTO|null + */ + public function getGuaranteePeriod() + { + return $this->container['guarantee_period']; + } + + /** + * Sets guarantee_period + * + * @param \OpenAPI\Client\Model\TimePeriodDTO|null $guarantee_period guarantee_period + * + * @return self + */ + public function setGuaranteePeriod($guarantee_period) + { + if (is_null($guarantee_period)) { + throw new \InvalidArgumentException('non-nullable guarantee_period cannot be null'); + } + $this->container['guarantee_period'] = $guarantee_period; + + return $this; + } + + /** + * Gets customs_commodity_code + * + * @return string|null + * @deprecated + */ + public function getCustomsCommodityCode() + { + return $this->container['customs_commodity_code']; + } + + /** + * Sets customs_commodity_code + * + * @param string|null $customs_commodity_code {% note warning \"Вместо него используйте `commodityCodes` с типом `CUSTOMS_COMMODITY_CODE`.\" %}   {% endnote %} Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. + * + * @return self + * @deprecated + */ + public function setCustomsCommodityCode($customs_commodity_code) + { + if (is_null($customs_commodity_code)) { + throw new \InvalidArgumentException('non-nullable customs_commodity_code cannot be null'); + } + $this->container['customs_commodity_code'] = $customs_commodity_code; + + return $this; + } + + /** + * Gets commodity_codes + * + * @return \OpenAPI\Client\Model\CommodityCodeDTO[]|null + */ + public function getCommodityCodes() + { + return $this->container['commodity_codes']; + } + + /** + * Sets commodity_codes + * + * @param \OpenAPI\Client\Model\CommodityCodeDTO[]|null $commodity_codes Товарные коды. + * + * @return self + */ + public function setCommodityCodes($commodity_codes) + { + if (is_null($commodity_codes)) { + array_push($this->openAPINullablesSetToNull, 'commodity_codes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commodity_codes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($commodity_codes) && (count($commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $commodity_codes when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['commodity_codes'] = $commodity_codes; + + return $this; + } + + /** + * Gets certificates + * + * @return string[]|null + */ + public function getCertificates() + { + return $this->container['certificates']; + } + + /** + * Sets certificates + * + * @param string[]|null $certificates Номера документов на товар: сертификата, декларации соответствия и т. п. Передавать можно только номера документов, сканы которого загружены в кабинете продавца по [инструкции](https://yandex.ru/support/marketplace/assortment/restrictions/certificates.html). + * + * @return self + */ + public function setCertificates($certificates) + { + if (is_null($certificates)) { + array_push($this->openAPINullablesSetToNull, 'certificates'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('certificates', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($certificates) && (count($certificates) < 1)) { + throw new \InvalidArgumentException('invalid length for $certificates when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['certificates'] = $certificates; + + return $this; + } + + /** + * Gets box_count + * + * @return int|null + */ + public function getBoxCount() + { + return $this->container['box_count']; + } + + /** + * Sets box_count + * + * @param int|null $box_count Количество грузовых мест. Параметр используется, если товар представляет собой несколько коробок, упаковок и так далее. Например, кондиционер занимает два места — внешний и внутренний блоки в двух коробках. Для товаров, занимающих одно место, не передавайте этот параметр. + * + * @return self + */ + public function setBoxCount($box_count) + { + if (is_null($box_count)) { + throw new \InvalidArgumentException('non-nullable box_count cannot be null'); + } + + if (($box_count < 1)) { + throw new \InvalidArgumentException('invalid value for $box_count when calling BaseOfferResponseDTO., must be bigger than or equal to 1.'); + } + + $this->container['box_count'] = $box_count; + + return $this; + } + + /** + * Gets condition + * + * @return \OpenAPI\Client\Model\OfferConditionDTO|null + */ + public function getCondition() + { + return $this->container['condition']; + } + + /** + * Sets condition + * + * @param \OpenAPI\Client\Model\OfferConditionDTO|null $condition condition + * + * @return self + */ + public function setCondition($condition) + { + if (is_null($condition)) { + throw new \InvalidArgumentException('non-nullable condition cannot be null'); + } + $this->container['condition'] = $condition; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\OfferType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\OfferType|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets downloadable + * + * @return bool|null + */ + public function getDownloadable() + { + return $this->container['downloadable']; + } + + /** + * Sets downloadable + * + * @param bool|null $downloadable Признак цифрового товара. Укажите `true`, если товар доставляется по электронной почте. [Как работать с цифровыми товарами](../../step-by-step/digital.md) + * + * @return self + */ + public function setDownloadable($downloadable) + { + if (is_null($downloadable)) { + throw new \InvalidArgumentException('non-nullable downloadable cannot be null'); + } + $this->container['downloadable'] = $downloadable; + + return $this; + } + + /** + * Gets adult + * + * @return bool|null + */ + public function getAdult() + { + return $this->container['adult']; + } + + /** + * Sets adult + * + * @param bool|null $adult Параметр включает для товара пометку 18+. Устанавливайте ее только для товаров, которые относятся к удовлетворению сексуальных потребностей. + * + * @return self + */ + public function setAdult($adult) + { + if (is_null($adult)) { + throw new \InvalidArgumentException('non-nullable adult cannot be null'); + } + $this->container['adult'] = $adult; + + return $this; + } + + /** + * Gets age + * + * @return \OpenAPI\Client\Model\AgeDTO|null + */ + public function getAge() + { + return $this->container['age']; + } + + /** + * Sets age + * + * @param \OpenAPI\Client\Model\AgeDTO|null $age age + * + * @return self + */ + public function setAge($age) + { + if (is_null($age)) { + throw new \InvalidArgumentException('non-nullable age cannot be null'); + } + $this->container['age'] = $age; + + return $this; + } + + /** + * Gets params + * + * @return \OpenAPI\Client\Model\OfferParamDTO[]|null + * @deprecated + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"При передаче характеристик используйте `parameterValues`.\" %}   {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. + * + * @return self + * @deprecated + */ + public function setParams($params) + { + if (is_null($params)) { + array_push($this->openAPINullablesSetToNull, 'params'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('params', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($params) && (count($params) < 1)) { + throw new \InvalidArgumentException('invalid length for $params when calling BaseOfferResponseDTO., number of items must be greater than or equal to 1.'); + } + $this->container['params'] = $params; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BasePriceDTO.php b/erp24/lib/yandex_market_api/Model/BasePriceDTO.php index 4a234f45..db4e23d9 100644 --- a/erp24/lib/yandex_market_api/Model/BasePriceDTO.php +++ b/erp24/lib/yandex_market_api/Model/BasePriceDTO.php @@ -2,7 +2,7 @@ /** * BasePriceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * BasePriceDTO Class Doc Comment * * @category Class - * @description Цена на товар. + * @description Цена товара. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class BasePriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('currency_id', $data ?? [], null); @@ -320,7 +320,7 @@ class BasePriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets value * - * @param float $value Значение. + * @param float $value Цена товара. * * @return self */ @@ -368,11 +368,11 @@ class BasePriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -380,12 +380,12 @@ class BasePriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -410,11 +410,11 @@ class BasePriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BaseShipmentDTO.php b/erp24/lib/yandex_market_api/Model/BaseShipmentDTO.php index d98cd38c..aa71817e 100644 --- a/erp24/lib/yandex_market_api/Model/BaseShipmentDTO.php +++ b/erp24/lib/yandex_market_api/Model/BaseShipmentDTO.php @@ -2,7 +2,7 @@ /** * BaseShipmentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -70,7 +70,8 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'order_ids' => 'int[]', 'draft_count' => 'int', 'planned_count' => 'int', - 'fact_count' => 'int' + 'fact_count' => 'int', + 'signature' => '\OpenAPI\Client\Model\SignatureDTO' ]; /** @@ -93,7 +94,8 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'order_ids' => 'int64', 'draft_count' => 'int32', 'planned_count' => 'int32', - 'fact_count' => 'int32' + 'fact_count' => 'int32', + 'signature' => null ]; /** @@ -114,7 +116,8 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'order_ids' => false, 'draft_count' => false, 'planned_count' => false, - 'fact_count' => false + 'fact_count' => false, + 'signature' => false ]; /** @@ -215,7 +218,8 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'order_ids' => 'orderIds', 'draft_count' => 'draftCount', 'planned_count' => 'plannedCount', - 'fact_count' => 'factCount' + 'fact_count' => 'factCount', + 'signature' => 'signature' ]; /** @@ -236,7 +240,8 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'order_ids' => 'setOrderIds', 'draft_count' => 'setDraftCount', 'planned_count' => 'setPlannedCount', - 'fact_count' => 'setFactCount' + 'fact_count' => 'setFactCount', + 'signature' => 'setSignature' ]; /** @@ -257,7 +262,8 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'order_ids' => 'getOrderIds', 'draft_count' => 'getDraftCount', 'planned_count' => 'getPlannedCount', - 'fact_count' => 'getFactCount' + 'fact_count' => 'getFactCount', + 'signature' => 'getSignature' ]; /** @@ -312,10 +318,10 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('plan_interval_from', $data ?? [], null); @@ -330,6 +336,7 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('draft_count', $data ?? [], null); $this->setIfExists('planned_count', $data ?? [], null); $this->setIfExists('fact_count', $data ?? [], null); + $this->setIfExists('signature', $data ?? [], null); } /** @@ -396,6 +403,9 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'fact_count', must be bigger than or equal to 0."; } + if ($this->container['signature'] === null) { + $invalidProperties[] = "'signature' can't be null"; + } return $invalidProperties; } @@ -783,14 +793,41 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + + /** + * Gets signature + * + * @return \OpenAPI\Client\Model\SignatureDTO + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param \OpenAPI\Client\Model\SignatureDTO $signature signature + * + * @return self + */ + public function setSignature($signature) + { + if (is_null($signature)) { + throw new \InvalidArgumentException('non-nullable signature cannot be null'); + } + $this->container['signature'] = $signature; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -798,12 +835,12 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -828,11 +865,11 @@ class BaseShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BenefitType.php b/erp24/lib/yandex_market_api/Model/BenefitType.php new file mode 100644 index 00000000..f04c3054 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BenefitType.php @@ -0,0 +1,78 @@ + 'int', - 'show_percent' => 'int' + 'show_percent' => 'int', + 'benefits' => '\OpenAPI\Client\Model\BenefitType[]' ]; /** @@ -71,7 +72,8 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPIFormats = [ 'bid' => 'int32', - 'show_percent' => 'int64' + 'show_percent' => 'int64', + 'benefits' => null ]; /** @@ -81,7 +83,8 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri */ protected static array $openAPINullables = [ 'bid' => false, - 'show_percent' => false + 'show_percent' => false, + 'benefits' => true ]; /** @@ -171,7 +174,8 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $attributeMap = [ 'bid' => 'bid', - 'show_percent' => 'showPercent' + 'show_percent' => 'showPercent', + 'benefits' => 'benefits' ]; /** @@ -181,7 +185,8 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $setters = [ 'bid' => 'setBid', - 'show_percent' => 'setShowPercent' + 'show_percent' => 'setShowPercent', + 'benefits' => 'setBenefits' ]; /** @@ -191,7 +196,8 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $getters = [ 'bid' => 'getBid', - 'show_percent' => 'getShowPercent' + 'show_percent' => 'getShowPercent', + 'benefits' => 'getBenefits' ]; /** @@ -246,13 +252,14 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bid', $data ?? [], null); $this->setIfExists('show_percent', $data ?? [], null); + $this->setIfExists('benefits', $data ?? [], null); } /** @@ -304,6 +311,10 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri $invalidProperties[] = "invalid value for 'show_percent', must be bigger than or equal to 0."; } + if (!is_null($this->container['benefits']) && (count($this->container['benefits']) < 1)) { + $invalidProperties[] = "invalid value for 'benefits', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -388,14 +399,53 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri return $this; } + + /** + * Gets benefits + * + * @return \OpenAPI\Client\Model\BenefitType[]|null + */ + public function getBenefits() + { + return $this->container['benefits']; + } + + /** + * Sets benefits + * + * @param \OpenAPI\Client\Model\BenefitType[]|null $benefits Список доступных субсидий. Чтобы получить необходимый инструмент продвижения, установите ставку, которая будет рекомендована для этого инструмента или выше. + * + * @return self + */ + public function setBenefits($benefits) + { + if (is_null($benefits)) { + array_push($this->openAPINullablesSetToNull, 'benefits'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('benefits', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($benefits) && (count($benefits) < 1)) { + throw new \InvalidArgumentException('invalid length for $benefits when calling BidRecommendationItemDTO., number of items must be greater than or equal to 1.'); + } + $this->container['benefits'] = $benefits; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -403,12 +453,12 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -433,11 +483,11 @@ class BidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BriefOrderItemDTO.php b/erp24/lib/yandex_market_api/Model/BriefOrderItemDTO.php index 27d28006..17dfcdbb 100644 --- a/erp24/lib/yandex_market_api/Model/BriefOrderItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/BriefOrderItemDTO.php @@ -2,7 +2,7 @@ /** * BriefOrderItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -276,10 +276,10 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('vat', $data ?? [], null); @@ -325,8 +325,12 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -357,7 +361,7 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets id * - * @param int|null $id Идентификатор товара в заказе. Позволяет идентифицировать товар в рамках данного заказа. + * @param int|null $id Идентификатор товара в заказе. Позволяет идентифицировать товар в рамках заказа. * * @return self */ @@ -438,7 +442,7 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets price * - * @param float|null $price Цена на товар. Указана в той валюте, которая была задана в каталоге. Разделитель целой и дробной части — точка. + * @param float|null $price Цена товара. Указана в той валюте, которая была задана в каталоге. Разделитель целой и дробной части — точка. * * @return self */ @@ -492,7 +496,7 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -507,8 +511,8 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling BriefOrderItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling BriefOrderItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling BriefOrderItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -529,7 +533,7 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets instances * - * @param \OpenAPI\Client\Model\OrderItemInstanceDTO[]|null $instances Переданные вами коды маркировки. + * @param \OpenAPI\Client\Model\OrderItemInstanceDTO[]|null $instances Переданные коды маркировки. * * @return self */ @@ -545,6 +549,11 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling BriefOrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['instances'] = $instances; return $this; @@ -552,11 +561,11 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -564,12 +573,12 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -594,11 +603,11 @@ class BriefOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BriefOrderItemInstanceDTO.php b/erp24/lib/yandex_market_api/Model/BriefOrderItemInstanceDTO.php index d5e523b0..dd84f1b3 100644 --- a/erp24/lib/yandex_market_api/Model/BriefOrderItemInstanceDTO.php +++ b/erp24/lib/yandex_market_api/Model/BriefOrderItemInstanceDTO.php @@ -2,7 +2,7 @@ /** * BriefOrderItemInstanceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * BriefOrderItemInstanceDTO Class Doc Comment * * @category Class - * @description Идентификатор единицы товара. Заполните только одно поле в зависимости от того, в какой системе маркирован товар. Подробно о работе с маркируемыми товарами рассказано [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/orders/cz.html). + * @description Идентификатор единицы товара. Заполните только одно поле в зависимости от того, в какой системе маркирован товар. Подробно о работе с маркируемыми товарами читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/orders/cz.html). * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -61,7 +61,8 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer 'cis' => 'string', 'uin' => 'string', 'rnpt' => 'string', - 'gtd' => 'string' + 'gtd' => 'string', + 'country_code' => 'string' ]; /** @@ -75,7 +76,8 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer 'cis' => null, 'uin' => null, 'rnpt' => null, - 'gtd' => null + 'gtd' => null, + 'country_code' => null ]; /** @@ -87,7 +89,8 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer 'cis' => false, 'uin' => false, 'rnpt' => false, - 'gtd' => false + 'gtd' => false, + 'country_code' => false ]; /** @@ -179,7 +182,8 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer 'cis' => 'cis', 'uin' => 'uin', 'rnpt' => 'rnpt', - 'gtd' => 'gtd' + 'gtd' => 'gtd', + 'country_code' => 'countryCode' ]; /** @@ -191,7 +195,8 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer 'cis' => 'setCis', 'uin' => 'setUin', 'rnpt' => 'setRnpt', - 'gtd' => 'setGtd' + 'gtd' => 'setGtd', + 'country_code' => 'setCountryCode' ]; /** @@ -203,7 +208,8 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer 'cis' => 'getCis', 'uin' => 'getUin', 'rnpt' => 'getRnpt', - 'gtd' => 'getGtd' + 'gtd' => 'getGtd', + 'country_code' => 'getCountryCode' ]; /** @@ -258,15 +264,16 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('cis', $data ?? [], null); $this->setIfExists('uin', $data ?? [], null); $this->setIfExists('rnpt', $data ?? [], null); $this->setIfExists('gtd', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); } /** @@ -296,6 +303,18 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) > 2)) { + $invalidProperties[] = "invalid value for 'country_code', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) < 2)) { + $invalidProperties[] = "invalid value for 'country_code', the character length must be bigger than or equal to 2."; + } + + if (!is_null($this->container['country_code']) && !preg_match("/^[A-Z]{2}$/", $this->container['country_code'])) { + $invalidProperties[] = "invalid value for 'country_code', must be conform to the pattern /^[A-Z]{2}$/."; + } + return $invalidProperties; } @@ -324,7 +343,7 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Sets cis * - * @param string|null $cis Код идентификации единицы товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/). {% note warning %} Не экранируйте косую черту в коде символа-разделителя `\\u001d`! ✅ `01030410947874432155Qbag!\\u001d93Zjqw` ❌ `01030410947874432155Qbag!\\\\u001d93Zjqw` Косые черты и кавычки в других местах экранируйте по правилам JSON: `\\\\` и `\\\"` {% endnote %} + * @param string|null $cis [Код идентификации](*cis-regular-value) единицы товара в системе [«Честный ЗНАК»](https://честныйзнак.рф/) или [«ASL BELGISI»](https://aslbelgisi.uz) (для продавцов Market Yandex Go). {% note warning \"Не экранируйте косую черту в коде символа-разделителя `\\u001d`\" %} ✅ `01030410947874432155Qbag!\\u001d93Zjqw` ❌ `01030410947874432155Qbag!\\\\u001d93Zjqw` Косые черты и кавычки в других местах экранируйте по правилам JSON: `\\\\` и `\\\"` {% endnote %} * * @return self */ @@ -418,14 +437,51 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer return $this; } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code Страна производства в формате ISO 3166-1 alpha-2. [Как получить](../../reference/regions/getRegionsCodes.md) + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + if ((mb_strlen($country_code) > 2)) { + throw new \InvalidArgumentException('invalid length for $country_code when calling BriefOrderItemInstanceDTO., must be smaller than or equal to 2.'); + } + if ((mb_strlen($country_code) < 2)) { + throw new \InvalidArgumentException('invalid length for $country_code when calling BriefOrderItemInstanceDTO., must be bigger than or equal to 2.'); + } + if ((!preg_match("/^[A-Z]{2}$/", ObjectSerializer::toString($country_code)))) { + throw new \InvalidArgumentException("invalid value for \$country_code when calling BriefOrderItemInstanceDTO., must conform to the pattern /^[A-Z]{2}$/."); + } + + $this->container['country_code'] = $country_code; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +489,12 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +519,11 @@ class BriefOrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BusinessDTO.php b/erp24/lib/yandex_market_api/Model/BusinessDTO.php index 6e93d2eb..a23c325e 100644 --- a/erp24/lib/yandex_market_api/Model/BusinessDTO.php +++ b/erp24/lib/yandex_market_api/Model/BusinessDTO.php @@ -2,7 +2,7 @@ /** * BusinessDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -282,6 +282,10 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if (!is_null($this->container['id']) && ($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -310,7 +314,7 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id Идентификатор кабинета. + * @param int|null $id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -319,6 +323,11 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($id)) { throw new \InvalidArgumentException('non-nullable id cannot be null'); } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling BusinessDTO., must be bigger than or equal to 1.'); + } + $this->container['id'] = $id; return $this; @@ -353,11 +362,11 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +374,12 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +404,11 @@ class BusinessDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutDTO.php new file mode 100644 index 00000000..9dffc027 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutDTO.php @@ -0,0 +1,496 @@ + + */ +class BusinessOrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderBoxLayoutDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OpenAPI\Client\Model\BusinessOrderBoxLayoutItemDTO[]', + 'box_id' => 'int', + 'barcode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'box_id' => 'int64', + 'barcode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => false, + 'box_id' => false, + 'barcode' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'box_id' => 'boxId', + 'barcode' => 'barcode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'box_id' => 'setBoxId', + 'barcode' => 'setBarcode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'box_id' => 'getBoxId', + 'barcode' => 'getBarcode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('box_id', $data ?? [], null); + $this->setIfExists('barcode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + if ((count($this->container['items']) < 1)) { + $invalidProperties[] = "invalid value for 'items', number of items must be greater than or equal to 1."; + } + + if ($this->container['box_id'] === null) { + $invalidProperties[] = "'box_id' can't be null"; + } + if ($this->container['barcode'] === null) { + $invalidProperties[] = "'barcode' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OpenAPI\Client\Model\BusinessOrderBoxLayoutItemDTO[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OpenAPI\Client\Model\BusinessOrderBoxLayoutItemDTO[] $items Список товаров в коробке. Если в коробке едет часть большого товара, в списке может быть только один пункт. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + + + if ((count($items) < 1)) { + throw new \InvalidArgumentException('invalid length for $items when calling BusinessOrderBoxLayoutDTO., number of items must be greater than or equal to 1.'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets box_id + * + * @return int + */ + public function getBoxId() + { + return $this->container['box_id']; + } + + /** + * Sets box_id + * + * @param int $box_id Идентификатор коробки. + * + * @return self + */ + public function setBoxId($box_id) + { + if (is_null($box_id)) { + throw new \InvalidArgumentException('non-nullable box_id cannot be null'); + } + $this->container['box_id'] = $box_id; + + return $this; + } + + /** + * Gets barcode + * + * @return string + */ + public function getBarcode() + { + return $this->container['barcode']; + } + + /** + * Sets barcode + * + * @param string $barcode Идентификатор грузового места в системе магазина. + * + * @return self + */ + public function setBarcode($barcode) + { + if (is_null($barcode)) { + throw new \InvalidArgumentException('non-nullable barcode cannot be null'); + } + $this->container['barcode'] = $barcode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutItemDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutItemDTO.php new file mode 100644 index 00000000..badc3b59 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutItemDTO.php @@ -0,0 +1,540 @@ + + */ +class BusinessOrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderBoxLayoutItemDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'full_count' => 'int', + 'partial_count' => '\OpenAPI\Client\Model\BusinessOrderBoxLayoutPartialCountDTO', + 'instances' => '\OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'full_count' => 'int32', + 'partial_count' => null, + 'instances' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'full_count' => false, + 'partial_count' => false, + 'instances' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'full_count' => 'fullCount', + 'partial_count' => 'partialCount', + 'instances' => 'instances' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'full_count' => 'setFullCount', + 'partial_count' => 'setPartialCount', + 'instances' => 'setInstances' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'full_count' => 'getFullCount', + 'partial_count' => 'getPartialCount', + 'instances' => 'getInstances' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('full_count', $data ?? [], null); + $this->setIfExists('partial_count', $data ?? [], null); + $this->setIfExists('instances', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (!is_null($this->container['full_count']) && ($this->container['full_count'] < 1)) { + $invalidProperties[] = "invalid value for 'full_count', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор товара в заказе. Параметр `id` в `items`. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets full_count + * + * @return int|null + */ + public function getFullCount() + { + return $this->container['full_count']; + } + + /** + * Sets full_count + * + * @param int|null $full_count Количество единиц товара в коробке. + * + * @return self + */ + public function setFullCount($full_count) + { + if (is_null($full_count)) { + throw new \InvalidArgumentException('non-nullable full_count cannot be null'); + } + + if (($full_count < 1)) { + throw new \InvalidArgumentException('invalid value for $full_count when calling BusinessOrderBoxLayoutItemDTO., must be bigger than or equal to 1.'); + } + + $this->container['full_count'] = $full_count; + + return $this; + } + + /** + * Gets partial_count + * + * @return \OpenAPI\Client\Model\BusinessOrderBoxLayoutPartialCountDTO|null + */ + public function getPartialCount() + { + return $this->container['partial_count']; + } + + /** + * Sets partial_count + * + * @param \OpenAPI\Client\Model\BusinessOrderBoxLayoutPartialCountDTO|null $partial_count partial_count + * + * @return self + */ + public function setPartialCount($partial_count) + { + if (is_null($partial_count)) { + throw new \InvalidArgumentException('non-nullable partial_count cannot be null'); + } + $this->container['partial_count'] = $partial_count; + + return $this; + } + + /** + * Gets instances + * + * @return \OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]|null + */ + public function getInstances() + { + return $this->container['instances']; + } + + /** + * Sets instances + * + * @param \OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]|null $instances Переданные коды маркировки. + * + * @return self + */ + public function setInstances($instances) + { + if (is_null($instances)) { + array_push($this->openAPINullablesSetToNull, 'instances'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('instances', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling BusinessOrderBoxLayoutItemDTO., number of items must be greater than or equal to 1.'); + } + $this->container['instances'] = $instances; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutPartialCountDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutPartialCountDTO.php new file mode 100644 index 00000000..ba471f70 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderBoxLayoutPartialCountDTO.php @@ -0,0 +1,468 @@ + + */ +class BusinessOrderBoxLayoutPartialCountDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderBoxLayoutPartialCountDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'current' => 'int', + 'total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'current' => 'int32', + 'total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'current' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'current' => 'current', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'current' => 'setCurrent', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'current' => 'getCurrent', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('current', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['current'] === null) { + $invalidProperties[] = "'current' can't be null"; + } + if (($this->container['current'] < 1)) { + $invalidProperties[] = "invalid value for 'current', must be bigger than or equal to 1."; + } + + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if (($this->container['total'] < 2)) { + $invalidProperties[] = "invalid value for 'total', must be bigger than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets current + * + * @return int + */ + public function getCurrent() + { + return $this->container['current']; + } + + /** + * Sets current + * + * @param int $current Номер части, начиная с 1. + * + * @return self + */ + public function setCurrent($current) + { + if (is_null($current)) { + throw new \InvalidArgumentException('non-nullable current cannot be null'); + } + + if (($current < 1)) { + throw new \InvalidArgumentException('invalid value for $current when calling BusinessOrderBoxLayoutPartialCountDTO., must be bigger than or equal to 1.'); + } + + $this->container['current'] = $current; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total На сколько всего частей разделен товар. + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + + if (($total < 2)) { + throw new \InvalidArgumentException('invalid value for $total when calling BusinessOrderBoxLayoutPartialCountDTO., must be bigger than or equal to 2.'); + } + + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderCourierDeliveryDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderCourierDeliveryDTO.php new file mode 100644 index 00000000..827ccef1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderCourierDeliveryDTO.php @@ -0,0 +1,444 @@ + + */ +class BusinessOrderCourierDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderCourierDeliveryDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\OpenAPI\Client\Model\BusinessOrderDeliveryAddressDTO', + 'region' => '\OpenAPI\Client\Model\RegionDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'region' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'address' => false, + 'region' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'region' => 'region' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'region' => 'setRegion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'region' => 'getRegion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('region', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \OpenAPI\Client\Model\BusinessOrderDeliveryAddressDTO|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \OpenAPI\Client\Model\BusinessOrderDeliveryAddressDTO|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets region + * + * @return \OpenAPI\Client\Model\RegionDTO|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param \OpenAPI\Client\Model\RegionDTO|null $region region + * + * @return self + */ + public function setRegion($region) + { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } + $this->container['region'] = $region; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderDTO.php new file mode 100644 index 00000000..33fee2d3 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderDTO.php @@ -0,0 +1,1036 @@ + + */ +class BusinessOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'order_id' => 'int', + 'campaign_id' => 'int', + 'program_type' => '\OpenAPI\Client\Model\SellingProgramType', + 'external_order_id' => 'string', + 'status' => '\OpenAPI\Client\Model\OrderStatusType', + 'substatus' => '\OpenAPI\Client\Model\OrderSubstatusType', + 'creation_date' => '\DateTime', + 'update_date' => '\DateTime', + 'payment_type' => '\OpenAPI\Client\Model\OrderPaymentType', + 'payment_method' => '\OpenAPI\Client\Model\OrderPaymentMethodType', + 'fake' => 'bool', + 'items' => '\OpenAPI\Client\Model\BusinessOrderItemDTO[]', + 'prices' => '\OpenAPI\Client\Model\OrderPriceDTO', + 'delivery' => '\OpenAPI\Client\Model\BusinessOrderDeliveryDTO', + 'services' => '\OpenAPI\Client\Model\BusinessOrderServicesDTO', + 'buyer_type' => '\OpenAPI\Client\Model\OrderBuyerType', + 'notes' => 'string', + 'cancel_requested' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'order_id' => 'int64', + 'campaign_id' => 'int64', + 'program_type' => null, + 'external_order_id' => null, + 'status' => null, + 'substatus' => null, + 'creation_date' => 'date-time', + 'update_date' => 'date-time', + 'payment_type' => null, + 'payment_method' => null, + 'fake' => null, + 'items' => null, + 'prices' => null, + 'delivery' => null, + 'services' => null, + 'buyer_type' => null, + 'notes' => null, + 'cancel_requested' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'order_id' => false, + 'campaign_id' => false, + 'program_type' => false, + 'external_order_id' => false, + 'status' => false, + 'substatus' => false, + 'creation_date' => false, + 'update_date' => false, + 'payment_type' => false, + 'payment_method' => false, + 'fake' => false, + 'items' => false, + 'prices' => false, + 'delivery' => false, + 'services' => false, + 'buyer_type' => false, + 'notes' => false, + 'cancel_requested' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_id' => 'orderId', + 'campaign_id' => 'campaignId', + 'program_type' => 'programType', + 'external_order_id' => 'externalOrderId', + 'status' => 'status', + 'substatus' => 'substatus', + 'creation_date' => 'creationDate', + 'update_date' => 'updateDate', + 'payment_type' => 'paymentType', + 'payment_method' => 'paymentMethod', + 'fake' => 'fake', + 'items' => 'items', + 'prices' => 'prices', + 'delivery' => 'delivery', + 'services' => 'services', + 'buyer_type' => 'buyerType', + 'notes' => 'notes', + 'cancel_requested' => 'cancelRequested' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_id' => 'setOrderId', + 'campaign_id' => 'setCampaignId', + 'program_type' => 'setProgramType', + 'external_order_id' => 'setExternalOrderId', + 'status' => 'setStatus', + 'substatus' => 'setSubstatus', + 'creation_date' => 'setCreationDate', + 'update_date' => 'setUpdateDate', + 'payment_type' => 'setPaymentType', + 'payment_method' => 'setPaymentMethod', + 'fake' => 'setFake', + 'items' => 'setItems', + 'prices' => 'setPrices', + 'delivery' => 'setDelivery', + 'services' => 'setServices', + 'buyer_type' => 'setBuyerType', + 'notes' => 'setNotes', + 'cancel_requested' => 'setCancelRequested' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_id' => 'getOrderId', + 'campaign_id' => 'getCampaignId', + 'program_type' => 'getProgramType', + 'external_order_id' => 'getExternalOrderId', + 'status' => 'getStatus', + 'substatus' => 'getSubstatus', + 'creation_date' => 'getCreationDate', + 'update_date' => 'getUpdateDate', + 'payment_type' => 'getPaymentType', + 'payment_method' => 'getPaymentMethod', + 'fake' => 'getFake', + 'items' => 'getItems', + 'prices' => 'getPrices', + 'delivery' => 'getDelivery', + 'services' => 'getServices', + 'buyer_type' => 'getBuyerType', + 'notes' => 'getNotes', + 'cancel_requested' => 'getCancelRequested' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('program_type', $data ?? [], null); + $this->setIfExists('external_order_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('substatus', $data ?? [], null); + $this->setIfExists('creation_date', $data ?? [], null); + $this->setIfExists('update_date', $data ?? [], null); + $this->setIfExists('payment_type', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('fake', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('prices', $data ?? [], null); + $this->setIfExists('delivery', $data ?? [], null); + $this->setIfExists('services', $data ?? [], null); + $this->setIfExists('buyer_type', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('cancel_requested', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['order_id'] === null) { + $invalidProperties[] = "'order_id' can't be null"; + } + if ($this->container['campaign_id'] === null) { + $invalidProperties[] = "'campaign_id' can't be null"; + } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['external_order_id']) && (mb_strlen($this->container['external_order_id']) < 1)) { + $invalidProperties[] = "invalid value for 'external_order_id', the character length must be bigger than or equal to 1."; + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['substatus'] === null) { + $invalidProperties[] = "'substatus' can't be null"; + } + if ($this->container['creation_date'] === null) { + $invalidProperties[] = "'creation_date' can't be null"; + } + if ($this->container['payment_type'] === null) { + $invalidProperties[] = "'payment_type' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + if ($this->container['fake'] === null) { + $invalidProperties[] = "'fake' can't be null"; + } + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + if ($this->container['delivery'] === null) { + $invalidProperties[] = "'delivery' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_id + * + * @return int + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param int $order_id Идентификатор заказа. + * + * @return self + */ + public function setOrderId($order_id) + { + if (is_null($order_id)) { + throw new \InvalidArgumentException('non-nullable order_id cannot be null'); + } + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets campaign_id + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling BusinessOrderDTO., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets program_type + * + * @return \OpenAPI\Client\Model\SellingProgramType|null + */ + public function getProgramType() + { + return $this->container['program_type']; + } + + /** + * Sets program_type + * + * @param \OpenAPI\Client\Model\SellingProgramType|null $program_type program_type + * + * @return self + */ + public function setProgramType($program_type) + { + if (is_null($program_type)) { + throw new \InvalidArgumentException('non-nullable program_type cannot be null'); + } + $this->container['program_type'] = $program_type; + + return $this; + } + + /** + * Gets external_order_id + * + * @return string|null + */ + public function getExternalOrderId() + { + return $this->container['external_order_id']; + } + + /** + * Sets external_order_id + * + * @param string|null $external_order_id Внешний идентификатор заказа, который вы передали в [POST v2/campaigns/{campaignId}/orders/{orderId}/external-id](../../reference/orders/updateExternalOrderId.md). + * + * @return self + */ + public function setExternalOrderId($external_order_id) + { + if (is_null($external_order_id)) { + throw new \InvalidArgumentException('non-nullable external_order_id cannot be null'); + } + + if ((mb_strlen($external_order_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_order_id when calling BusinessOrderDTO., must be bigger than or equal to 1.'); + } + + $this->container['external_order_id'] = $external_order_id; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\OrderStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\OrderStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets substatus + * + * @return \OpenAPI\Client\Model\OrderSubstatusType + */ + public function getSubstatus() + { + return $this->container['substatus']; + } + + /** + * Sets substatus + * + * @param \OpenAPI\Client\Model\OrderSubstatusType $substatus substatus + * + * @return self + */ + public function setSubstatus($substatus) + { + if (is_null($substatus)) { + throw new \InvalidArgumentException('non-nullable substatus cannot be null'); + } + $this->container['substatus'] = $substatus; + + return $this; + } + + /** + * Gets creation_date + * + * @return \DateTime + */ + public function getCreationDate() + { + return $this->container['creation_date']; + } + + /** + * Sets creation_date + * + * @param \DateTime $creation_date Дата и время оформления заказа. Формат даты: ISO 8601 со смещением относительно UTC. + * + * @return self + */ + public function setCreationDate($creation_date) + { + if (is_null($creation_date)) { + throw new \InvalidArgumentException('non-nullable creation_date cannot be null'); + } + $this->container['creation_date'] = $creation_date; + + return $this; + } + + /** + * Gets update_date + * + * @return \DateTime|null + */ + public function getUpdateDate() + { + return $this->container['update_date']; + } + + /** + * Sets update_date + * + * @param \DateTime|null $update_date Дата и время последнего обновления заказа. Формат даты: ISO 8601 со смещением относительно UTC. + * + * @return self + */ + public function setUpdateDate($update_date) + { + if (is_null($update_date)) { + throw new \InvalidArgumentException('non-nullable update_date cannot be null'); + } + $this->container['update_date'] = $update_date; + + return $this; + } + + /** + * Gets payment_type + * + * @return \OpenAPI\Client\Model\OrderPaymentType + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param \OpenAPI\Client\Model\OrderPaymentType $payment_type payment_type + * + * @return self + */ + public function setPaymentType($payment_type) + { + if (is_null($payment_type)) { + throw new \InvalidArgumentException('non-nullable payment_type cannot be null'); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets payment_method + * + * @return \OpenAPI\Client\Model\OrderPaymentMethodType + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \OpenAPI\Client\Model\OrderPaymentMethodType $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets fake + * + * @return bool + */ + public function getFake() + { + return $this->container['fake']; + } + + /** + * Sets fake + * + * @param bool $fake Тип заказа: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. + * + * @return self + */ + public function setFake($fake) + { + if (is_null($fake)) { + throw new \InvalidArgumentException('non-nullable fake cannot be null'); + } + $this->container['fake'] = $fake; + + return $this; + } + + /** + * Gets items + * + * @return \OpenAPI\Client\Model\BusinessOrderItemDTO[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OpenAPI\Client\Model\BusinessOrderItemDTO[] $items Список товаров в заказе. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets prices + * + * @return \OpenAPI\Client\Model\OrderPriceDTO|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param \OpenAPI\Client\Model\OrderPriceDTO|null $prices prices + * + * @return self + */ + public function setPrices($prices) + { + if (is_null($prices)) { + throw new \InvalidArgumentException('non-nullable prices cannot be null'); + } + $this->container['prices'] = $prices; + + return $this; + } + + /** + * Gets delivery + * + * @return \OpenAPI\Client\Model\BusinessOrderDeliveryDTO + */ + public function getDelivery() + { + return $this->container['delivery']; + } + + /** + * Sets delivery + * + * @param \OpenAPI\Client\Model\BusinessOrderDeliveryDTO $delivery delivery + * + * @return self + */ + public function setDelivery($delivery) + { + if (is_null($delivery)) { + throw new \InvalidArgumentException('non-nullable delivery cannot be null'); + } + $this->container['delivery'] = $delivery; + + return $this; + } + + /** + * Gets services + * + * @return \OpenAPI\Client\Model\BusinessOrderServicesDTO|null + */ + public function getServices() + { + return $this->container['services']; + } + + /** + * Sets services + * + * @param \OpenAPI\Client\Model\BusinessOrderServicesDTO|null $services services + * + * @return self + */ + public function setServices($services) + { + if (is_null($services)) { + throw new \InvalidArgumentException('non-nullable services cannot be null'); + } + $this->container['services'] = $services; + + return $this; + } + + /** + * Gets buyer_type + * + * @return \OpenAPI\Client\Model\OrderBuyerType|null + */ + public function getBuyerType() + { + return $this->container['buyer_type']; + } + + /** + * Sets buyer_type + * + * @param \OpenAPI\Client\Model\OrderBuyerType|null $buyer_type buyer_type + * + * @return self + */ + public function setBuyerType($buyer_type) + { + if (is_null($buyer_type)) { + throw new \InvalidArgumentException('non-nullable buyer_type cannot be null'); + } + $this->container['buyer_type'] = $buyer_type; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes Комментарий к заказу. + * + * @return self + */ + public function setNotes($notes) + { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets cancel_requested + * + * @return bool|null + */ + public function getCancelRequested() + { + return $this->container['cancel_requested']; + } + + /** + * Sets cancel_requested + * + * @param bool|null $cancel_requested **Только для модели DBS** Запрошена ли отмена. + * + * @return self + */ + public function setCancelRequested($cancel_requested) + { + if (is_null($cancel_requested)) { + throw new \InvalidArgumentException('non-nullable cancel_requested cannot be null'); + } + $this->container['cancel_requested'] = $cancel_requested; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryAddressDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryAddressDTO.php new file mode 100644 index 00000000..d0e47b7f --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryAddressDTO.php @@ -0,0 +1,818 @@ + + */ +class BusinessOrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderDeliveryAddressDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country' => 'string', + 'postcode' => 'string', + 'city' => 'string', + 'district' => 'string', + 'subway' => 'string', + 'street' => 'string', + 'house' => 'string', + 'block' => 'string', + 'entrance' => 'string', + 'entryphone' => 'string', + 'floor' => 'string', + 'apartment' => 'string', + 'gps' => '\OpenAPI\Client\Model\GpsDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country' => null, + 'postcode' => null, + 'city' => null, + 'district' => null, + 'subway' => null, + 'street' => null, + 'house' => null, + 'block' => null, + 'entrance' => null, + 'entryphone' => null, + 'floor' => null, + 'apartment' => null, + 'gps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'country' => false, + 'postcode' => false, + 'city' => false, + 'district' => false, + 'subway' => false, + 'street' => false, + 'house' => false, + 'block' => false, + 'entrance' => false, + 'entryphone' => false, + 'floor' => false, + 'apartment' => false, + 'gps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', + 'postcode' => 'postcode', + 'city' => 'city', + 'district' => 'district', + 'subway' => 'subway', + 'street' => 'street', + 'house' => 'house', + 'block' => 'block', + 'entrance' => 'entrance', + 'entryphone' => 'entryphone', + 'floor' => 'floor', + 'apartment' => 'apartment', + 'gps' => 'gps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'postcode' => 'setPostcode', + 'city' => 'setCity', + 'district' => 'setDistrict', + 'subway' => 'setSubway', + 'street' => 'setStreet', + 'house' => 'setHouse', + 'block' => 'setBlock', + 'entrance' => 'setEntrance', + 'entryphone' => 'setEntryphone', + 'floor' => 'setFloor', + 'apartment' => 'setApartment', + 'gps' => 'setGps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'postcode' => 'getPostcode', + 'city' => 'getCity', + 'district' => 'getDistrict', + 'subway' => 'getSubway', + 'street' => 'getStreet', + 'house' => 'getHouse', + 'block' => 'getBlock', + 'entrance' => 'getEntrance', + 'entryphone' => 'getEntryphone', + 'floor' => 'getFloor', + 'apartment' => 'getApartment', + 'gps' => 'getGps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('postcode', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('district', $data ?? [], null); + $this->setIfExists('subway', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('house', $data ?? [], null); + $this->setIfExists('block', $data ?? [], null); + $this->setIfExists('entrance', $data ?? [], null); + $this->setIfExists('entryphone', $data ?? [], null); + $this->setIfExists('floor', $data ?? [], null); + $this->setIfExists('apartment', $data ?? [], null); + $this->setIfExists('gps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Страна. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets postcode + * + * @return string|null + */ + public function getPostcode() + { + return $this->container['postcode']; + } + + /** + * Sets postcode + * + * @param string|null $postcode Почтовый индекс. + * + * @return self + */ + public function setPostcode($postcode) + { + if (is_null($postcode)) { + throw new \InvalidArgumentException('non-nullable postcode cannot be null'); + } + $this->container['postcode'] = $postcode; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city Город или населенный пункт. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets district + * + * @return string|null + */ + public function getDistrict() + { + return $this->container['district']; + } + + /** + * Sets district + * + * @param string|null $district Район. + * + * @return self + */ + public function setDistrict($district) + { + if (is_null($district)) { + throw new \InvalidArgumentException('non-nullable district cannot be null'); + } + $this->container['district'] = $district; + + return $this; + } + + /** + * Gets subway + * + * @return string|null + */ + public function getSubway() + { + return $this->container['subway']; + } + + /** + * Sets subway + * + * @param string|null $subway Станция метро. + * + * @return self + */ + public function setSubway($subway) + { + if (is_null($subway)) { + throw new \InvalidArgumentException('non-nullable subway cannot be null'); + } + $this->container['subway'] = $subway; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street Улица. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets house + * + * @return string|null + */ + public function getHouse() + { + return $this->container['house']; + } + + /** + * Sets house + * + * @param string|null $house Номер дома. + * + * @return self + */ + public function setHouse($house) + { + if (is_null($house)) { + throw new \InvalidArgumentException('non-nullable house cannot be null'); + } + $this->container['house'] = $house; + + return $this; + } + + /** + * Gets block + * + * @return string|null + */ + public function getBlock() + { + return $this->container['block']; + } + + /** + * Sets block + * + * @param string|null $block Корпус. + * + * @return self + */ + public function setBlock($block) + { + if (is_null($block)) { + throw new \InvalidArgumentException('non-nullable block cannot be null'); + } + $this->container['block'] = $block; + + return $this; + } + + /** + * Gets entrance + * + * @return string|null + */ + public function getEntrance() + { + return $this->container['entrance']; + } + + /** + * Sets entrance + * + * @param string|null $entrance Номер подъезда. + * + * @return self + */ + public function setEntrance($entrance) + { + if (is_null($entrance)) { + throw new \InvalidArgumentException('non-nullable entrance cannot be null'); + } + $this->container['entrance'] = $entrance; + + return $this; + } + + /** + * Gets entryphone + * + * @return string|null + */ + public function getEntryphone() + { + return $this->container['entryphone']; + } + + /** + * Sets entryphone + * + * @param string|null $entryphone Код домофона. + * + * @return self + */ + public function setEntryphone($entryphone) + { + if (is_null($entryphone)) { + throw new \InvalidArgumentException('non-nullable entryphone cannot be null'); + } + $this->container['entryphone'] = $entryphone; + + return $this; + } + + /** + * Gets floor + * + * @return string|null + */ + public function getFloor() + { + return $this->container['floor']; + } + + /** + * Sets floor + * + * @param string|null $floor Этаж. + * + * @return self + */ + public function setFloor($floor) + { + if (is_null($floor)) { + throw new \InvalidArgumentException('non-nullable floor cannot be null'); + } + $this->container['floor'] = $floor; + + return $this; + } + + /** + * Gets apartment + * + * @return string|null + */ + public function getApartment() + { + return $this->container['apartment']; + } + + /** + * Sets apartment + * + * @param string|null $apartment Номер квартиры или офиса. + * + * @return self + */ + public function setApartment($apartment) + { + if (is_null($apartment)) { + throw new \InvalidArgumentException('non-nullable apartment cannot be null'); + } + $this->container['apartment'] = $apartment; + + return $this; + } + + /** + * Gets gps + * + * @return \OpenAPI\Client\Model\GpsDTO|null + */ + public function getGps() + { + return $this->container['gps']; + } + + /** + * Sets gps + * + * @param \OpenAPI\Client\Model\GpsDTO|null $gps gps + * + * @return self + */ + public function setGps($gps) + { + if (is_null($gps)) { + throw new \InvalidArgumentException('non-nullable gps cannot be null'); + } + $this->container['gps'] = $gps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryDTO.php new file mode 100644 index 00000000..35523636 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryDTO.php @@ -0,0 +1,899 @@ + + */ +class BusinessOrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderDeliveryDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\OpenAPI\Client\Model\OrderDeliveryType', + 'service_name' => 'string', + 'delivery_service_id' => 'int', + 'warehouse_id' => 'string', + 'delivery_partner_type' => '\OpenAPI\Client\Model\OrderDeliveryPartnerType', + 'dispatch_type' => '\OpenAPI\Client\Model\OrderDeliveryDispatchType', + 'dates' => '\OpenAPI\Client\Model\BusinessOrderDeliveryDatesDTO', + 'shipment' => '\OpenAPI\Client\Model\BusinessOrderShipmentDTO', + 'courier' => '\OpenAPI\Client\Model\BusinessOrderCourierDeliveryDTO', + 'pickup' => '\OpenAPI\Client\Model\BusinessOrderPickupDeliveryDTO', + 'transfer' => '\OpenAPI\Client\Model\BusinessOrderTransferDTO', + 'boxes_layout' => '\OpenAPI\Client\Model\BusinessOrderBoxLayoutDTO[]', + 'tracks' => '\OpenAPI\Client\Model\OrderTrackDTO[]', + 'estimated' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'service_name' => null, + 'delivery_service_id' => 'int64', + 'warehouse_id' => null, + 'delivery_partner_type' => null, + 'dispatch_type' => null, + 'dates' => null, + 'shipment' => null, + 'courier' => null, + 'pickup' => null, + 'transfer' => null, + 'boxes_layout' => null, + 'tracks' => null, + 'estimated' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'service_name' => false, + 'delivery_service_id' => false, + 'warehouse_id' => false, + 'delivery_partner_type' => false, + 'dispatch_type' => false, + 'dates' => false, + 'shipment' => false, + 'courier' => false, + 'pickup' => false, + 'transfer' => false, + 'boxes_layout' => true, + 'tracks' => true, + 'estimated' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'service_name' => 'serviceName', + 'delivery_service_id' => 'deliveryServiceId', + 'warehouse_id' => 'warehouseId', + 'delivery_partner_type' => 'deliveryPartnerType', + 'dispatch_type' => 'dispatchType', + 'dates' => 'dates', + 'shipment' => 'shipment', + 'courier' => 'courier', + 'pickup' => 'pickup', + 'transfer' => 'transfer', + 'boxes_layout' => 'boxesLayout', + 'tracks' => 'tracks', + 'estimated' => 'estimated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'service_name' => 'setServiceName', + 'delivery_service_id' => 'setDeliveryServiceId', + 'warehouse_id' => 'setWarehouseId', + 'delivery_partner_type' => 'setDeliveryPartnerType', + 'dispatch_type' => 'setDispatchType', + 'dates' => 'setDates', + 'shipment' => 'setShipment', + 'courier' => 'setCourier', + 'pickup' => 'setPickup', + 'transfer' => 'setTransfer', + 'boxes_layout' => 'setBoxesLayout', + 'tracks' => 'setTracks', + 'estimated' => 'setEstimated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'service_name' => 'getServiceName', + 'delivery_service_id' => 'getDeliveryServiceId', + 'warehouse_id' => 'getWarehouseId', + 'delivery_partner_type' => 'getDeliveryPartnerType', + 'dispatch_type' => 'getDispatchType', + 'dates' => 'getDates', + 'shipment' => 'getShipment', + 'courier' => 'getCourier', + 'pickup' => 'getPickup', + 'transfer' => 'getTransfer', + 'boxes_layout' => 'getBoxesLayout', + 'tracks' => 'getTracks', + 'estimated' => 'getEstimated' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('service_name', $data ?? [], null); + $this->setIfExists('delivery_service_id', $data ?? [], null); + $this->setIfExists('warehouse_id', $data ?? [], null); + $this->setIfExists('delivery_partner_type', $data ?? [], null); + $this->setIfExists('dispatch_type', $data ?? [], null); + $this->setIfExists('dates', $data ?? [], null); + $this->setIfExists('shipment', $data ?? [], null); + $this->setIfExists('courier', $data ?? [], null); + $this->setIfExists('pickup', $data ?? [], null); + $this->setIfExists('transfer', $data ?? [], null); + $this->setIfExists('boxes_layout', $data ?? [], null); + $this->setIfExists('tracks', $data ?? [], null); + $this->setIfExists('estimated', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['service_name'] === null) { + $invalidProperties[] = "'service_name' can't be null"; + } + if ($this->container['delivery_service_id'] === null) { + $invalidProperties[] = "'delivery_service_id' can't be null"; + } + if ($this->container['delivery_partner_type'] === null) { + $invalidProperties[] = "'delivery_partner_type' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + if (!is_null($this->container['boxes_layout']) && (count($this->container['boxes_layout']) < 1)) { + $invalidProperties[] = "invalid value for 'boxes_layout', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tracks']) && (count($this->container['tracks']) < 1)) { + $invalidProperties[] = "invalid value for 'tracks', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\OrderDeliveryType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\OrderDeliveryType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets service_name + * + * @return string + */ + public function getServiceName() + { + return $this->container['service_name']; + } + + /** + * Sets service_name + * + * @param string $service_name Название службы доставки. + * + * @return self + */ + public function setServiceName($service_name) + { + if (is_null($service_name)) { + throw new \InvalidArgumentException('non-nullable service_name cannot be null'); + } + $this->container['service_name'] = $service_name; + + return $this; + } + + /** + * Gets delivery_service_id + * + * @return int + */ + public function getDeliveryServiceId() + { + return $this->container['delivery_service_id']; + } + + /** + * Sets delivery_service_id + * + * @param int $delivery_service_id Идентификатор службы доставки. + * + * @return self + */ + public function setDeliveryServiceId($delivery_service_id) + { + if (is_null($delivery_service_id)) { + throw new \InvalidArgumentException('non-nullable delivery_service_id cannot be null'); + } + $this->container['delivery_service_id'] = $delivery_service_id; + + return $this; + } + + /** + * Gets warehouse_id + * + * @return string|null + */ + public function getWarehouseId() + { + return $this->container['warehouse_id']; + } + + /** + * Sets warehouse_id + * + * @param string|null $warehouse_id Идентификатор склада в системе магазина, на который сформирован заказ. + * + * @return self + */ + public function setWarehouseId($warehouse_id) + { + if (is_null($warehouse_id)) { + throw new \InvalidArgumentException('non-nullable warehouse_id cannot be null'); + } + $this->container['warehouse_id'] = $warehouse_id; + + return $this; + } + + /** + * Gets delivery_partner_type + * + * @return \OpenAPI\Client\Model\OrderDeliveryPartnerType + */ + public function getDeliveryPartnerType() + { + return $this->container['delivery_partner_type']; + } + + /** + * Sets delivery_partner_type + * + * @param \OpenAPI\Client\Model\OrderDeliveryPartnerType $delivery_partner_type delivery_partner_type + * + * @return self + */ + public function setDeliveryPartnerType($delivery_partner_type) + { + if (is_null($delivery_partner_type)) { + throw new \InvalidArgumentException('non-nullable delivery_partner_type cannot be null'); + } + $this->container['delivery_partner_type'] = $delivery_partner_type; + + return $this; + } + + /** + * Gets dispatch_type + * + * @return \OpenAPI\Client\Model\OrderDeliveryDispatchType|null + */ + public function getDispatchType() + { + return $this->container['dispatch_type']; + } + + /** + * Sets dispatch_type + * + * @param \OpenAPI\Client\Model\OrderDeliveryDispatchType|null $dispatch_type dispatch_type + * + * @return self + */ + public function setDispatchType($dispatch_type) + { + if (is_null($dispatch_type)) { + throw new \InvalidArgumentException('non-nullable dispatch_type cannot be null'); + } + $this->container['dispatch_type'] = $dispatch_type; + + return $this; + } + + /** + * Gets dates + * + * @return \OpenAPI\Client\Model\BusinessOrderDeliveryDatesDTO + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \OpenAPI\Client\Model\BusinessOrderDeliveryDatesDTO $dates dates + * + * @return self + */ + public function setDates($dates) + { + if (is_null($dates)) { + throw new \InvalidArgumentException('non-nullable dates cannot be null'); + } + $this->container['dates'] = $dates; + + return $this; + } + + /** + * Gets shipment + * + * @return \OpenAPI\Client\Model\BusinessOrderShipmentDTO|null + */ + public function getShipment() + { + return $this->container['shipment']; + } + + /** + * Sets shipment + * + * @param \OpenAPI\Client\Model\BusinessOrderShipmentDTO|null $shipment shipment + * + * @return self + */ + public function setShipment($shipment) + { + if (is_null($shipment)) { + throw new \InvalidArgumentException('non-nullable shipment cannot be null'); + } + $this->container['shipment'] = $shipment; + + return $this; + } + + /** + * Gets courier + * + * @return \OpenAPI\Client\Model\BusinessOrderCourierDeliveryDTO|null + */ + public function getCourier() + { + return $this->container['courier']; + } + + /** + * Sets courier + * + * @param \OpenAPI\Client\Model\BusinessOrderCourierDeliveryDTO|null $courier courier + * + * @return self + */ + public function setCourier($courier) + { + if (is_null($courier)) { + throw new \InvalidArgumentException('non-nullable courier cannot be null'); + } + $this->container['courier'] = $courier; + + return $this; + } + + /** + * Gets pickup + * + * @return \OpenAPI\Client\Model\BusinessOrderPickupDeliveryDTO|null + */ + public function getPickup() + { + return $this->container['pickup']; + } + + /** + * Sets pickup + * + * @param \OpenAPI\Client\Model\BusinessOrderPickupDeliveryDTO|null $pickup pickup + * + * @return self + */ + public function setPickup($pickup) + { + if (is_null($pickup)) { + throw new \InvalidArgumentException('non-nullable pickup cannot be null'); + } + $this->container['pickup'] = $pickup; + + return $this; + } + + /** + * Gets transfer + * + * @return \OpenAPI\Client\Model\BusinessOrderTransferDTO|null + */ + public function getTransfer() + { + return $this->container['transfer']; + } + + /** + * Sets transfer + * + * @param \OpenAPI\Client\Model\BusinessOrderTransferDTO|null $transfer transfer + * + * @return self + */ + public function setTransfer($transfer) + { + if (is_null($transfer)) { + throw new \InvalidArgumentException('non-nullable transfer cannot be null'); + } + $this->container['transfer'] = $transfer; + + return $this; + } + + /** + * Gets boxes_layout + * + * @return \OpenAPI\Client\Model\BusinessOrderBoxLayoutDTO[]|null + */ + public function getBoxesLayout() + { + return $this->container['boxes_layout']; + } + + /** + * Sets boxes_layout + * + * @param \OpenAPI\Client\Model\BusinessOrderBoxLayoutDTO[]|null $boxes_layout Раскладка товаров по коробкам. + * + * @return self + */ + public function setBoxesLayout($boxes_layout) + { + if (is_null($boxes_layout)) { + array_push($this->openAPINullablesSetToNull, 'boxes_layout'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('boxes_layout', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($boxes_layout) && (count($boxes_layout) < 1)) { + throw new \InvalidArgumentException('invalid length for $boxes_layout when calling BusinessOrderDeliveryDTO., number of items must be greater than or equal to 1.'); + } + $this->container['boxes_layout'] = $boxes_layout; + + return $this; + } + + /** + * Gets tracks + * + * @return \OpenAPI\Client\Model\OrderTrackDTO[]|null + */ + public function getTracks() + { + return $this->container['tracks']; + } + + /** + * Sets tracks + * + * @param \OpenAPI\Client\Model\OrderTrackDTO[]|null $tracks Информация для отслеживания посылки. + * + * @return self + */ + public function setTracks($tracks) + { + if (is_null($tracks)) { + array_push($this->openAPINullablesSetToNull, 'tracks'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tracks', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($tracks) && (count($tracks) < 1)) { + throw new \InvalidArgumentException('invalid length for $tracks when calling BusinessOrderDeliveryDTO., number of items must be greater than or equal to 1.'); + } + $this->container['tracks'] = $tracks; + + return $this; + } + + /** + * Gets estimated + * + * @return bool|null + */ + public function getEstimated() + { + return $this->container['estimated']; + } + + /** + * Sets estimated + * + * @param bool|null $estimated Приблизительная ли дата доставки. + * + * @return self + */ + public function setEstimated($estimated) + { + if (is_null($estimated)) { + throw new \InvalidArgumentException('non-nullable estimated cannot be null'); + } + $this->container['estimated'] = $estimated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryDatesDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryDatesDTO.php new file mode 100644 index 00000000..0ecf3831 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderDeliveryDatesDTO.php @@ -0,0 +1,549 @@ + + */ +class BusinessOrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderDeliveryDatesDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from_date' => '\DateTime', + 'to_date' => '\DateTime', + 'from_time' => 'string', + 'to_time' => 'string', + 'real_delivery_date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from_date' => 'date', + 'to_date' => 'date', + 'from_time' => 'time', + 'to_time' => 'time', + 'real_delivery_date' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'from_date' => false, + 'to_date' => false, + 'from_time' => false, + 'to_time' => false, + 'real_delivery_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from_date' => 'fromDate', + 'to_date' => 'toDate', + 'from_time' => 'fromTime', + 'to_time' => 'toTime', + 'real_delivery_date' => 'realDeliveryDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from_date' => 'setFromDate', + 'to_date' => 'setToDate', + 'from_time' => 'setFromTime', + 'to_time' => 'setToTime', + 'real_delivery_date' => 'setRealDeliveryDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from_date' => 'getFromDate', + 'to_date' => 'getToDate', + 'from_time' => 'getFromTime', + 'to_time' => 'getToTime', + 'real_delivery_date' => 'getRealDeliveryDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('from_date', $data ?? [], null); + $this->setIfExists('to_date', $data ?? [], null); + $this->setIfExists('from_time', $data ?? [], null); + $this->setIfExists('to_time', $data ?? [], null); + $this->setIfExists('real_delivery_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['from_date'] === null) { + $invalidProperties[] = "'from_date' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from_date + * + * @return \DateTime + */ + public function getFromDate() + { + return $this->container['from_date']; + } + + /** + * Sets from_date + * + * @param \DateTime $from_date Ближайшая дата доставки. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setFromDate($from_date) + { + if (is_null($from_date)) { + throw new \InvalidArgumentException('non-nullable from_date cannot be null'); + } + $this->container['from_date'] = $from_date; + + return $this; + } + + /** + * Gets to_date + * + * @return \DateTime|null + */ + public function getToDate() + { + return $this->container['to_date']; + } + + /** + * Sets to_date + * + * @param \DateTime|null $to_date Самая поздняя дата доставки. Если `toDate` не указан, считается дата в параметре `fromDate`. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setToDate($to_date) + { + if (is_null($to_date)) { + throw new \InvalidArgumentException('non-nullable to_date cannot be null'); + } + $this->container['to_date'] = $to_date; + + return $this; + } + + /** + * Gets from_time + * + * @return string|null + */ + public function getFromTime() + { + return $this->container['from_time']; + } + + /** + * Sets from_time + * + * @param string|null $from_time Начало интервала времени доставки. Передается только вместе с параметром `type=DELIVERY`. Формат времени: 24-часовой, `ЧЧ:ММ`. Вместо `ММ` всегда указывайте `00` (исключение — `23:59`). Минимальное значение: `00:00`. + * + * @return self + */ + public function setFromTime($from_time) + { + if (is_null($from_time)) { + throw new \InvalidArgumentException('non-nullable from_time cannot be null'); + } + $this->container['from_time'] = $from_time; + + return $this; + } + + /** + * Gets to_time + * + * @return string|null + */ + public function getToTime() + { + return $this->container['to_time']; + } + + /** + * Sets to_time + * + * @param string|null $to_time Конец интервала времени доставки. Передается только вместе с параметром `type=DELIVERY`. Формат времени: 24-часовой, `ЧЧ:ММ`. Вместо `ММ` всегда указывайте `00` (исключение — `23:59`). Максимальное значение: `23:59`. + * + * @return self + */ + public function setToTime($to_time) + { + if (is_null($to_time)) { + throw new \InvalidArgumentException('non-nullable to_time cannot be null'); + } + $this->container['to_time'] = $to_time; + + return $this; + } + + /** + * Gets real_delivery_date + * + * @return \DateTime|null + */ + public function getRealDeliveryDate() + { + return $this->container['real_delivery_date']; + } + + /** + * Sets real_delivery_date + * + * @param \DateTime|null $real_delivery_date Дата, когда товар доставлен до пункта выдачи заказа (в случае самовывоза) или до покупателя (если заказ доставляет курьер). Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setRealDeliveryDate($real_delivery_date) + { + if (is_null($real_delivery_date)) { + throw new \InvalidArgumentException('non-nullable real_delivery_date cannot be null'); + } + $this->container['real_delivery_date'] = $real_delivery_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderEacDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderEacDTO.php new file mode 100644 index 00000000..cb3cec29 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderEacDTO.php @@ -0,0 +1,447 @@ + + */ +class BusinessOrderEacDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderEacDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'eac_type' => '\OpenAPI\Client\Model\OrderDeliveryEacType', + 'eac_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'eac_type' => null, + 'eac_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'eac_type' => false, + 'eac_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eac_type' => 'eacType', + 'eac_code' => 'eacCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eac_type' => 'setEacType', + 'eac_code' => 'setEacCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eac_type' => 'getEacType', + 'eac_code' => 'getEacCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('eac_type', $data ?? [], null); + $this->setIfExists('eac_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['eac_type'] === null) { + $invalidProperties[] = "'eac_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets eac_type + * + * @return \OpenAPI\Client\Model\OrderDeliveryEacType + */ + public function getEacType() + { + return $this->container['eac_type']; + } + + /** + * Sets eac_type + * + * @param \OpenAPI\Client\Model\OrderDeliveryEacType $eac_type eac_type + * + * @return self + */ + public function setEacType($eac_type) + { + if (is_null($eac_type)) { + throw new \InvalidArgumentException('non-nullable eac_type cannot be null'); + } + $this->container['eac_type'] = $eac_type; + + return $this; + } + + /** + * Gets eac_code + * + * @return string|null + */ + public function getEacCode() + { + return $this->container['eac_code']; + } + + /** + * Sets eac_code + * + * @param string|null $eac_code Код подтверждения ЭАПП (для типа `MERCHANT_TO_COURIER`). + * + * @return self + */ + public function setEacCode($eac_code) + { + if (is_null($eac_code)) { + throw new \InvalidArgumentException('non-nullable eac_code cannot be null'); + } + $this->container['eac_code'] = $eac_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderItemDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderItemDTO.php new file mode 100644 index 00000000..1e9756e2 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderItemDTO.php @@ -0,0 +1,730 @@ + + */ +class BusinessOrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderItemDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'offer_id' => 'string', + 'offer_name' => 'string', + 'count' => 'int', + 'prices' => '\OpenAPI\Client\Model\ItemPriceDTO', + 'instances' => '\OpenAPI\Client\Model\OrderItemInstanceDTO[]', + 'required_instance_types' => '\OpenAPI\Client\Model\OrderItemInstanceType[]', + 'tags' => '\OpenAPI\Client\Model\OrderItemTagType[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'offer_id' => null, + 'offer_name' => null, + 'count' => null, + 'prices' => null, + 'instances' => null, + 'required_instance_types' => null, + 'tags' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'offer_id' => false, + 'offer_name' => false, + 'count' => false, + 'prices' => false, + 'instances' => true, + 'required_instance_types' => true, + 'tags' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'offer_id' => 'offerId', + 'offer_name' => 'offerName', + 'count' => 'count', + 'prices' => 'prices', + 'instances' => 'instances', + 'required_instance_types' => 'requiredInstanceTypes', + 'tags' => 'tags' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'offer_id' => 'setOfferId', + 'offer_name' => 'setOfferName', + 'count' => 'setCount', + 'prices' => 'setPrices', + 'instances' => 'setInstances', + 'required_instance_types' => 'setRequiredInstanceTypes', + 'tags' => 'setTags' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'offer_id' => 'getOfferId', + 'offer_name' => 'getOfferName', + 'count' => 'getCount', + 'prices' => 'getPrices', + 'instances' => 'getInstances', + 'required_instance_types' => 'getRequiredInstanceTypes', + 'tags' => 'getTags' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('offer_id', $data ?? [], null); + $this->setIfExists('offer_name', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + $this->setIfExists('prices', $data ?? [], null); + $this->setIfExists('instances', $data ?? [], null); + $this->setIfExists('required_instance_types', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if ($this->container['offer_name'] === null) { + $invalidProperties[] = "'offer_name' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['required_instance_types']) && (count($this->container['required_instance_types']) < 1)) { + $invalidProperties[] = "invalid value for 'required_instance_types', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор товара в заказе. Позволяет идентифицировать товар в рамках заказа. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets offer_id + * + * @return string + */ + public function getOfferId() + { + return $this->container['offer_id']; + } + + /** + * Sets offer_id + * + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * + * @return self + */ + public function setOfferId($offer_id) + { + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); + } + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling BusinessOrderItemDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling BusinessOrderItemDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling BusinessOrderItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; + + return $this; + } + + /** + * Gets offer_name + * + * @return string + */ + public function getOfferName() + { + return $this->container['offer_name']; + } + + /** + * Sets offer_name + * + * @param string $offer_name Название товара. + * + * @return self + */ + public function setOfferName($offer_name) + { + if (is_null($offer_name)) { + throw new \InvalidArgumentException('non-nullable offer_name cannot be null'); + } + $this->container['offer_name'] = $offer_name; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Количество единиц товара. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets prices + * + * @return \OpenAPI\Client\Model\ItemPriceDTO|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param \OpenAPI\Client\Model\ItemPriceDTO|null $prices prices + * + * @return self + */ + public function setPrices($prices) + { + if (is_null($prices)) { + throw new \InvalidArgumentException('non-nullable prices cannot be null'); + } + $this->container['prices'] = $prices; + + return $this; + } + + /** + * Gets instances + * + * @return \OpenAPI\Client\Model\OrderItemInstanceDTO[]|null + */ + public function getInstances() + { + return $this->container['instances']; + } + + /** + * Sets instances + * + * @param \OpenAPI\Client\Model\OrderItemInstanceDTO[]|null $instances Информация о маркировке единиц товара. Возвращаются данные для маркировки, переданные в запросе: * Для DBS — [PUT v2/campaigns/{campaignId}/orders/{orderId}/identifiers](../../reference/orders/provideOrderItemIdentifiers.md) или [PUT v2/campaigns/{campaignId}/orders/{orderId}/boxes](../../reference/orders/setOrderBoxLayout.md). * Для FBS и EXPRESS — [PUT v2/campaigns/{campaignId}/orders/{orderId}/boxes](../../reference/orders/setOrderBoxLayout.md). Для FBY возвращаются коды маркировки, переданные во время поставки. Если магазин еще не передавал коды для этого заказа, `instances` отсутствует. + * + * @return self + */ + public function setInstances($instances) + { + if (is_null($instances)) { + array_push($this->openAPINullablesSetToNull, 'instances'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('instances', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling BusinessOrderItemDTO., number of items must be greater than or equal to 1.'); + } + $this->container['instances'] = $instances; + + return $this; + } + + /** + * Gets required_instance_types + * + * @return \OpenAPI\Client\Model\OrderItemInstanceType[]|null + */ + public function getRequiredInstanceTypes() + { + return $this->container['required_instance_types']; + } + + /** + * Sets required_instance_types + * + * @param \OpenAPI\Client\Model\OrderItemInstanceType[]|null $required_instance_types Список необходимых маркировок товара. + * + * @return self + */ + public function setRequiredInstanceTypes($required_instance_types) + { + if (is_null($required_instance_types)) { + array_push($this->openAPINullablesSetToNull, 'required_instance_types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('required_instance_types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($required_instance_types) && (count($required_instance_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $required_instance_types when calling BusinessOrderItemDTO., number of items must be greater than or equal to 1.'); + } + $this->container['required_instance_types'] = $required_instance_types; + + return $this; + } + + /** + * Gets tags + * + * @return \OpenAPI\Client\Model\OrderItemTagType[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param \OpenAPI\Client\Model\OrderItemTagType[]|null $tags Признаки товара. + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + array_push($this->openAPINullablesSetToNull, 'tags'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tags', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling BusinessOrderItemDTO., number of items must be greater than or equal to 1.'); + } + $this->container['tags'] = $tags; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderPickupDeliveryDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderPickupDeliveryDTO.php new file mode 100644 index 00000000..05691f59 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderPickupDeliveryDTO.php @@ -0,0 +1,555 @@ + + */ +class BusinessOrderPickupDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderPickupDeliveryDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\OpenAPI\Client\Model\BusinessOrderDeliveryAddressDTO', + 'region' => '\OpenAPI\Client\Model\RegionDTO', + 'logistic_point_id' => 'int', + 'outlet_code' => 'string', + 'outlet_storage_limit_date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'region' => null, + 'logistic_point_id' => 'int64', + 'outlet_code' => null, + 'outlet_storage_limit_date' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'address' => false, + 'region' => false, + 'logistic_point_id' => false, + 'outlet_code' => false, + 'outlet_storage_limit_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'region' => 'region', + 'logistic_point_id' => 'logisticPointId', + 'outlet_code' => 'outletCode', + 'outlet_storage_limit_date' => 'outletStorageLimitDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'region' => 'setRegion', + 'logistic_point_id' => 'setLogisticPointId', + 'outlet_code' => 'setOutletCode', + 'outlet_storage_limit_date' => 'setOutletStorageLimitDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'region' => 'getRegion', + 'logistic_point_id' => 'getLogisticPointId', + 'outlet_code' => 'getOutletCode', + 'outlet_storage_limit_date' => 'getOutletStorageLimitDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('region', $data ?? [], null); + $this->setIfExists('logistic_point_id', $data ?? [], null); + $this->setIfExists('outlet_code', $data ?? [], null); + $this->setIfExists('outlet_storage_limit_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['logistic_point_id']) && ($this->container['logistic_point_id'] < 1)) { + $invalidProperties[] = "invalid value for 'logistic_point_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \OpenAPI\Client\Model\BusinessOrderDeliveryAddressDTO|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \OpenAPI\Client\Model\BusinessOrderDeliveryAddressDTO|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets region + * + * @return \OpenAPI\Client\Model\RegionDTO|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param \OpenAPI\Client\Model\RegionDTO|null $region region + * + * @return self + */ + public function setRegion($region) + { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets logistic_point_id + * + * @return int|null + */ + public function getLogisticPointId() + { + return $this->container['logistic_point_id']; + } + + /** + * Sets logistic_point_id + * + * @param int|null $logistic_point_id Идентификатор пункта выдачи. Его можно узнать с помощью метода [POST v1/businesses/{businessId}/logistics-points](../../reference/logistic-points/getLogisticPoints.md). + * + * @return self + */ + public function setLogisticPointId($logistic_point_id) + { + if (is_null($logistic_point_id)) { + throw new \InvalidArgumentException('non-nullable logistic_point_id cannot be null'); + } + + if (($logistic_point_id < 1)) { + throw new \InvalidArgumentException('invalid value for $logistic_point_id when calling BusinessOrderPickupDeliveryDTO., must be bigger than or equal to 1.'); + } + + $this->container['logistic_point_id'] = $logistic_point_id; + + return $this; + } + + /** + * Gets outlet_code + * + * @return string|null + */ + public function getOutletCode() + { + return $this->container['outlet_code']; + } + + /** + * Sets outlet_code + * + * @param string|null $outlet_code Идентификатор пункта самовывоза, присвоенный магазином. + * + * @return self + */ + public function setOutletCode($outlet_code) + { + if (is_null($outlet_code)) { + throw new \InvalidArgumentException('non-nullable outlet_code cannot be null'); + } + $this->container['outlet_code'] = $outlet_code; + + return $this; + } + + /** + * Gets outlet_storage_limit_date + * + * @return \DateTime|null + */ + public function getOutletStorageLimitDate() + { + return $this->container['outlet_storage_limit_date']; + } + + /** + * Sets outlet_storage_limit_date + * + * @param \DateTime|null $outlet_storage_limit_date Дата, до которой заказ будет храниться в пункте выдачи. Возвращается, когда заказ переходит в статус `PICKUP`. Один раз дату можно поменять с помощью метода [PUT v2/campaigns/{campaignId}/orders/{orderId}/delivery/storage-limit](../../reference/orders/updateOrderStorageLimit.md). Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setOutletStorageLimitDate($outlet_storage_limit_date) + { + if (is_null($outlet_storage_limit_date)) { + throw new \InvalidArgumentException('non-nullable outlet_storage_limit_date cannot be null'); + } + $this->container['outlet_storage_limit_date'] = $outlet_storage_limit_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderServicesDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderServicesDTO.php new file mode 100644 index 00000000..bcd0c3c7 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderServicesDTO.php @@ -0,0 +1,410 @@ + + */ +class BusinessOrderServicesDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderServicesDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'lift_type' => '\OpenAPI\Client\Model\OrderLiftType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'lift_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'lift_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lift_type' => 'liftType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lift_type' => 'setLiftType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lift_type' => 'getLiftType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('lift_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lift_type + * + * @return \OpenAPI\Client\Model\OrderLiftType|null + */ + public function getLiftType() + { + return $this->container['lift_type']; + } + + /** + * Sets lift_type + * + * @param \OpenAPI\Client\Model\OrderLiftType|null $lift_type lift_type + * + * @return self + */ + public function setLiftType($lift_type) + { + if (is_null($lift_type)) { + throw new \InvalidArgumentException('non-nullable lift_type cannot be null'); + } + $this->container['lift_type'] = $lift_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderShipmentDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderShipmentDTO.php new file mode 100644 index 00000000..e4a18d6c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderShipmentDTO.php @@ -0,0 +1,495 @@ + + */ +class BusinessOrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderShipmentDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'shipment_date' => '\DateTime', + 'shipment_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'shipment_date' => 'date', + 'shipment_time' => 'time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => true, + 'shipment_date' => false, + 'shipment_time' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'shipment_date' => 'shipmentDate', + 'shipment_time' => 'shipmentTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'shipment_date' => 'setShipmentDate', + 'shipment_time' => 'setShipmentTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'shipment_date' => 'getShipmentDate', + 'shipment_time' => 'getShipmentTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('shipment_date', $data ?? [], null); + $this->setIfExists('shipment_time', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['shipment_date'] === null) { + $invalidProperties[] = "'shipment_date' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Идентификатор отгрузки. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets shipment_date + * + * @return \DateTime + */ + public function getShipmentDate() + { + return $this->container['shipment_date']; + } + + /** + * Sets shipment_date + * + * @param \DateTime $shipment_date Дата отгрузки. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setShipmentDate($shipment_date) + { + if (is_null($shipment_date)) { + throw new \InvalidArgumentException('non-nullable shipment_date cannot be null'); + } + $this->container['shipment_date'] = $shipment_date; + + return $this; + } + + /** + * Gets shipment_time + * + * @return string|null + */ + public function getShipmentTime() + { + return $this->container['shipment_time']; + } + + /** + * Sets shipment_time + * + * @param string|null $shipment_time Время отгрузки. + * + * @return self + */ + public function setShipmentTime($shipment_time) + { + if (is_null($shipment_time)) { + array_push($this->openAPINullablesSetToNull, 'shipment_time'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shipment_time', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shipment_time'] = $shipment_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessOrderTransferDTO.php b/erp24/lib/yandex_market_api/Model/BusinessOrderTransferDTO.php new file mode 100644 index 00000000..815e703c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/BusinessOrderTransferDTO.php @@ -0,0 +1,444 @@ + + */ +class BusinessOrderTransferDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BusinessOrderTransferDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'courier' => '\OpenAPI\Client\Model\OrderCourierDTO', + 'eac' => '\OpenAPI\Client\Model\BusinessOrderEacDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'courier' => null, + 'eac' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'courier' => false, + 'eac' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'courier' => 'courier', + 'eac' => 'eac' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'courier' => 'setCourier', + 'eac' => 'setEac' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'courier' => 'getCourier', + 'eac' => 'getEac' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('courier', $data ?? [], null); + $this->setIfExists('eac', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets courier + * + * @return \OpenAPI\Client\Model\OrderCourierDTO|null + */ + public function getCourier() + { + return $this->container['courier']; + } + + /** + * Sets courier + * + * @param \OpenAPI\Client\Model\OrderCourierDTO|null $courier courier + * + * @return self + */ + public function setCourier($courier) + { + if (is_null($courier)) { + throw new \InvalidArgumentException('non-nullable courier cannot be null'); + } + $this->container['courier'] = $courier; + + return $this; + } + + /** + * Gets eac + * + * @return \OpenAPI\Client\Model\BusinessOrderEacDTO|null + */ + public function getEac() + { + return $this->container['eac']; + } + + /** + * Sets eac + * + * @param \OpenAPI\Client\Model\BusinessOrderEacDTO|null $eac eac + * + * @return self + */ + public function setEac($eac) + { + if (is_null($eac)) { + throw new \InvalidArgumentException('non-nullable eac cannot be null'); + } + $this->container['eac'] = $eac; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/BusinessSettingsDTO.php b/erp24/lib/yandex_market_api/Model/BusinessSettingsDTO.php index c34ce38a..83c13cce 100644 --- a/erp24/lib/yandex_market_api/Model/BusinessSettingsDTO.php +++ b/erp24/lib/yandex_market_api/Model/BusinessSettingsDTO.php @@ -2,7 +2,7 @@ /** * BusinessSettingsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class BusinessSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('only_default_price', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); @@ -310,7 +310,7 @@ class BusinessSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets only_default_price * - * @param bool|null $only_default_price Можно ли установить только [базовую цену](*rule): * `false` — можно задать и базовую цену, и цены в конкретных магазинах. * `true` — можно задать только базовую цену. + * @param bool|null $only_default_price Управление ценами на товары: * `false` — можно установить цену, которая действует: * во всех магазинах кабинета — [POST v2/businesses/{businessId}/offer-prices/updates](../../reference/business-assortment/updateBusinessPrices.md); * в конкретном магазине — [POST v2/campaigns/{campaignId}/offer-prices/updates](../../reference/assortment/updatePrices.md). * `true` — можно установить только цену, которая действует во всех магазинах кабинета, — [POST v2/businesses/{businessId}/offer-prices/updates](../../reference/business-assortment/updateBusinessPrices.md). * * @return self */ @@ -353,11 +353,11 @@ class BusinessSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class BusinessSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class BusinessSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferDTO.php b/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferDTO.php index b715e4d9..604233c4 100644 --- a/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferDTO.php @@ -2,7 +2,7 @@ /** * CalculateTariffsOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -276,10 +276,10 @@ class CalculateTariffsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('category_id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -391,7 +391,7 @@ class CalculateTariffsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets category_id * - * @param int $category_id Идентификатор категории товара на Маркете. Для расчета стоимости услуг необходимо указать идентификатор листовой категории товара — той, которая не имеет дочерних категорий. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). + * @param int $category_id Идентификатор категории товара на Маркете. Для расчета стоимости услуг необходимо указать идентификатор [листовой категории](*list-category) товара. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). * * @return self */ @@ -423,7 +423,7 @@ class CalculateTariffsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets price * - * @param float $price Цена на товар в рублях. + * @param float $price Цена товара в рублях. * * @return self */ @@ -604,11 +604,11 @@ class CalculateTariffsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -616,12 +616,12 @@ class CalculateTariffsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -646,11 +646,11 @@ class CalculateTariffsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferInfoDTO.php b/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferInfoDTO.php index 0b4b2fb8..c4bf58a2 100644 --- a/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/CalculateTariffsOfferInfoDTO.php @@ -2,7 +2,7 @@ /** * CalculateTariffsOfferInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CalculateTariffsOfferInfoDTO implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer', $data ?? [], null); $this->setIfExists('tariffs', $data ?? [], null); @@ -359,11 +359,11 @@ class CalculateTariffsOfferInfoDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class CalculateTariffsOfferInfoDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class CalculateTariffsOfferInfoDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculateTariffsParametersDTO.php b/erp24/lib/yandex_market_api/Model/CalculateTariffsParametersDTO.php index b0ef7e44..a7931c21 100644 --- a/erp24/lib/yandex_market_api/Model/CalculateTariffsParametersDTO.php +++ b/erp24/lib/yandex_market_api/Model/CalculateTariffsParametersDTO.php @@ -2,7 +2,7 @@ /** * CalculateTariffsParametersDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * CalculateTariffsParametersDTO Class Doc Comment * * @category Class - * @description Параметры для расчета стоимости услуг. + * @description Параметры для расчета стоимости услуг. Обязательно необходимо указать параметр `campaignId` либо `sellingProgram`. Совместное использование параметров приведет к ошибке. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -60,7 +60,8 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'campaign_id' => 'int', 'selling_program' => '\OpenAPI\Client\Model\SellingProgramType', - 'frequency' => '\OpenAPI\Client\Model\PaymentFrequencyType' + 'frequency' => '\OpenAPI\Client\Model\PaymentFrequencyType', + 'currency' => '\OpenAPI\Client\Model\CurrencyType' ]; /** @@ -73,7 +74,8 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'campaign_id' => 'int64', 'selling_program' => null, - 'frequency' => null + 'frequency' => null, + 'currency' => null ]; /** @@ -84,7 +86,8 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso protected static array $openAPINullables = [ 'campaign_id' => false, 'selling_program' => false, - 'frequency' => false + 'frequency' => false, + 'currency' => false ]; /** @@ -175,7 +178,8 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso protected static $attributeMap = [ 'campaign_id' => 'campaignId', 'selling_program' => 'sellingProgram', - 'frequency' => 'frequency' + 'frequency' => 'frequency', + 'currency' => 'currency' ]; /** @@ -186,7 +190,8 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso protected static $setters = [ 'campaign_id' => 'setCampaignId', 'selling_program' => 'setSellingProgram', - 'frequency' => 'setFrequency' + 'frequency' => 'setFrequency', + 'currency' => 'setCurrency' ]; /** @@ -197,7 +202,8 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso protected static $getters = [ 'campaign_id' => 'getCampaignId', 'selling_program' => 'getSellingProgram', - 'frequency' => 'getFrequency' + 'frequency' => 'getFrequency', + 'currency' => 'getCurrency' ]; /** @@ -252,14 +258,15 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('selling_program', $data ?? [], null); $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); } /** @@ -321,7 +328,7 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso /** * Sets campaign_id * - * @param int|null $campaign_id Идентификатор кампании. У пользователя, который выполняет запрос, должен быть доступ к этой кампании. Используйте параметр `campaignId`, если уже завершили подключение магазина на Маркете. Иначе вернется пустой список. Обязательный параметр, если не указан параметр `sellingProgram`. Совместное использование параметров приведет к ошибке. + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -393,14 +400,41 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso return $this; } + + /** + * Gets currency + * + * @return \OpenAPI\Client\Model\CurrencyType|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \OpenAPI\Client\Model\CurrencyType|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +442,12 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +472,11 @@ class CalculateTariffsParametersDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculateTariffsRequest.php b/erp24/lib/yandex_market_api/Model/CalculateTariffsRequest.php index 43fca5f2..1b75e166 100644 --- a/erp24/lib/yandex_market_api/Model/CalculateTariffsRequest.php +++ b/erp24/lib/yandex_market_api/Model/CalculateTariffsRequest.php @@ -2,7 +2,7 @@ /** * CalculateTariffsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class CalculateTariffsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('parameters', $data ?? [], null); $this->setIfExists('offers', $data ?? [], null); @@ -373,11 +373,11 @@ class CalculateTariffsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -385,12 +385,12 @@ class CalculateTariffsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -415,11 +415,11 @@ class CalculateTariffsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculateTariffsResponse.php b/erp24/lib/yandex_market_api/Model/CalculateTariffsResponse.php index 989e96df..e5e6ac62 100644 --- a/erp24/lib/yandex_market_api/Model/CalculateTariffsResponse.php +++ b/erp24/lib/yandex_market_api/Model/CalculateTariffsResponse.php @@ -2,7 +2,7 @@ /** * CalculateTariffsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class CalculateTariffsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculateTariffsResponseDTO.php b/erp24/lib/yandex_market_api/Model/CalculateTariffsResponseDTO.php index da78206e..54a8b2c9 100644 --- a/erp24/lib/yandex_market_api/Model/CalculateTariffsResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/CalculateTariffsResponseDTO.php @@ -2,7 +2,7 @@ /** * CalculateTariffsResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class CalculateTariffsResponseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -322,11 +322,11 @@ class CalculateTariffsResponseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class CalculateTariffsResponseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class CalculateTariffsResponseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculatedTariffDTO.php b/erp24/lib/yandex_market_api/Model/CalculatedTariffDTO.php index 522fc265..be73849b 100644 --- a/erp24/lib/yandex_market_api/Model/CalculatedTariffDTO.php +++ b/erp24/lib/yandex_market_api/Model/CalculatedTariffDTO.php @@ -2,7 +2,7 @@ /** * CalculatedTariffDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -60,6 +60,7 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPITypes = [ 'type' => '\OpenAPI\Client\Model\CalculatedTariffType', 'amount' => 'float', + 'currency' => '\OpenAPI\Client\Model\CurrencyType', 'parameters' => '\OpenAPI\Client\Model\TariffParameterDTO[]' ]; @@ -73,6 +74,7 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPIFormats = [ 'type' => null, 'amount' => null, + 'currency' => null, 'parameters' => null ]; @@ -84,6 +86,7 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa protected static array $openAPINullables = [ 'type' => false, 'amount' => false, + 'currency' => false, 'parameters' => false ]; @@ -175,6 +178,7 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa protected static $attributeMap = [ 'type' => 'type', 'amount' => 'amount', + 'currency' => 'currency', 'parameters' => 'parameters' ]; @@ -186,6 +190,7 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa protected static $setters = [ 'type' => 'setType', 'amount' => 'setAmount', + 'currency' => 'setCurrency', 'parameters' => 'setParameters' ]; @@ -197,6 +202,7 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa protected static $getters = [ 'type' => 'getType', 'amount' => 'getAmount', + 'currency' => 'getCurrency', 'parameters' => 'getParameters' ]; @@ -252,13 +258,14 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('parameters', $data ?? [], null); } @@ -364,6 +371,33 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa return $this; } + /** + * Gets currency + * + * @return \OpenAPI\Client\Model\CurrencyType|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \OpenAPI\Client\Model\CurrencyType|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + /** * Gets parameters * @@ -393,11 +427,11 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +439,12 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +469,11 @@ class CalculatedTariffDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CalculatedTariffType.php b/erp24/lib/yandex_market_api/Model/CalculatedTariffType.php index 9f42f4e6..b342402b 100644 --- a/erp24/lib/yandex_market_api/Model/CalculatedTariffType.php +++ b/erp24/lib/yandex_market_api/Model/CalculatedTariffType.php @@ -2,7 +2,7 @@ /** * CalculatedTariffType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/CampaignDTO.php b/erp24/lib/yandex_market_api/Model/CampaignDTO.php index c2c67b04..1a36fad9 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignDTO.php @@ -2,7 +2,7 @@ /** * CampaignDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -62,7 +62,8 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'int', 'client_id' => 'int', 'business' => '\OpenAPI\Client\Model\BusinessDTO', - 'placement_type' => '\OpenAPI\Client\Model\PlacementType' + 'placement_type' => '\OpenAPI\Client\Model\PlacementType', + 'api_availability' => '\OpenAPI\Client\Model\ApiAvailabilityStatusType' ]; /** @@ -77,7 +78,8 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'int64', 'client_id' => 'int64', 'business' => null, - 'placement_type' => null + 'placement_type' => null, + 'api_availability' => null ]; /** @@ -90,7 +92,8 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'client_id' => false, 'business' => false, - 'placement_type' => false + 'placement_type' => false, + 'api_availability' => false ]; /** @@ -183,7 +186,8 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'id', 'client_id' => 'clientId', 'business' => 'business', - 'placement_type' => 'placementType' + 'placement_type' => 'placementType', + 'api_availability' => 'apiAvailability' ]; /** @@ -196,7 +200,8 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'setId', 'client_id' => 'setClientId', 'business' => 'setBusiness', - 'placement_type' => 'setPlacementType' + 'placement_type' => 'setPlacementType', + 'api_availability' => 'setApiAvailability' ]; /** @@ -209,7 +214,8 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'getId', 'client_id' => 'getClientId', 'business' => 'getBusiness', - 'placement_type' => 'getPlacementType' + 'placement_type' => 'getPlacementType', + 'api_availability' => 'getApiAvailability' ]; /** @@ -264,16 +270,17 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('domain', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('client_id', $data ?? [], null); $this->setIfExists('business', $data ?? [], null); $this->setIfExists('placement_type', $data ?? [], null); + $this->setIfExists('api_availability', $data ?? [], null); } /** @@ -303,6 +310,10 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if (!is_null($this->container['id']) && ($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -331,7 +342,7 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets domain * - * @param string|null $domain URL магазина. + * @param string|null $domain Название магазина. * * @return self */ @@ -358,7 +369,7 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id Идентификатор кампании. + * @param int|null $id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -367,6 +378,11 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($id)) { throw new \InvalidArgumentException('non-nullable id cannot be null'); } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling CampaignDTO., must be bigger than or equal to 1.'); + } + $this->container['id'] = $id; return $this; @@ -376,6 +392,7 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets client_id * * @return int|null + * @deprecated */ public function getClientId() { @@ -388,6 +405,7 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable * @param int|null $client_id Идентификатор плательщика в Яндекс Балансе. * * @return self + * @deprecated */ public function setClientId($client_id) { @@ -452,14 +470,41 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + + /** + * Gets api_availability + * + * @return \OpenAPI\Client\Model\ApiAvailabilityStatusType|null + */ + public function getApiAvailability() + { + return $this->container['api_availability']; + } + + /** + * Sets api_availability + * + * @param \OpenAPI\Client\Model\ApiAvailabilityStatusType|null $api_availability api_availability + * + * @return self + */ + public function setApiAvailability($api_availability) + { + if (is_null($api_availability)) { + throw new \InvalidArgumentException('non-nullable api_availability cannot be null'); + } + $this->container['api_availability'] = $api_availability; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +512,12 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +542,11 @@ class CampaignDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignQualityRatingDTO.php b/erp24/lib/yandex_market_api/Model/CampaignQualityRatingDTO.php index 560f5d12..f86e9a6d 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignQualityRatingDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignQualityRatingDTO.php @@ -2,7 +2,7 @@ /** * CampaignQualityRatingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('ratings', $data ?? [], null); @@ -285,6 +285,10 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + if ($this->container['ratings'] === null) { $invalidProperties[] = "'ratings' can't be null"; } @@ -316,7 +320,7 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets campaign_id * - * @param int $campaign_id Идентификатор магазина. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -325,6 +329,11 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling CampaignQualityRatingDTO., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -359,11 +368,11 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +380,12 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +410,11 @@ class CampaignQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignSettingsDTO.php b/erp24/lib/yandex_market_api/Model/CampaignSettingsDTO.php index d635001b..5d916571 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignSettingsDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignSettingsDTO.php @@ -2,7 +2,7 @@ /** * CampaignSettingsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('country_region', $data ?? [], null); $this->setIfExists('shop_name', $data ?? [], null); @@ -383,6 +383,7 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * Gets show_in_context * * @return bool|null + * @deprecated */ public function getShowInContext() { @@ -395,6 +396,7 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @param bool|null $show_in_context Признак размещения магазина на сайтах партнеров Яндекс Дистрибуции. Возможные значения: * `false` — магазин не размещен на сайтах партнеров Яндекс Дистрибуции. * `true` — магазин размещен на сайтах партнеров Яндекс Дистрибуции. * * @return self + * @deprecated */ public function setShowInContext($show_in_context) { @@ -410,6 +412,7 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * Gets show_in_premium * * @return bool|null + * @deprecated */ public function getShowInPremium() { @@ -419,9 +422,10 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets show_in_premium * - * @param bool|null $show_in_premium Признак показа предложений магазина в рекламном блоке над результатами поиска (cпецразмещение). Возможные значения: * `false` — предложения не показываются в блоке cпецразмещения. * `true` — предложения показываются в блоке cпецразмещения. + * @param bool|null $show_in_premium Признак показа предложений магазина в блоке над результатами поиска (cпецразмещение). Возможные значения: * `false` — предложения не показываются в блоке cпецразмещения. * `true` — предложения показываются в блоке cпецразмещения. * * @return self + * @deprecated */ public function setShowInPremium($show_in_premium) { @@ -437,6 +441,7 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * Gets use_open_stat * * @return bool|null + * @deprecated */ public function getUseOpenStat() { @@ -449,6 +454,7 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @param bool|null $use_open_stat Признак использования внешней интернет-статистики. Возможные значения: * `false` — внешняя интернет-статистика не используется. * `true` — внешняя интернет-статистика используется. * * @return self + * @deprecated */ public function setUseOpenStat($use_open_stat) { @@ -489,11 +495,11 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -501,12 +507,12 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -531,11 +537,11 @@ class CampaignSettingsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignSettingsDeliveryDTO.php b/erp24/lib/yandex_market_api/Model/CampaignSettingsDeliveryDTO.php index 3594c7cc..271f0f7a 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignSettingsDeliveryDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignSettingsDeliveryDTO.php @@ -2,7 +2,7 @@ /** * CampaignSettingsDeliveryDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class CampaignSettingsDeliveryDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('schedule', $data ?? [], null); } @@ -319,11 +319,11 @@ class CampaignSettingsDeliveryDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class CampaignSettingsDeliveryDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class CampaignSettingsDeliveryDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignSettingsLocalRegionDTO.php b/erp24/lib/yandex_market_api/Model/CampaignSettingsLocalRegionDTO.php index b65e1a96..63958678 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignSettingsLocalRegionDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignSettingsLocalRegionDTO.php @@ -2,7 +2,7 @@ /** * CampaignSettingsLocalRegionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class CampaignSettingsLocalRegionDTO implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -455,11 +455,11 @@ class CampaignSettingsLocalRegionDTO implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +467,12 @@ class CampaignSettingsLocalRegionDTO implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +497,11 @@ class CampaignSettingsLocalRegionDTO implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleDTO.php b/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleDTO.php index 2c5959c0..a0e384f5 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleDTO.php @@ -2,7 +2,7 @@ /** * CampaignSettingsScheduleDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('available_on_holidays', $data ?? [], null); $this->setIfExists('custom_holidays', $data ?? [], null); @@ -386,6 +386,8 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS if (is_null($custom_holidays)) { throw new \InvalidArgumentException('non-nullable custom_holidays cannot be null'); } + + $this->container['custom_holidays'] = $custom_holidays; return $this; @@ -413,6 +415,8 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS if (is_null($custom_working_days)) { throw new \InvalidArgumentException('non-nullable custom_working_days cannot be null'); } + + $this->container['custom_working_days'] = $custom_working_days; return $this; @@ -467,6 +471,8 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS if (is_null($total_holidays)) { throw new \InvalidArgumentException('non-nullable total_holidays cannot be null'); } + + $this->container['total_holidays'] = $total_holidays; return $this; @@ -494,6 +500,8 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS if (is_null($weekly_holidays)) { throw new \InvalidArgumentException('non-nullable weekly_holidays cannot be null'); } + + $this->container['weekly_holidays'] = $weekly_holidays; return $this; @@ -501,11 +509,11 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -513,12 +521,12 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -543,11 +551,11 @@ class CampaignSettingsScheduleDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleSourceType.php b/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleSourceType.php index 297b3875..f0099810 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleSourceType.php +++ b/erp24/lib/yandex_market_api/Model/CampaignSettingsScheduleSourceType.php @@ -2,7 +2,7 @@ /** * CampaignSettingsScheduleSourceType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/CampaignSettingsTimePeriodDTO.php b/erp24/lib/yandex_market_api/Model/CampaignSettingsTimePeriodDTO.php index a9e541bf..0eec054a 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignSettingsTimePeriodDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignSettingsTimePeriodDTO.php @@ -2,7 +2,7 @@ /** * CampaignSettingsTimePeriodDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CampaignSettingsTimePeriodDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('from_date', $data ?? [], null); $this->setIfExists('to_date', $data ?? [], null); @@ -353,11 +353,11 @@ class CampaignSettingsTimePeriodDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class CampaignSettingsTimePeriodDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class CampaignSettingsTimePeriodDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CampaignsQualityRatingDTO.php b/erp24/lib/yandex_market_api/Model/CampaignsQualityRatingDTO.php index ea612fb5..599d4ba3 100644 --- a/erp24/lib/yandex_market_api/Model/CampaignsQualityRatingDTO.php +++ b/erp24/lib/yandex_market_api/Model/CampaignsQualityRatingDTO.php @@ -2,7 +2,7 @@ /** * CampaignsQualityRatingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class CampaignsQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_ratings', $data ?? [], null); } @@ -322,11 +322,11 @@ class CampaignsQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class CampaignsQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class CampaignsQualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CatalogLanguageType.php b/erp24/lib/yandex_market_api/Model/CatalogLanguageType.php new file mode 100644 index 00000000..f6e1dc82 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CatalogLanguageType.php @@ -0,0 +1,63 @@ +setIfExists('category_id', $data ?? [], null); $this->setIfExists('parameters', $data ?? [], null); @@ -285,8 +285,12 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json if ($this->container['category_id'] === null) { $invalidProperties[] = "'category_id' can't be null"; } - if (($this->container['category_id'] < 1)) { - $invalidProperties[] = "invalid value for 'category_id', must be bigger than or equal to 1."; + if (($this->container['category_id'] <= 0)) { + $invalidProperties[] = "invalid value for 'category_id', must be bigger than 0."; + } + + if (!is_null($this->container['parameters']) && (count($this->container['parameters']) < 1)) { + $invalidProperties[] = "invalid value for 'parameters', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -317,7 +321,7 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json /** * Sets category_id * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). + * @param int $category_id Идентификатор категории на Маркете. При изменении категории убедитесь, что характеристики товара и их значения в параметре `parameterValues` вы передаете для новой категории. Список категорий Маркета можно получить с помощью запроса [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). * * @return self */ @@ -327,8 +331,8 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json throw new \InvalidArgumentException('non-nullable category_id cannot be null'); } - if (($category_id < 1)) { - throw new \InvalidArgumentException('invalid value for $category_id when calling CategoryContentParametersDTO., must be bigger than or equal to 1.'); + if (($category_id <= 0)) { + throw new \InvalidArgumentException('invalid value for $category_id when calling CategoryContentParametersDTO., must be bigger than 0.'); } $this->container['category_id'] = $category_id; @@ -365,6 +369,11 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($parameters) && (count($parameters) < 1)) { + throw new \InvalidArgumentException('invalid length for $parameters when calling CategoryContentParametersDTO., number of items must be greater than or equal to 1.'); + } $this->container['parameters'] = $parameters; return $this; @@ -372,11 +381,11 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -384,12 +393,12 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -414,11 +423,11 @@ class CategoryContentParametersDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CategoryDTO.php b/erp24/lib/yandex_market_api/Model/CategoryDTO.php index 2d404915..3d73d878 100644 --- a/erp24/lib/yandex_market_api/Model/CategoryDTO.php +++ b/erp24/lib/yandex_market_api/Model/CategoryDTO.php @@ -2,7 +2,7 @@ /** * CategoryDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class CategoryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -295,6 +295,10 @@ class CategoryDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + if (!is_null($this->container['children']) && (count($this->container['children']) < 1)) { + $invalidProperties[] = "invalid value for 'children', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -393,6 +397,11 @@ class CategoryDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($children) && (count($children) < 1)) { + throw new \InvalidArgumentException('invalid length for $children when calling CategoryDTO., number of items must be greater than or equal to 1.'); + } $this->container['children'] = $children; return $this; @@ -400,11 +409,11 @@ class CategoryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -412,12 +421,12 @@ class CategoryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -442,11 +451,11 @@ class CategoryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CategoryErrorDTO.php b/erp24/lib/yandex_market_api/Model/CategoryErrorDTO.php index 97111c0f..7fed1885 100644 --- a/erp24/lib/yandex_market_api/Model/CategoryErrorDTO.php +++ b/erp24/lib/yandex_market_api/Model/CategoryErrorDTO.php @@ -2,7 +2,7 @@ /** * CategoryErrorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CategoryErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('category_id', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -353,11 +353,11 @@ class CategoryErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class CategoryErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class CategoryErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CategoryErrorType.php b/erp24/lib/yandex_market_api/Model/CategoryErrorType.php index d0c14e4f..d09f9e8b 100644 --- a/erp24/lib/yandex_market_api/Model/CategoryErrorType.php +++ b/erp24/lib/yandex_market_api/Model/CategoryErrorType.php @@ -2,7 +2,7 @@ /** * CategoryErrorType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/CategoryParameterDTO.php b/erp24/lib/yandex_market_api/Model/CategoryParameterDTO.php index 8ca27131..08335ec9 100644 --- a/erp24/lib/yandex_market_api/Model/CategoryParameterDTO.php +++ b/erp24/lib/yandex_market_api/Model/CategoryParameterDTO.php @@ -2,7 +2,7 @@ /** * CategoryParameterDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -318,10 +318,10 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -376,6 +376,10 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + if (!is_null($this->container['recommendation_types']) && (count($this->container['recommendation_types']) < 1)) { + $invalidProperties[] = "invalid value for 'recommendation_types', number of items must be greater than or equal to 1."; + } + if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } @@ -391,6 +395,14 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ if ($this->container['allow_custom_values'] === null) { $invalidProperties[] = "'allow_custom_values' can't be null"; } + if (!is_null($this->container['values']) && (count($this->container['values']) < 1)) { + $invalidProperties[] = "invalid value for 'values', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['value_restrictions']) && (count($this->container['value_restrictions']) < 1)) { + $invalidProperties[] = "invalid value for 'value_restrictions', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -575,6 +587,11 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($recommendation_types) && (count($recommendation_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $recommendation_types when calling CategoryParameterDTO., number of items must be greater than or equal to 1.'); + } $this->container['recommendation_types'] = $recommendation_types; return $this; @@ -744,6 +761,11 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($values) && (count($values) < 1)) { + throw new \InvalidArgumentException('invalid length for $values when calling CategoryParameterDTO., number of items must be greater than or equal to 1.'); + } $this->container['values'] = $values; return $this; @@ -805,6 +827,11 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($value_restrictions) && (count($value_restrictions) < 1)) { + throw new \InvalidArgumentException('invalid length for $value_restrictions when calling CategoryParameterDTO., number of items must be greater than or equal to 1.'); + } $this->container['value_restrictions'] = $value_restrictions; return $this; @@ -812,11 +839,11 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -824,12 +851,12 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -854,11 +881,11 @@ class CategoryParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CategoryParameterUnitDTO.php b/erp24/lib/yandex_market_api/Model/CategoryParameterUnitDTO.php index 17d2c011..d65456b9 100644 --- a/erp24/lib/yandex_market_api/Model/CategoryParameterUnitDTO.php +++ b/erp24/lib/yandex_market_api/Model/CategoryParameterUnitDTO.php @@ -2,7 +2,7 @@ /** * CategoryParameterUnitDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CategoryParameterUnitDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('default_unit_id', $data ?? [], null); $this->setIfExists('units', $data ?? [], null); @@ -359,11 +359,11 @@ class CategoryParameterUnitDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class CategoryParameterUnitDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class CategoryParameterUnitDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ChangeOutletRequest.php b/erp24/lib/yandex_market_api/Model/ChangeOutletRequest.php index c10ed750..971026f7 100644 --- a/erp24/lib/yandex_market_api/Model/ChangeOutletRequest.php +++ b/erp24/lib/yandex_market_api/Model/ChangeOutletRequest.php @@ -2,7 +2,7 @@ /** * ChangeOutletRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -299,10 +299,10 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -363,6 +363,10 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa if ($this->container['working_schedule'] === null) { $invalidProperties[] = "'working_schedule' can't be null"; } + if (!is_null($this->container['delivery_rules']) && (count($this->container['delivery_rules']) < 1)) { + $invalidProperties[] = "invalid value for 'delivery_rules', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -580,7 +584,7 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets phones * - * @param string[] $phones Номера телефонов точки продаж. Передавайте в формате: `+7 (999) 999-99-99`. + * @param string[] $phones Номера телефонов точки продаж. Передавайте номер в формате: `+<код страны>(<код города>)<номер>[#<добавочный>]`. Примеры: - `+7 (999) 999-99-99` - `+7 (999) 999-99-99#1234` * * @return self */ @@ -655,6 +659,11 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($delivery_rules) && (count($delivery_rules) < 1)) { + throw new \InvalidArgumentException('invalid length for $delivery_rules when calling ChangeOutletRequest., number of items must be greater than or equal to 1.'); + } $this->container['delivery_rules'] = $delivery_rules; return $this; @@ -689,11 +698,11 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -701,12 +710,12 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -731,11 +740,11 @@ class ChangeOutletRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ChannelType.php b/erp24/lib/yandex_market_api/Model/ChannelType.php index aada3ede..9a40d9a4 100644 --- a/erp24/lib/yandex_market_api/Model/ChannelType.php +++ b/erp24/lib/yandex_market_api/Model/ChannelType.php @@ -2,7 +2,7 @@ /** * ChannelType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -27,355 +27,87 @@ */ namespace OpenAPI\Client\Model; - -use \ArrayAccess; use \OpenAPI\Client\ObjectSerializer; /** * ChannelType Class Doc Comment * * @category Class - * @description Каналы продвижения товаров: * `PUSH` — пуш-уведомление из приложения Яндекс Маркет. * `STRETCH_MAIN` — верхний баннер-растяжка на главной странице Яндекс Маркета. * `MAIN_PAGE_CAROUSEL` — карусель акций на главной странице Яндекс Маркета. * `PRODUCT_RETAIL_PAGE` — товар на странице ритейл-повода. * `MAIN_PAGE_CAROUSEL_WEB` — карусель акций на главной странице веб версии Яндекс Маркета. * `PRODUCT_SEPARATE_LANDING` — товар на лендинге акции. * `SUPER_SHELF_CATEGORY` — полка в категориях. * `CAROUSEL_RETAIL_PAGE` — карусель на лендинге ритейл-повода. * `POPUP_APPLICATION` — всплывающее окно в приложении Яндекс Маркет. * `POST_TELEGRAM` — пост в Телеграм-канале Яндекс Маркета. * `CPA` — реклама в партнерской сети Яндекс Маркета. * `WEB_PERFORMANCE_DIRECT` — реклама в Яндекс Директе. * `APP_PERFORMANCE` — реклама в AppStore и Google Play. * `BANNER_PICKUP_POINT` — баннер в ПВЗ Маркета. * `BLOGGER_PERFORMANCE` — рекламная интеграция у блогеров. * `DIGITAL_CHANNEL_BANNER` — баннер в digital-каналах и социальных сетях VK, Одноклассники. * `YANDEX_ECOSYSTEM_CHANNELS` — реклама в других сервисах Яндекса: GO, Delivery, Еда. * `PARTNERS_MAIN_BANNER` — баннер на главной странице mail.ru, auto.ru, ya.ru. * `OTHER` — прочее. + * @description Каналы продвижения товаров: * `PUSH` — пуш-уведомление из приложения Яндекс Маркет. * `STRETCH_MAIN` — верхний баннер-растяжка на главной странице Яндекс Маркета. * `MAIN_PAGE_CAROUSEL` — карусель акций на главной странице Яндекс Маркета. * `PRODUCT_RETAIL_PAGE` — товар на странице ритейл-повода. * `MAIN_PAGE_CAROUSEL_WEB` — карусель акций на главной странице веб версии Яндекс Маркета. * `PRODUCT_SEPARATE_LANDING` — товар на лендинге акции. * `SUPER_SHELF_CATEGORY` — полка в категориях. * `CAROUSEL_RETAIL_PAGE` — карусель на лендинге ритейл-повода. * `POPUP_APPLICATION` — всплывающее окно в приложении Яндекс Маркет. * `POST_TELEGRAM` — пост в Телеграм-канале Яндекс Маркета. * `CPA` — реклама в партнерской сети Яндекс Маркета. * `WEB_PERFORMANCE_DIRECT` — реклама в Яндекс Директе. * `APP_PERFORMANCE` — реклама в :no-translate[AppStore] и :no-translate[Google Play]. * `BANNER_PICKUP_POINT` — баннер в ПВЗ Маркета. * `BLOGGER_PERFORMANCE` — рекламная интеграция у блогеров. * `DIGITAL_CHANNEL_BANNER` — баннер в digital-каналах и социальных сетях :no-translate[VK], :no-translate[Одноклассники]. * `YANDEX_ECOSYSTEM_CHANNELS` — реклама в других сервисах Яндекса: :no-translate[GO], :no-translate[Delivery], :no-translate[Еда]. * `PARTNERS_MAIN_BANNER` — баннер на главной странице :no-translate[mail.ru], :no-translate[auto.ru], :no-translate[ya.ru]. * `OTHER` — прочее. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess */ -class ChannelType implements ModelInterface, ArrayAccess, \JsonSerializable +class ChannelType { - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ChannelType'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - /** - * Array of nullable properties - * - * @return array + * Possible values of this enum */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } + public const PUSH = 'PUSH'; - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } + public const STRETCH_MAIN = 'STRETCH_MAIN'; - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } + public const MAIN_PAGE_CAROUSEL = 'MAIN_PAGE_CAROUSEL'; - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } + public const PRODUCT_RETAIL_PAGE = 'PRODUCT_RETAIL_PAGE'; - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } + public const MAIN_PAGE_CAROUSEL_WEB = 'MAIN_PAGE_CAROUSEL_WEB'; + public const PRODUCT_SEPARATE_LANDING = 'PRODUCT_SEPARATE_LANDING'; - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; + public const SUPER_SHELF_CATEGORY = 'SUPER_SHELF_CATEGORY'; - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - } + public const CAROUSEL_RETAIL_PAGE = 'CAROUSEL_RETAIL_PAGE'; - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } + public const POPUP_APPLICATION = 'POPUP_APPLICATION'; - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } + public const POST_TELEGRAM = 'POST_TELEGRAM'; - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; + public const CPA = 'CPA'; - return $invalidProperties; - } + public const WEB_PERFORMANCE_DIRECT = 'WEB_PERFORMANCE_DIRECT'; - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } + public const APP_PERFORMANCE = 'APP_PERFORMANCE'; - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } + public const BANNER_PICKUP_POINT = 'BANNER_PICKUP_POINT'; - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } + public const BLOGGER_PERFORMANCE = 'BLOGGER_PERFORMANCE'; - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } + public const DIGITAL_CHANNEL_BANNER = 'DIGITAL_CHANNEL_BANNER'; - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } + public const YANDEX_ECOSYSTEM_CHANNELS = 'YANDEX_ECOSYSTEM_CHANNELS'; - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } + public const PARTNERS_MAIN_BANNER = 'PARTNERS_MAIN_BANNER'; - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } + public const OTHER = 'OTHER'; /** - * Gets a header-safe presentation of the object - * - * @return string + * Gets allowable values of the enum + * @return string[] */ - public function toHeaderValue() + public static function getAllowableEnumValues() { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return [ + self::PUSH, + self::STRETCH_MAIN, + self::MAIN_PAGE_CAROUSEL, + self::PRODUCT_RETAIL_PAGE, + self::MAIN_PAGE_CAROUSEL_WEB, + self::PRODUCT_SEPARATE_LANDING, + self::SUPER_SHELF_CATEGORY, + self::CAROUSEL_RETAIL_PAGE, + self::POPUP_APPLICATION, + self::POST_TELEGRAM, + self::CPA, + self::WEB_PERFORMANCE_DIRECT, + self::APP_PERFORMANCE, + self::BANNER_PICKUP_POINT, + self::BLOGGER_PERFORMANCE, + self::DIGITAL_CHANNEL_BANNER, + self::YANDEX_ECOSYSTEM_CHANNELS, + self::PARTNERS_MAIN_BANNER, + self::OTHER + ]; } } diff --git a/erp24/lib/yandex_market_api/Model/ChatContextDTO.php b/erp24/lib/yandex_market_api/Model/ChatContextDTO.php new file mode 100644 index 00000000..9c36bf7a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ChatContextDTO.php @@ -0,0 +1,459 @@ + + */ +class ChatContextDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChatContextDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\OpenAPI\Client\Model\ChatContextIdentifiableType', + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\ChatContextIdentifiableType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\ChatContextIdentifiableType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор заказа или возврата. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling ChatContextDTO., must be bigger than or equal to 1.'); + } + + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ChatContextIdentifiableType.php b/erp24/lib/yandex_market_api/Model/ChatContextIdentifiableType.php new file mode 100644 index 00000000..7cc0f04a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ChatContextIdentifiableType.php @@ -0,0 +1,63 @@ + + */ +class ChatCustomerDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChatCustomerDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'public_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'public_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'public_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'public_id' => 'publicId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'public_id' => 'setPublicId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'public_id' => 'getPublicId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('public_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 1)) { + $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['public_id']) && (mb_strlen($this->container['public_id']) < 1)) { + $invalidProperties[] = "invalid value for 'public_id', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Публичное имя покупателя в Яндекс Паспорте, которое отображается в сервисах Яндекса. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + if ((mb_strlen($name) < 1)) { + throw new \InvalidArgumentException('invalid length for $name when calling ChatCustomerDTO., must be bigger than or equal to 1.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets public_id + * + * @return string|null + */ + public function getPublicId() + { + return $this->container['public_id']; + } + + /** + * Sets public_id + * + * @param string|null $public_id Публичный идентификатор пользователя в Яндекс Паспорте. {% cut \"Примеры, где используется\" %} * Маркет: `https://market.yandex.ru/user/{public-id}/reviews` * Дзен: `https://zen.yandex.ru/user/{public-id}` * Отзывы: `https://yandex.ru/user/{public-id}` {% endcut %} Подробнее о публичных данных читайте в [документации Яндекс ID](https://yandex.ru/support/id/ru/data/public-data). + * + * @return self + */ + public function setPublicId($public_id) + { + if (is_null($public_id)) { + throw new \InvalidArgumentException('non-nullable public_id cannot be null'); + } + + if ((mb_strlen($public_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $public_id when calling ChatCustomerDTO., must be bigger than or equal to 1.'); + } + + $this->container['public_id'] = $public_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ChatFullContextDTO.php b/erp24/lib/yandex_market_api/Model/ChatFullContextDTO.php new file mode 100644 index 00000000..3e4616d1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ChatFullContextDTO.php @@ -0,0 +1,576 @@ + + */ +class ChatFullContextDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChatFullContextDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\OpenAPI\Client\Model\ChatContextType', + 'customer' => '\OpenAPI\Client\Model\ChatCustomerDTO', + 'campaign_id' => 'int', + 'order_id' => 'int', + 'return_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'customer' => null, + 'campaign_id' => 'int64', + 'order_id' => 'int64', + 'return_id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'customer' => false, + 'campaign_id' => false, + 'order_id' => false, + 'return_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'customer' => 'customer', + 'campaign_id' => 'campaignId', + 'order_id' => 'orderId', + 'return_id' => 'returnId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'customer' => 'setCustomer', + 'campaign_id' => 'setCampaignId', + 'order_id' => 'setOrderId', + 'return_id' => 'setReturnId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'customer' => 'getCustomer', + 'campaign_id' => 'getCampaignId', + 'order_id' => 'getOrderId', + 'return_id' => 'getReturnId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('customer', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('return_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if (!is_null($this->container['campaign_id']) && ($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['order_id']) && ($this->container['order_id'] < 1)) { + $invalidProperties[] = "invalid value for 'order_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['return_id']) && ($this->container['return_id'] < 1)) { + $invalidProperties[] = "invalid value for 'return_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\ChatContextType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\ChatContextType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets customer + * + * @return \OpenAPI\Client\Model\ChatCustomerDTO|null + */ + public function getCustomer() + { + return $this->container['customer']; + } + + /** + * Sets customer + * + * @param \OpenAPI\Client\Model\ChatCustomerDTO|null $customer customer + * + * @return self + */ + public function setCustomer($customer) + { + if (is_null($customer)) { + throw new \InvalidArgumentException('non-nullable customer cannot be null'); + } + $this->container['customer'] = $customer; + + return $this; + } + + /** + * Gets campaign_id + * + * @return int|null + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling ChatFullContextDTO., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets order_id + * + * @return int|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param int|null $order_id Идентификатор заказа. Возвращается для заказов и возвратов. + * + * @return self + */ + public function setOrderId($order_id) + { + if (is_null($order_id)) { + throw new \InvalidArgumentException('non-nullable order_id cannot be null'); + } + + if (($order_id < 1)) { + throw new \InvalidArgumentException('invalid value for $order_id when calling ChatFullContextDTO., must be bigger than or equal to 1.'); + } + + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets return_id + * + * @return int|null + */ + public function getReturnId() + { + return $this->container['return_id']; + } + + /** + * Sets return_id + * + * @param int|null $return_id Идентификатор возврата. Возвращается только для возвратов. + * + * @return self + */ + public function setReturnId($return_id) + { + if (is_null($return_id)) { + throw new \InvalidArgumentException('non-nullable return_id cannot be null'); + } + + if (($return_id < 1)) { + throw new \InvalidArgumentException('invalid value for $return_id when calling ChatFullContextDTO., must be bigger than or equal to 1.'); + } + + $this->container['return_id'] = $return_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ChatMessageDTO.php b/erp24/lib/yandex_market_api/Model/ChatMessageDTO.php index d57da980..40d20ff1 100644 --- a/erp24/lib/yandex_market_api/Model/ChatMessageDTO.php +++ b/erp24/lib/yandex_market_api/Model/ChatMessageDTO.php @@ -2,7 +2,7 @@ /** * ChatMessageDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * ChatMessageDTO Class Doc Comment * * @category Class - * @description Информация о сообщениях. + * @description Информация о сообщении. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -264,10 +264,10 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('message_id', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); @@ -306,12 +306,20 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['message_id'] === null) { $invalidProperties[] = "'message_id' can't be null"; } + if (($this->container['message_id'] < 1)) { + $invalidProperties[] = "invalid value for 'message_id', must be bigger than or equal to 1."; + } + if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } if ($this->container['sender'] === null) { $invalidProperties[] = "'sender' can't be null"; } + if (!is_null($this->container['payload']) && (count($this->container['payload']) < 1)) { + $invalidProperties[] = "invalid value for 'payload', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -349,6 +357,11 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($message_id)) { throw new \InvalidArgumentException('non-nullable message_id cannot be null'); } + + if (($message_id < 1)) { + throw new \InvalidArgumentException('invalid value for $message_id when calling ChatMessageDTO., must be bigger than or equal to 1.'); + } + $this->container['message_id'] = $message_id; return $this; @@ -464,6 +477,11 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($payload) && (count($payload) < 1)) { + throw new \InvalidArgumentException('invalid length for $payload when calling ChatMessageDTO., number of items must be greater than or equal to 1.'); + } $this->container['payload'] = $payload; return $this; @@ -471,11 +489,11 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -483,12 +501,12 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -513,11 +531,11 @@ class ChatMessageDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ChatMessagePayloadDTO.php b/erp24/lib/yandex_market_api/Model/ChatMessagePayloadDTO.php index d7f997ef..e8e77c91 100644 --- a/erp24/lib/yandex_market_api/Model/ChatMessagePayloadDTO.php +++ b/erp24/lib/yandex_market_api/Model/ChatMessagePayloadDTO.php @@ -2,7 +2,7 @@ /** * ChatMessagePayloadDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); @@ -292,13 +292,17 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - if ((mb_strlen($this->container['name']) < 1)) { - $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1."; - } - if ($this->container['url'] === null) { $invalidProperties[] = "'url' can't be null"; } + if ((mb_strlen($this->container['url']) > 2000)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2000."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + if ($this->container['size'] === null) { $invalidProperties[] = "'size' can't be null"; } @@ -330,7 +334,7 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets name * - * @param string $name Имя файла. + * @param string $name Название файла. * * @return self */ @@ -339,11 +343,6 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali if (is_null($name)) { throw new \InvalidArgumentException('non-nullable name cannot be null'); } - - if ((mb_strlen($name) < 1)) { - throw new \InvalidArgumentException('invalid length for $name when calling ChatMessagePayloadDTO., must be bigger than or equal to 1.'); - } - $this->container['name'] = $name; return $this; @@ -362,7 +361,7 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets url * - * @param string $url Ссылка для скачивания файла. + * @param string $url url * * @return self */ @@ -371,6 +370,13 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali if (is_null($url)) { throw new \InvalidArgumentException('non-nullable url cannot be null'); } + if ((mb_strlen($url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $url when calling ChatMessagePayloadDTO., must be smaller than or equal to 2000.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling ChatMessagePayloadDTO., must be bigger than or equal to 1.'); + } + $this->container['url'] = $url; return $this; @@ -405,11 +411,11 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -417,12 +423,12 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -447,11 +453,11 @@ class ChatMessagePayloadDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ChatMessageSenderType.php b/erp24/lib/yandex_market_api/Model/ChatMessageSenderType.php index 5f2be1c4..f36634d6 100644 --- a/erp24/lib/yandex_market_api/Model/ChatMessageSenderType.php +++ b/erp24/lib/yandex_market_api/Model/ChatMessageSenderType.php @@ -2,7 +2,7 @@ /** * ChatMessageSenderType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ChatMessageSenderType Class Doc Comment * * @category Class - * @description Кто отправил сообщение: * `PARTNER` — магазин. * `CUSTOMER` — покупатель. * `MARKET` — Маркет. * `SUPPORT` — сотрудник службы поддержки Маркета. + * @description Кто отправил сообщение: * `PARTNER` — магазин. * `CUSTOMER` — покупатель. * `MARKET` — Маркет ([автоматическое сообщение](*market-notification)). * `SUPPORT` — сотрудник службы поддержки Маркета. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/ChatMessagesResultDTO.php b/erp24/lib/yandex_market_api/Model/ChatMessagesResultDTO.php index c3075058..d41ceac3 100644 --- a/erp24/lib/yandex_market_api/Model/ChatMessagesResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/ChatMessagesResultDTO.php @@ -2,7 +2,7 @@ /** * ChatMessagesResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,6 +59,7 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'order_id' => 'int', + 'context' => '\OpenAPI\Client\Model\ChatFullContextDTO', 'messages' => '\OpenAPI\Client\Model\ChatMessageDTO[]', 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' ]; @@ -72,6 +73,7 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPIFormats = [ 'order_id' => 'int64', + 'context' => null, 'messages' => null, 'paging' => null ]; @@ -83,6 +85,7 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'order_id' => false, + 'context' => false, 'messages' => false, 'paging' => false ]; @@ -174,6 +177,7 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $attributeMap = [ 'order_id' => 'orderId', + 'context' => 'context', 'messages' => 'messages', 'paging' => 'paging' ]; @@ -185,6 +189,7 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $setters = [ 'order_id' => 'setOrderId', + 'context' => 'setContext', 'messages' => 'setMessages', 'paging' => 'setPaging' ]; @@ -196,6 +201,7 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $getters = [ 'order_id' => 'getOrderId', + 'context' => 'getContext', 'messages' => 'getMessages', 'paging' => 'getPaging' ]; @@ -252,12 +258,13 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('context', $data ?? [], null); $this->setIfExists('messages', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); } @@ -289,8 +296,8 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; - if ($this->container['order_id'] === null) { - $invalidProperties[] = "'order_id' can't be null"; + if ($this->container['context'] === null) { + $invalidProperties[] = "'context' can't be null"; } if ($this->container['messages'] === null) { $invalidProperties[] = "'messages' can't be null"; @@ -313,7 +320,8 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets order_id * - * @return int + * @return int|null + * @deprecated */ public function getOrderId() { @@ -323,9 +331,10 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets order_id * - * @param int $order_id Идентификатор заказа. + * @param int|null $order_id Идентификатор заказа. * * @return self + * @deprecated */ public function setOrderId($order_id) { @@ -337,6 +346,33 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali return $this; } + /** + * Gets context + * + * @return \OpenAPI\Client\Model\ChatFullContextDTO + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \OpenAPI\Client\Model\ChatFullContextDTO $context context + * + * @return self + */ + public function setContext($context) + { + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); + } + $this->container['context'] = $context; + + return $this; + } + /** * Gets messages * @@ -393,11 +429,11 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +441,12 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +471,11 @@ class ChatMessagesResultDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ChatStatusType.php b/erp24/lib/yandex_market_api/Model/ChatStatusType.php index 30c3c5ad..9193cfcc 100644 --- a/erp24/lib/yandex_market_api/Model/ChatStatusType.php +++ b/erp24/lib/yandex_market_api/Model/ChatStatusType.php @@ -2,7 +2,7 @@ /** * ChatStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/ChatType.php b/erp24/lib/yandex_market_api/Model/ChatType.php index 846b9baa..dddfeace 100644 --- a/erp24/lib/yandex_market_api/Model/ChatType.php +++ b/erp24/lib/yandex_market_api/Model/ChatType.php @@ -2,7 +2,7 @@ /** * ChatType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/CisDTO.php b/erp24/lib/yandex_market_api/Model/CisDTO.php new file mode 100644 index 00000000..4c6fd078 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CisDTO.php @@ -0,0 +1,484 @@ + + */ +class CisDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CisDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'status' => '\OpenAPI\Client\Model\CisStatusType', + 'substatus' => '\OpenAPI\Client\Model\CisSubstatusType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'status' => null, + 'substatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => false, + 'status' => false, + 'substatus' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'status' => 'status', + 'substatus' => 'substatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'status' => 'setStatus', + 'substatus' => 'setSubstatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'status' => 'getStatus', + 'substatus' => 'getSubstatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('substatus', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value Код маркировки в системе :no-translate[«Честный ЗНАК»]. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\CisStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\CisStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets substatus + * + * @return \OpenAPI\Client\Model\CisSubstatusType|null + */ + public function getSubstatus() + { + return $this->container['substatus']; + } + + /** + * Sets substatus + * + * @param \OpenAPI\Client\Model\CisSubstatusType|null $substatus substatus + * + * @return self + */ + public function setSubstatus($substatus) + { + if (is_null($substatus)) { + throw new \InvalidArgumentException('non-nullable substatus cannot be null'); + } + $this->container['substatus'] = $substatus; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/CisStatusType.php b/erp24/lib/yandex_market_api/Model/CisStatusType.php new file mode 100644 index 00000000..2021e9b3 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CisStatusType.php @@ -0,0 +1,72 @@ + + */ +class ClosureDocumentsMonthOfYearDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClosureDocumentsMonthOfYearDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'year' => 'int', + 'month' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'year' => 'int32', + 'month' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'year' => false, + 'month' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'year' => 'year', + 'month' => 'month' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'year' => 'setYear', + 'month' => 'setMonth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'year' => 'getYear', + 'month' => 'getMonth' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if (($this->container['month'] > 12)) { + $invalidProperties[] = "invalid value for 'month', must be smaller than or equal to 12."; + } + + if (($this->container['month'] < 1)) { + $invalidProperties[] = "invalid value for 'month', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year Год. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month Номер месяца. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + + if (($month > 12)) { + throw new \InvalidArgumentException('invalid value for $month when calling ClosureDocumentsMonthOfYearDTO., must be smaller than or equal to 12.'); + } + if (($month < 1)) { + throw new \InvalidArgumentException('invalid value for $month when calling ClosureDocumentsMonthOfYearDTO., must be bigger than or equal to 1.'); + } + + $this->container['month'] = $month; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/CommentDTO.php b/erp24/lib/yandex_market_api/Model/CommentDTO.php new file mode 100644 index 00000000..99718bbe --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CommentDTO.php @@ -0,0 +1,739 @@ + + */ +class CommentDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CommentDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'text' => 'string', + 'can_modify' => 'bool', + 'parent_id' => 'int', + 'author' => '\OpenAPI\Client\Model\QuestionsTextContentAuthorDTO', + 'status' => '\OpenAPI\Client\Model\QuestionsTextContentModerationStatusType', + 'answer_id' => 'int', + 'created_at' => '\DateTime', + 'votes' => '\OpenAPI\Client\Model\VotesDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'text' => null, + 'can_modify' => null, + 'parent_id' => 'int64', + 'author' => null, + 'status' => null, + 'answer_id' => 'int64', + 'created_at' => 'date-time', + 'votes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'text' => false, + 'can_modify' => false, + 'parent_id' => false, + 'author' => false, + 'status' => false, + 'answer_id' => false, + 'created_at' => false, + 'votes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'text' => 'text', + 'can_modify' => 'canModify', + 'parent_id' => 'parentId', + 'author' => 'author', + 'status' => 'status', + 'answer_id' => 'answerId', + 'created_at' => 'createdAt', + 'votes' => 'votes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'text' => 'setText', + 'can_modify' => 'setCanModify', + 'parent_id' => 'setParentId', + 'author' => 'setAuthor', + 'status' => 'setStatus', + 'answer_id' => 'setAnswerId', + 'created_at' => 'setCreatedAt', + 'votes' => 'setVotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'text' => 'getText', + 'can_modify' => 'getCanModify', + 'parent_id' => 'getParentId', + 'author' => 'getAuthor', + 'status' => 'getStatus', + 'answer_id' => 'getAnswerId', + 'created_at' => 'getCreatedAt', + 'votes' => 'getVotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('can_modify', $data ?? [], null); + $this->setIfExists('parent_id', $data ?? [], null); + $this->setIfExists('author', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('answer_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('votes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + + if ($this->container['text'] === null) { + $invalidProperties[] = "'text' can't be null"; + } + if ((mb_strlen($this->container['text']) > 5000)) { + $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 5000."; + } + + if ((mb_strlen($this->container['text']) < 1)) { + $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['parent_id']) && ($this->container['parent_id'] < 1)) { + $invalidProperties[] = "invalid value for 'parent_id', must be bigger than or equal to 1."; + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['answer_id'] === null) { + $invalidProperties[] = "'answer_id' can't be null"; + } + if (($this->container['answer_id'] < 1)) { + $invalidProperties[] = "invalid value for 'answer_id', must be bigger than or equal to 1."; + } + + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор комментария к ответу. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling CommentDTO., must be bigger than or equal to 1.'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets text + * + * @return string + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string $text Текстовое содержимое. + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + if ((mb_strlen($text) > 5000)) { + throw new \InvalidArgumentException('invalid length for $text when calling CommentDTO., must be smaller than or equal to 5000.'); + } + if ((mb_strlen($text) < 1)) { + throw new \InvalidArgumentException('invalid length for $text when calling CommentDTO., must be bigger than or equal to 1.'); + } + + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets can_modify + * + * @return bool|null + */ + public function getCanModify() + { + return $this->container['can_modify']; + } + + /** + * Sets can_modify + * + * @param bool|null $can_modify Может ли продавец изменять комментарий или удалять его. + * + * @return self + */ + public function setCanModify($can_modify) + { + if (is_null($can_modify)) { + throw new \InvalidArgumentException('non-nullable can_modify cannot be null'); + } + $this->container['can_modify'] = $can_modify; + + return $this; + } + + /** + * Gets parent_id + * + * @return int|null + */ + public function getParentId() + { + return $this->container['parent_id']; + } + + /** + * Sets parent_id + * + * @param int|null $parent_id Идентификатор комментария к ответу. + * + * @return self + */ + public function setParentId($parent_id) + { + if (is_null($parent_id)) { + throw new \InvalidArgumentException('non-nullable parent_id cannot be null'); + } + + if (($parent_id < 1)) { + throw new \InvalidArgumentException('invalid value for $parent_id when calling CommentDTO., must be bigger than or equal to 1.'); + } + + $this->container['parent_id'] = $parent_id; + + return $this; + } + + /** + * Gets author + * + * @return \OpenAPI\Client\Model\QuestionsTextContentAuthorDTO|null + */ + public function getAuthor() + { + return $this->container['author']; + } + + /** + * Sets author + * + * @param \OpenAPI\Client\Model\QuestionsTextContentAuthorDTO|null $author author + * + * @return self + */ + public function setAuthor($author) + { + if (is_null($author)) { + throw new \InvalidArgumentException('non-nullable author cannot be null'); + } + $this->container['author'] = $author; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\QuestionsTextContentModerationStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\QuestionsTextContentModerationStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets answer_id + * + * @return int + */ + public function getAnswerId() + { + return $this->container['answer_id']; + } + + /** + * Sets answer_id + * + * @param int $answer_id Идентификатор ответа на вопрос. + * + * @return self + */ + public function setAnswerId($answer_id) + { + if (is_null($answer_id)) { + throw new \InvalidArgumentException('non-nullable answer_id cannot be null'); + } + + if (($answer_id < 1)) { + throw new \InvalidArgumentException('invalid value for $answer_id when calling CommentDTO., must be bigger than or equal to 1.'); + } + + $this->container['answer_id'] = $answer_id; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at Дата создания комментария. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets votes + * + * @return \OpenAPI\Client\Model\VotesDTO|null + */ + public function getVotes() + { + return $this->container['votes']; + } + + /** + * Sets votes + * + * @param \OpenAPI\Client\Model\VotesDTO|null $votes votes + * + * @return self + */ + public function setVotes($votes) + { + if (is_null($votes)) { + throw new \InvalidArgumentException('non-nullable votes cannot be null'); + } + $this->container['votes'] = $votes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/CommodityCodeDTO.php b/erp24/lib/yandex_market_api/Model/CommodityCodeDTO.php new file mode 100644 index 00000000..6f25c0d1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CommodityCodeDTO.php @@ -0,0 +1,450 @@ + + */ +class CommodityCodeDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CommodityCodeDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'type' => '\OpenAPI\Client\Model\CommodityCodeType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code Товарный код. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\CommodityCodeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\CommodityCodeType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/CommodityCodeType.php b/erp24/lib/yandex_market_api/Model/CommodityCodeType.php new file mode 100644 index 00000000..633724f1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CommodityCodeType.php @@ -0,0 +1,63 @@ +setIfExists('offer_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class ConfirmPricesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class ConfirmPricesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class ConfirmPricesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ConfirmShipmentRequest.php b/erp24/lib/yandex_market_api/Model/ConfirmShipmentRequest.php index dd09ecee..10e2e634 100644 --- a/erp24/lib/yandex_market_api/Model/ConfirmShipmentRequest.php +++ b/erp24/lib/yandex_market_api/Model/ConfirmShipmentRequest.php @@ -2,7 +2,7 @@ /** * ConfirmShipmentRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,7 +58,8 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'external_shipment_id' => 'string' + 'external_shipment_id' => 'string', + 'signatory' => 'string' ]; /** @@ -69,7 +70,8 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'external_shipment_id' => null + 'external_shipment_id' => null, + 'signatory' => null ]; /** @@ -78,7 +80,8 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'external_shipment_id' => false + 'external_shipment_id' => false, + 'signatory' => false ]; /** @@ -167,7 +170,8 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $attributeMap = [ - 'external_shipment_id' => 'externalShipmentId' + 'external_shipment_id' => 'externalShipmentId', + 'signatory' => 'signatory' ]; /** @@ -176,7 +180,8 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $setters = [ - 'external_shipment_id' => 'setExternalShipmentId' + 'external_shipment_id' => 'setExternalShipmentId', + 'signatory' => 'setSignatory' ]; /** @@ -185,7 +190,8 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $getters = [ - 'external_shipment_id' => 'getExternalShipmentId' + 'external_shipment_id' => 'getExternalShipmentId', + 'signatory' => 'getSignatory' ]; /** @@ -240,12 +246,13 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('external_shipment_id', $data ?? [], null); + $this->setIfExists('signatory', $data ?? [], null); } /** @@ -316,14 +323,41 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial return $this; } + + /** + * Gets signatory + * + * @return string|null + */ + public function getSignatory() + { + return $this->container['signatory']; + } + + /** + * Sets signatory + * + * @param string|null $signatory Логин пользователя в Яндекс ID, от имени которого будет подписываться электронный акт приема-передачи. Указывается без `@yandex.ru`. Где его найти: * на странице [Яндекс ID](https://id.yandex.ru); * в [кабинете продавца на Маркете](https://partner.market.yandex.ru/): * в верхнем правом углу под иконкой пользователя; * на странице **Настройки** → **Сотрудники и доступы**. + * + * @return self + */ + public function setSignatory($signatory) + { + if (is_null($signatory)) { + throw new \InvalidArgumentException('non-nullable signatory cannot be null'); + } + $this->container['signatory'] = $signatory; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +365,12 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +395,11 @@ class ConfirmShipmentRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CountryDTO.php b/erp24/lib/yandex_market_api/Model/CountryDTO.php new file mode 100644 index 00000000..0e7518e4 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CountryDTO.php @@ -0,0 +1,472 @@ + + */ +class CountryDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CountryDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'region' => '\OpenAPI\Client\Model\RegionDTO', + 'country_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'region' => null, + 'country_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'region' => false, + 'country_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'region' => 'region', + 'country_code' => 'countryCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'region' => 'setRegion', + 'country_code' => 'setCountryCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'region' => 'getRegion', + 'country_code' => 'getCountryCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('region', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['region'] === null) { + $invalidProperties[] = "'region' can't be null"; + } + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + if ((mb_strlen($this->container['country_code']) > 2)) { + $invalidProperties[] = "invalid value for 'country_code', the character length must be smaller than or equal to 2."; + } + + if ((mb_strlen($this->container['country_code']) < 2)) { + $invalidProperties[] = "invalid value for 'country_code', the character length must be bigger than or equal to 2."; + } + + if (!preg_match("/^[A-Z]{2}$/", $this->container['country_code'])) { + $invalidProperties[] = "invalid value for 'country_code', must be conform to the pattern /^[A-Z]{2}$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets region + * + * @return \OpenAPI\Client\Model\RegionDTO + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param \OpenAPI\Client\Model\RegionDTO $region region + * + * @return self + */ + public function setRegion($region) + { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code Страна производства в формате ISO 3166-1 alpha-2. [Как получить](../../reference/regions/getRegionsCodes.md) + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + if ((mb_strlen($country_code) > 2)) { + throw new \InvalidArgumentException('invalid length for $country_code when calling CountryDTO., must be smaller than or equal to 2.'); + } + if ((mb_strlen($country_code) < 2)) { + throw new \InvalidArgumentException('invalid length for $country_code when calling CountryDTO., must be bigger than or equal to 2.'); + } + if ((!preg_match("/^[A-Z]{2}$/", ObjectSerializer::toString($country_code)))) { + throw new \InvalidArgumentException("invalid value for \$country_code when calling CountryDTO., must conform to the pattern /^[A-Z]{2}$/."); + } + + $this->container['country_code'] = $country_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/CreateChatRequest.php b/erp24/lib/yandex_market_api/Model/CreateChatRequest.php index 02218442..df2d80a6 100644 --- a/erp24/lib/yandex_market_api/Model/CreateChatRequest.php +++ b/erp24/lib/yandex_market_api/Model/CreateChatRequest.php @@ -2,7 +2,7 @@ /** * CreateChatRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,7 +58,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'order_id' => 'int' + 'order_id' => 'int', + 'context' => '\OpenAPI\Client\Model\ChatContextDTO' ]; /** @@ -69,7 +70,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ - 'order_id' => 'int64' + 'order_id' => 'int64', + 'context' => null ]; /** @@ -78,7 +80,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var boolean[] */ protected static array $openAPINullables = [ - 'order_id' => false + 'order_id' => false, + 'context' => false ]; /** @@ -167,7 +170,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $attributeMap = [ - 'order_id' => 'orderId' + 'order_id' => 'orderId', + 'context' => 'context' ]; /** @@ -176,7 +180,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $setters = [ - 'order_id' => 'setOrderId' + 'order_id' => 'setOrderId', + 'context' => 'setContext' ]; /** @@ -185,7 +190,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $getters = [ - 'order_id' => 'getOrderId' + 'order_id' => 'getOrderId', + 'context' => 'getContext' ]; /** @@ -240,12 +246,13 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('context', $data ?? [], null); } /** @@ -275,9 +282,6 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; - if ($this->container['order_id'] === null) { - $invalidProperties[] = "'order_id' can't be null"; - } return $invalidProperties; } @@ -296,7 +300,8 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets order_id * - * @return int + * @return int|null + * @deprecated */ public function getOrderId() { @@ -306,9 +311,10 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets order_id * - * @param int $order_id Идентификатор заказа на Маркете. + * @param int|null $order_id Идентификатор заказа на Маркете. * * @return self + * @deprecated */ public function setOrderId($order_id) { @@ -319,14 +325,41 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl return $this; } + + /** + * Gets context + * + * @return \OpenAPI\Client\Model\ChatContextDTO|null + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \OpenAPI\Client\Model\ChatContextDTO|null $context context + * + * @return self + */ + public function setContext($context) + { + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); + } + $this->container['context'] = $context; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +367,12 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +397,11 @@ class CreateChatRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CreateChatResponse.php b/erp24/lib/yandex_market_api/Model/CreateChatResponse.php index 451f7902..41cba7b2 100644 --- a/erp24/lib/yandex_market_api/Model/CreateChatResponse.php +++ b/erp24/lib/yandex_market_api/Model/CreateChatResponse.php @@ -2,7 +2,7 @@ /** * CreateChatResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class CreateChatResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CreateChatResultDTO.php b/erp24/lib/yandex_market_api/Model/CreateChatResultDTO.php index 0d1ed085..4b562115 100644 --- a/erp24/lib/yandex_market_api/Model/CreateChatResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/CreateChatResultDTO.php @@ -2,7 +2,7 @@ /** * CreateChatResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class CreateChatResultDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('chat_id', $data ?? [], null); } @@ -331,11 +331,11 @@ class CreateChatResultDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -343,12 +343,12 @@ class CreateChatResultDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -373,11 +373,11 @@ class CreateChatResultDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CreateOutletResponse.php b/erp24/lib/yandex_market_api/Model/CreateOutletResponse.php index 8a548b1d..d0070cdd 100644 --- a/erp24/lib/yandex_market_api/Model/CreateOutletResponse.php +++ b/erp24/lib/yandex_market_api/Model/CreateOutletResponse.php @@ -2,7 +2,7 @@ /** * CreateOutletResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class CreateOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/CurrencyType.php b/erp24/lib/yandex_market_api/Model/CurrencyType.php index e56dc450..b8035944 100644 --- a/erp24/lib/yandex_market_api/Model/CurrencyType.php +++ b/erp24/lib/yandex_market_api/Model/CurrencyType.php @@ -2,7 +2,7 @@ /** * CurrencyType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * CurrencyType Class Doc Comment * * @category Class - * @description Коды валют. Возможные значения: * `BYR` — белорусский рубль. * `KZT` — казахстанский тенге. * `RUR` — российский рубль. * `UAH` — украинская гривна. + * @description Коды валют: * `RUR` — российский рубль. * `UAH` — украинская гривна. * `BYR` — белорусский рубль. * `KZT` — казахстанский тенге. * `UZS` — узбекский сум. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/CurrencyValueDTO.php b/erp24/lib/yandex_market_api/Model/CurrencyValueDTO.php new file mode 100644 index 00000000..31b07747 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/CurrencyValueDTO.php @@ -0,0 +1,450 @@ + + */ +class CurrencyValueDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CurrencyValueDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'float', + 'currency_id' => '\OpenAPI\Client\Model\CurrencyType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'currency_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => false, + 'currency_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'currency_id' => 'currencyId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'currency_id' => 'setCurrencyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'currency_id' => 'getCurrencyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('currency_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['currency_id'] === null) { + $invalidProperties[] = "'currency_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return float + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float $value Значение. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency_id + * + * @return \OpenAPI\Client\Model\CurrencyType + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param \OpenAPI\Client\Model\CurrencyType $currency_id currency_id + * + * @return self + */ + public function setCurrencyId($currency_id) + { + if (is_null($currency_id)) { + throw new \InvalidArgumentException('non-nullable currency_id cannot be null'); + } + $this->container['currency_id'] = $currency_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/DayOfWeekType.php b/erp24/lib/yandex_market_api/Model/DayOfWeekType.php index 6e581ad9..c487136c 100644 --- a/erp24/lib/yandex_market_api/Model/DayOfWeekType.php +++ b/erp24/lib/yandex_market_api/Model/DayOfWeekType.php @@ -2,7 +2,7 @@ /** * DayOfWeekType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersDTO.php b/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersDTO.php index 58bcba93..c9831b07 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersDTO.php +++ b/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersDTO.php @@ -2,7 +2,7 @@ /** * DeleteCampaignOffersDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeleteCampaignOffersDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('not_deleted_offer_ids', $data ?? [], null); } @@ -275,6 +275,10 @@ class DeleteCampaignOffersDTO implements ModelInterface, ArrayAccess, \JsonSeria { $invalidProperties = []; + if (!is_null($this->container['not_deleted_offer_ids']) && (count($this->container['not_deleted_offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'not_deleted_offer_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -319,6 +323,11 @@ class DeleteCampaignOffersDTO implements ModelInterface, ArrayAccess, \JsonSeria $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($not_deleted_offer_ids) && (count($not_deleted_offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $not_deleted_offer_ids when calling DeleteCampaignOffersDTO., number of items must be greater than or equal to 1.'); + } $this->container['not_deleted_offer_ids'] = $not_deleted_offer_ids; return $this; @@ -326,11 +335,11 @@ class DeleteCampaignOffersDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class DeleteCampaignOffersDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class DeleteCampaignOffersDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersRequest.php b/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersRequest.php index 1b3809c5..9ba93418 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersRequest.php @@ -2,7 +2,7 @@ /** * DeleteCampaignOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * DeleteCampaignOffersRequest Class Doc Comment * * @category Class - * @description Фильтрации удаляемых товаров по offerIds. + * @description Фильтрации удаляемых товаров по `offerIds`. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -240,10 +240,10 @@ class DeleteCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class DeleteCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class DeleteCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class DeleteCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersResponse.php b/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersResponse.php index 7307be47..81d561a7 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/DeleteCampaignOffersResponse.php @@ -2,7 +2,7 @@ /** * DeleteCampaignOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class DeleteCampaignOffersResponse implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteGoodsFeedbackCommentRequest.php b/erp24/lib/yandex_market_api/Model/DeleteGoodsFeedbackCommentRequest.php index c46a7173..31aa48ff 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteGoodsFeedbackCommentRequest.php +++ b/erp24/lib/yandex_market_api/Model/DeleteGoodsFeedbackCommentRequest.php @@ -2,7 +2,7 @@ /** * DeleteGoodsFeedbackCommentRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeleteGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); } @@ -322,11 +322,11 @@ class DeleteGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class DeleteGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class DeleteGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteHiddenOffersRequest.php b/erp24/lib/yandex_market_api/Model/DeleteHiddenOffersRequest.php index d0630536..91362024 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteHiddenOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/DeleteHiddenOffersRequest.php @@ -2,7 +2,7 @@ /** * DeleteHiddenOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeleteHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('hidden_offers', $data ?? [], null); } @@ -337,11 +337,11 @@ class DeleteHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class DeleteHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class DeleteHiddenOffersRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteOfferParameterType.php b/erp24/lib/yandex_market_api/Model/DeleteOfferParameterType.php new file mode 100644 index 00000000..f358cd19 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/DeleteOfferParameterType.php @@ -0,0 +1,126 @@ +setIfExists('not_deleted_offer_ids', $data ?? [], null); } @@ -275,6 +275,10 @@ class DeleteOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if (!is_null($this->container['not_deleted_offer_ids']) && (count($this->container['not_deleted_offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'not_deleted_offer_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -319,6 +323,11 @@ class DeleteOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($not_deleted_offer_ids) && (count($not_deleted_offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $not_deleted_offer_ids when calling DeleteOffersDTO., number of items must be greater than or equal to 1.'); + } $this->container['not_deleted_offer_ids'] = $not_deleted_offer_ids; return $this; @@ -326,11 +335,11 @@ class DeleteOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class DeleteOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class DeleteOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveDTO.php b/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveDTO.php index 246a9757..cd783c16 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveDTO.php +++ b/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveDTO.php @@ -2,7 +2,7 @@ /** * DeleteOffersFromArchiveDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeleteOffersFromArchiveDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('not_unarchived_offer_ids', $data ?? [], null); } @@ -275,6 +275,10 @@ class DeleteOffersFromArchiveDTO implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if (!is_null($this->container['not_unarchived_offer_ids']) && (count($this->container['not_unarchived_offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'not_unarchived_offer_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -319,6 +323,11 @@ class DeleteOffersFromArchiveDTO implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($not_unarchived_offer_ids) && (count($not_unarchived_offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $not_unarchived_offer_ids when calling DeleteOffersFromArchiveDTO., number of items must be greater than or equal to 1.'); + } $this->container['not_unarchived_offer_ids'] = $not_unarchived_offer_ids; return $this; @@ -326,11 +335,11 @@ class DeleteOffersFromArchiveDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class DeleteOffersFromArchiveDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class DeleteOffersFromArchiveDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveRequest.php b/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveRequest.php index b81e6f5c..e13c78b2 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveRequest.php +++ b/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveRequest.php @@ -2,7 +2,7 @@ /** * DeleteOffersFromArchiveRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeleteOffersFromArchiveRequest implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class DeleteOffersFromArchiveRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class DeleteOffersFromArchiveRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class DeleteOffersFromArchiveRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveResponse.php b/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveResponse.php index 17dfd7c3..11999b12 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveResponse.php +++ b/erp24/lib/yandex_market_api/Model/DeleteOffersFromArchiveResponse.php @@ -2,7 +2,7 @@ /** * DeleteOffersFromArchiveResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class DeleteOffersFromArchiveResponse implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteOffersRequest.php b/erp24/lib/yandex_market_api/Model/DeleteOffersRequest.php index 1e0215bf..ab72abb0 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/DeleteOffersRequest.php @@ -2,7 +2,7 @@ /** * DeleteOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeleteOffersRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class DeleteOffersRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class DeleteOffersRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class DeleteOffersRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeleteOffersResponse.php b/erp24/lib/yandex_market_api/Model/DeleteOffersResponse.php index 4802b8ae..591538e4 100644 --- a/erp24/lib/yandex_market_api/Model/DeleteOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/DeleteOffersResponse.php @@ -2,7 +2,7 @@ /** * DeleteOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class DeleteOffersResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeletePromoOffersRequest.php b/erp24/lib/yandex_market_api/Model/DeletePromoOffersRequest.php index f2f51186..91098a97 100644 --- a/erp24/lib/yandex_market_api/Model/DeletePromoOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/DeletePromoOffersRequest.php @@ -2,7 +2,7 @@ /** * DeletePromoOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class DeletePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('promo_id', $data ?? [], null); $this->setIfExists('delete_all_offers', $data ?? [], null); @@ -412,11 +412,11 @@ class DeletePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -424,12 +424,12 @@ class DeletePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -454,11 +454,11 @@ class DeletePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeletePromoOffersResponse.php b/erp24/lib/yandex_market_api/Model/DeletePromoOffersResponse.php index 533ebac1..407cc510 100644 --- a/erp24/lib/yandex_market_api/Model/DeletePromoOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/DeletePromoOffersResponse.php @@ -2,7 +2,7 @@ /** * DeletePromoOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class DeletePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeletePromoOffersResultDTO.php b/erp24/lib/yandex_market_api/Model/DeletePromoOffersResultDTO.php index 082f0290..c4bb2e9a 100644 --- a/erp24/lib/yandex_market_api/Model/DeletePromoOffersResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/DeletePromoOffersResultDTO.php @@ -2,7 +2,7 @@ /** * DeletePromoOffersResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeletePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('rejected_offers', $data ?? [], null); } @@ -275,6 +275,10 @@ class DeletePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if (!is_null($this->container['rejected_offers']) && (count($this->container['rejected_offers']) < 1)) { + $invalidProperties[] = "invalid value for 'rejected_offers', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -319,6 +323,11 @@ class DeletePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($rejected_offers) && (count($rejected_offers) < 1)) { + throw new \InvalidArgumentException('invalid length for $rejected_offers when calling DeletePromoOffersResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['rejected_offers'] = $rejected_offers; return $this; @@ -326,11 +335,11 @@ class DeletePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class DeletePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class DeletePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeliveryPriceDTO.php b/erp24/lib/yandex_market_api/Model/DeliveryPriceDTO.php new file mode 100644 index 00000000..e3350dfe --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/DeliveryPriceDTO.php @@ -0,0 +1,478 @@ + + */ +class DeliveryPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeliveryPriceDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'subsidy' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'vat' => '\OpenAPI\Client\Model\OrderVatType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment' => null, + 'subsidy' => null, + 'vat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment' => false, + 'subsidy' => false, + 'vat' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment' => 'payment', + 'subsidy' => 'subsidy', + 'vat' => 'vat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment' => 'setPayment', + 'subsidy' => 'setSubsidy', + 'vat' => 'setVat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment' => 'getPayment', + 'subsidy' => 'getSubsidy', + 'vat' => 'getVat' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('subsidy', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getPayment() + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $payment payment + * + * @return self + */ + public function setPayment($payment) + { + if (is_null($payment)) { + throw new \InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets subsidy + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getSubsidy() + { + return $this->container['subsidy']; + } + + /** + * Sets subsidy + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $subsidy subsidy + * + * @return self + */ + public function setSubsidy($subsidy) + { + if (is_null($subsidy)) { + throw new \InvalidArgumentException('non-nullable subsidy cannot be null'); + } + $this->container['subsidy'] = $subsidy; + + return $this; + } + + /** + * Gets vat + * + * @return \OpenAPI\Client\Model\OrderVatType|null + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \OpenAPI\Client\Model\OrderVatType|null $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/DeliveryServiceDTO.php b/erp24/lib/yandex_market_api/Model/DeliveryServiceDTO.php index 4af5f626..9e0bec44 100644 --- a/erp24/lib/yandex_market_api/Model/DeliveryServiceDTO.php +++ b/erp24/lib/yandex_market_api/Model/DeliveryServiceDTO.php @@ -2,7 +2,7 @@ /** * DeliveryServiceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class DeliveryServiceDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -337,7 +337,7 @@ class DeliveryServiceDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets name * - * @param string|null $name Наименование службы доставки. + * @param string|null $name Название службы доставки. * * @return self */ @@ -353,11 +353,11 @@ class DeliveryServiceDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class DeliveryServiceDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class DeliveryServiceDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeliveryServiceInfoDTO.php b/erp24/lib/yandex_market_api/Model/DeliveryServiceInfoDTO.php index 86740936..725ab3b0 100644 --- a/erp24/lib/yandex_market_api/Model/DeliveryServiceInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/DeliveryServiceInfoDTO.php @@ -2,7 +2,7 @@ /** * DeliveryServiceInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class DeliveryServiceInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -343,7 +343,7 @@ class DeliveryServiceInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets name * - * @param string $name Наименование службы доставки. + * @param string $name Название службы доставки. * * @return self */ @@ -359,11 +359,11 @@ class DeliveryServiceInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class DeliveryServiceInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class DeliveryServiceInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DeliveryServicesDTO.php b/erp24/lib/yandex_market_api/Model/DeliveryServicesDTO.php index c7398fde..1cb079d2 100644 --- a/erp24/lib/yandex_market_api/Model/DeliveryServicesDTO.php +++ b/erp24/lib/yandex_market_api/Model/DeliveryServicesDTO.php @@ -2,7 +2,7 @@ /** * DeliveryServicesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class DeliveryServicesDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('delivery_service', $data ?? [], null); } @@ -322,11 +322,11 @@ class DeliveryServicesDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class DeliveryServicesDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class DeliveryServicesDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/DocumentDTO.php b/erp24/lib/yandex_market_api/Model/DocumentDTO.php index e5c3151f..dd2525f3 100644 --- a/erp24/lib/yandex_market_api/Model/DocumentDTO.php +++ b/erp24/lib/yandex_market_api/Model/DocumentDTO.php @@ -2,7 +2,7 @@ /** * DocumentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class DocumentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('number', $data ?? [], null); @@ -371,7 +371,7 @@ class DocumentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets date * - * @param \DateTime|null $date Дата создания документа. + * @param \DateTime|null $date Дата создания документа. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -387,11 +387,11 @@ class DocumentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class DocumentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class DocumentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/EacVerificationResultDTO.php b/erp24/lib/yandex_market_api/Model/EacVerificationResultDTO.php index 3349b260..3226dbe4 100644 --- a/erp24/lib/yandex_market_api/Model/EacVerificationResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/EacVerificationResultDTO.php @@ -2,7 +2,7 @@ /** * EacVerificationResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class EacVerificationResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('verification_result', $data ?? [], null); $this->setIfExists('attempts_left', $data ?? [], null); @@ -353,11 +353,11 @@ class EacVerificationResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class EacVerificationResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class EacVerificationResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/EacVerificationStatusType.php b/erp24/lib/yandex_market_api/Model/EacVerificationStatusType.php index 9df7ebab..210245f9 100644 --- a/erp24/lib/yandex_market_api/Model/EacVerificationStatusType.php +++ b/erp24/lib/yandex_market_api/Model/EacVerificationStatusType.php @@ -2,7 +2,7 @@ /** * EacVerificationStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/EmptyApiResponse.php b/erp24/lib/yandex_market_api/Model/EmptyApiResponse.php index c4890141..8c0f87e5 100644 --- a/erp24/lib/yandex_market_api/Model/EmptyApiResponse.php +++ b/erp24/lib/yandex_market_api/Model/EmptyApiResponse.php @@ -2,7 +2,7 @@ /** * EmptyApiResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); } @@ -275,6 +275,9 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -293,7 +296,7 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -303,7 +306,7 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -319,11 +322,11 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +334,12 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +364,11 @@ class EmptyApiResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/EnrichedMappingsOfferDTO.php b/erp24/lib/yandex_market_api/Model/EnrichedMappingsOfferDTO.php index 5afe69cc..8d191f5c 100644 --- a/erp24/lib/yandex_market_api/Model/EnrichedMappingsOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/EnrichedMappingsOfferDTO.php @@ -2,7 +2,7 @@ /** * EnrichedMappingsOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -91,7 +91,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri 'price' => 'float', 'market_category_id' => 'int', 'market_category_name' => 'string', - 'market_model_id' => 'int', 'market_model_name' => 'string', 'market_sku' => 'int', 'market_sku_name' => 'string' @@ -138,7 +137,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri 'price' => null, 'market_category_id' => 'int64', 'market_category_name' => null, - 'market_model_id' => 'int64', 'market_model_name' => null, 'market_sku' => 'int64', 'market_sku_name' => null @@ -183,7 +181,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri 'price' => false, 'market_category_id' => false, 'market_category_name' => false, - 'market_model_id' => false, 'market_model_name' => false, 'market_sku' => false, 'market_sku_name' => false @@ -308,7 +305,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri 'price' => 'price', 'market_category_id' => 'marketCategoryId', 'market_category_name' => 'marketCategoryName', - 'market_model_id' => 'marketModelId', 'market_model_name' => 'marketModelName', 'market_sku' => 'marketSku', 'market_sku_name' => 'marketSkuName' @@ -353,7 +349,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri 'price' => 'setPrice', 'market_category_id' => 'setMarketCategoryId', 'market_category_name' => 'setMarketCategoryName', - 'market_model_id' => 'setMarketModelId', 'market_model_name' => 'setMarketModelName', 'market_sku' => 'setMarketSku', 'market_sku_name' => 'setMarketSkuName' @@ -398,7 +393,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri 'price' => 'getPrice', 'market_category_id' => 'getMarketCategoryId', 'market_category_name' => 'getMarketCategoryName', - 'market_model_id' => 'getMarketModelId', 'market_model_name' => 'getMarketModelName', 'market_sku' => 'getMarketSku', 'market_sku_name' => 'getMarketSkuName' @@ -456,10 +450,10 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('shop_sku', $data ?? [], null); @@ -494,7 +488,6 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setIfExists('price', $data ?? [], null); $this->setIfExists('market_category_id', $data ?? [], null); $this->setIfExists('market_category_name', $data ?? [], null); - $this->setIfExists('market_model_id', $data ?? [], null); $this->setIfExists('market_model_name', $data ?? [], null); $this->setIfExists('market_sku', $data ?? [], null); $this->setIfExists('market_sku_name', $data ?? [], null); @@ -539,8 +532,8 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { @@ -555,8 +548,40 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { - $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { + $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['urls']) && (count($this->container['urls']) < 1)) { + $invalidProperties[] = "invalid value for 'urls', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) > 30)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be less than or equal to 30."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) > 5)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be less than or equal to 5."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['customs_commodity_codes']) && (count($this->container['customs_commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'customs_commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['supply_schedule_days']) && (count($this->container['supply_schedule_days']) < 1)) { + $invalidProperties[] = "invalid value for 'supply_schedule_days', number of items must be greater than or equal to 1."; } if (!is_null($this->container['market_sku']) && ($this->container['market_sku'] < 1)) { @@ -622,7 +647,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -637,8 +662,8 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling EnrichedMappingsOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling EnrichedMappingsOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling EnrichedMappingsOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -650,6 +675,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -659,9 +685,10 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -740,7 +767,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                          , \\

                          и так далее — для заголовков; * \\
                          и \\

                          — для переноса строки; * \\

                            — для нумерованного списка; * \\
                              — для маркированного списка; * \\
                            • — для создания элементов списка (должен находиться внутри \\
                                или \\
                                  ); * \\
                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                  , \\

                                  и так далее — для заголовков; * \\
                                  и \\

                                  — для переноса строки; * \\

                                    — для нумерованного списка; * \\
                                      — для маркированного списка; * \\
                                    • — для создания элементов списка (должен находиться внутри \\
                                        или \\
                                          ); * \\
                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -771,7 +798,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets id * - * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -786,8 +813,8 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri if ((mb_strlen($id) < 1)) { throw new \InvalidArgumentException('invalid length for $id when calling EnrichedMappingsOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { - throw new \InvalidArgumentException("invalid value for \$id when calling EnrichedMappingsOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling EnrichedMappingsOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['id'] = $id; @@ -835,7 +862,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -851,6 +878,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling EnrichedMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -869,7 +901,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets urls * - * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр url. + * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр `url`. * * @return self */ @@ -885,6 +917,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($urls) && (count($urls) < 1)) { + throw new \InvalidArgumentException('invalid length for $urls when calling EnrichedMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['urls'] = $urls; return $this; @@ -903,7 +940,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets pictures * - * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. Обязательный параметр. Должен содержать хотя бы один вложенный параметр `picture`. + * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. * * @return self */ @@ -919,6 +956,13 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($pictures) && (count($pictures) > 30)) { + throw new \InvalidArgumentException('invalid value for $pictures when calling EnrichedMappingsOfferDTO., number of items must be less than or equal to 30.'); + } + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling EnrichedMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -980,6 +1024,13 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) > 5)) { + throw new \InvalidArgumentException('invalid value for $manufacturer_countries when calling EnrichedMappingsOfferDTO., number of items must be less than or equal to 5.'); + } + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling EnrichedMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -1043,6 +1094,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri * Gets quantum_of_supply * * @return int|null + * @deprecated */ public function getQuantumOfSupply() { @@ -1052,9 +1104,10 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets quantum_of_supply * - * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству minShipment. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. + * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству `minShipment`. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. * * @return self + * @deprecated */ public function setQuantumOfSupply($quantum_of_supply) { @@ -1149,6 +1202,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($customs_commodity_codes) && (count($customs_commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $customs_commodity_codes when calling EnrichedMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['customs_commodity_codes'] = $customs_commodity_codes; return $this; @@ -1210,6 +1268,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($supply_schedule_days) && (count($supply_schedule_days) < 1)) { + throw new \InvalidArgumentException('invalid length for $supply_schedule_days when calling EnrichedMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['supply_schedule_days'] = $supply_schedule_days; return $this; @@ -1219,6 +1282,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri * Gets shelf_life_days * * @return int|null + * @deprecated */ public function getShelfLifeDays() { @@ -1228,9 +1292,10 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets shelf_life_days * - * @param int|null $shelf_life_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. + * @param int|null $shelf_life_days {% note warning \"Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. * * @return self + * @deprecated */ public function setShelfLifeDays($shelf_life_days) { @@ -1246,6 +1311,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri * Gets life_time_days * * @return int|null + * @deprecated */ public function getLifeTimeDays() { @@ -1255,9 +1321,10 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets life_time_days * - * @param int|null $life_time_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. + * @param int|null $life_time_days {% note warning \"Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. * * @return self + * @deprecated */ public function setLifeTimeDays($life_time_days) { @@ -1471,7 +1538,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets price * - * @param float|null $price Цена на товар в рублях. + * @param float|null $price Цена товара. * * @return self */ @@ -1498,7 +1565,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets market_category_id * - * @param int|null $market_category_id Идентификатор категории для рекомендованной карточки товара на Маркете. Возвращается только вместе с параметром ##marketSku##. + * @param int|null $market_category_id Идентификатор категории для рекомендованной карточки товара на Маркете. Возвращается только вместе с параметром `marketSku`. * * @return self */ @@ -1539,37 +1606,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri return $this; } - /** - * Gets market_model_id - * - * @return int|null - */ - public function getMarketModelId() - { - return $this->container['market_model_id']; - } - - /** - * Sets market_model_id - * - * @param int|null $market_model_id Идентификатор модели для рекомендованной карточки товара на Маркете. Может отсутствовать в ответе. - * - * @return self - */ - public function setMarketModelId($market_model_id) - { - if (is_null($market_model_id)) { - throw new \InvalidArgumentException('non-nullable market_model_id cannot be null'); - } - $this->container['market_model_id'] = $market_model_id; - - return $this; - } - /** * Gets market_model_name * * @return string|null + * @deprecated */ public function getMarketModelName() { @@ -1582,6 +1623,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri * @param string|null $market_model_name Название модели для рекомендованной карточки товара на Маркете. Возвращается только вместе с параметром ##marketSku##. * * @return self + * @deprecated */ public function setMarketModelName($market_model_name) { @@ -1606,7 +1648,7 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -1654,11 +1696,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1666,12 +1708,12 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1696,11 +1738,11 @@ class EnrichedMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/EnrichedOrderBoxLayoutDTO.php b/erp24/lib/yandex_market_api/Model/EnrichedOrderBoxLayoutDTO.php index d39d09bd..d2526a17 100644 --- a/erp24/lib/yandex_market_api/Model/EnrichedOrderBoxLayoutDTO.php +++ b/erp24/lib/yandex_market_api/Model/EnrichedOrderBoxLayoutDTO.php @@ -2,7 +2,7 @@ /** * EnrichedOrderBoxLayoutDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class EnrichedOrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('items', $data ?? [], null); $this->setIfExists('box_id', $data ?? [], null); @@ -365,11 +365,11 @@ class EnrichedOrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -377,12 +377,12 @@ class EnrichedOrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -407,11 +407,11 @@ class EnrichedOrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ExtensionShipmentDTO.php b/erp24/lib/yandex_market_api/Model/ExtensionShipmentDTO.php index 57eb9825..a18120d6 100644 --- a/erp24/lib/yandex_market_api/Model/ExtensionShipmentDTO.php +++ b/erp24/lib/yandex_market_api/Model/ExtensionShipmentDTO.php @@ -2,7 +2,7 @@ /** * ExtensionShipmentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ExtensionShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('current_status', $data ?? [], null); $this->setIfExists('available_actions', $data ?? [], null); @@ -358,11 +358,11 @@ class ExtensionShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ class ExtensionShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ class ExtensionShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/FeedbackReactionStatusType.php b/erp24/lib/yandex_market_api/Model/FeedbackReactionStatusType.php index d91befa9..9e60ca20 100644 --- a/erp24/lib/yandex_market_api/Model/FeedbackReactionStatusType.php +++ b/erp24/lib/yandex_market_api/Model/FeedbackReactionStatusType.php @@ -2,7 +2,7 @@ /** * FeedbackReactionStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/FlippingPagerDTO.php b/erp24/lib/yandex_market_api/Model/FlippingPagerDTO.php index 2c5b8aac..4656f05b 100644 --- a/erp24/lib/yandex_market_api/Model/FlippingPagerDTO.php +++ b/erp24/lib/yandex_market_api/Model/FlippingPagerDTO.php @@ -2,7 +2,7 @@ /** * FlippingPagerDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class FlippingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('total', $data ?? [], null); $this->setIfExists('from', $data ?? [], null); @@ -489,11 +489,11 @@ class FlippingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -501,12 +501,12 @@ class FlippingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -531,11 +531,11 @@ class FlippingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ForwardScrollingPagerDTO.php b/erp24/lib/yandex_market_api/Model/ForwardScrollingPagerDTO.php index 520230c5..374d6723 100644 --- a/erp24/lib/yandex_market_api/Model/ForwardScrollingPagerDTO.php +++ b/erp24/lib/yandex_market_api/Model/ForwardScrollingPagerDTO.php @@ -2,7 +2,7 @@ /** * ForwardScrollingPagerDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * ForwardScrollingPagerDTO Class Doc Comment * * @category Class - * @description Ссылка на следующую страницу. + * @description Идентификатор следующей страницы. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -240,10 +240,10 @@ class ForwardScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('next_page_token', $data ?? [], null); } @@ -319,11 +319,11 @@ class ForwardScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class ForwardScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class ForwardScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/FulfillmentWarehouseDTO.php b/erp24/lib/yandex_market_api/Model/FulfillmentWarehouseDTO.php index ea56098c..ade21b83 100644 --- a/erp24/lib/yandex_market_api/Model/FulfillmentWarehouseDTO.php +++ b/erp24/lib/yandex_market_api/Model/FulfillmentWarehouseDTO.php @@ -2,7 +2,7 @@ /** * FulfillmentWarehouseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class FulfillmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -393,11 +393,11 @@ class FulfillmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +405,12 @@ class FulfillmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +435,11 @@ class FulfillmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/FulfillmentWarehousesDTO.php b/erp24/lib/yandex_market_api/Model/FulfillmentWarehousesDTO.php index 0c5c1540..bbf59e6d 100644 --- a/erp24/lib/yandex_market_api/Model/FulfillmentWarehousesDTO.php +++ b/erp24/lib/yandex_market_api/Model/FulfillmentWarehousesDTO.php @@ -2,7 +2,7 @@ /** * FulfillmentWarehousesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class FulfillmentWarehousesDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('warehouses', $data ?? [], null); } @@ -322,11 +322,11 @@ class FulfillmentWarehousesDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class FulfillmentWarehousesDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class FulfillmentWarehousesDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/FullOutletDTO.php b/erp24/lib/yandex_market_api/Model/FullOutletDTO.php index da9f26f0..0e4c4716 100644 --- a/erp24/lib/yandex_market_api/Model/FullOutletDTO.php +++ b/erp24/lib/yandex_market_api/Model/FullOutletDTO.php @@ -2,7 +2,7 @@ /** * FullOutletDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -336,10 +336,10 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -406,6 +406,10 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['working_schedule'] === null) { $invalidProperties[] = "'working_schedule' can't be null"; } + if (!is_null($this->container['delivery_rules']) && (count($this->container['delivery_rules']) < 1)) { + $invalidProperties[] = "invalid value for 'delivery_rules', number of items must be greater than or equal to 1."; + } + if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } @@ -626,7 +630,7 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets phones * - * @param string[] $phones Номера телефонов точки продаж. Передавайте в формате: `+7 (999) 999-99-99`. + * @param string[] $phones Номера телефонов точки продаж. Передавайте номер в формате: `+<код страны>(<код города>)<номер>[#<добавочный>]`. Примеры: - `+7 (999) 999-99-99` - `+7 (999) 999-99-99#1234` * * @return self */ @@ -701,6 +705,11 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($delivery_rules) && (count($delivery_rules) < 1)) { + throw new \InvalidArgumentException('invalid length for $delivery_rules when calling FullOutletDTO., number of items must be greater than or equal to 1.'); + } $this->container['delivery_rules'] = $delivery_rules; return $this; @@ -818,6 +827,7 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets shop_outlet_id * * @return string|null + * @deprecated */ public function getShopOutletId() { @@ -827,9 +837,10 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets shop_outlet_id * - * @param string|null $shop_outlet_id Идентификатор точки продаж, заданный магазином. + * @param string|null $shop_outlet_id {% note warning \"Вместо него используйте `shopOutletCode`.\" %}   {% endnote %} Идентификатор точки продаж, заданный магазином. * * @return self + * @deprecated */ public function setShopOutletId($shop_outlet_id) { @@ -845,6 +856,7 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets working_time * * @return string|null + * @deprecated */ public function getWorkingTime() { @@ -854,9 +866,10 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets working_time * - * @param string|null $working_time Рабочее время. + * @param string|null $working_time {% note warning \"Вместо него используйте `workingSchedule`.\" %}   {% endnote %} Рабочее время. * * @return self + * @deprecated */ public function setWorkingTime($working_time) { @@ -897,11 +910,11 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -909,12 +922,12 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -939,11 +952,11 @@ class FullOutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/FullOutletLicenseDTO.php b/erp24/lib/yandex_market_api/Model/FullOutletLicenseDTO.php index b17f2b69..e6a6daed 100644 --- a/erp24/lib/yandex_market_api/Model/FullOutletLicenseDTO.php +++ b/erp24/lib/yandex_market_api/Model/FullOutletLicenseDTO.php @@ -2,7 +2,7 @@ /** * FullOutletLicenseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -282,10 +282,10 @@ class FullOutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('outlet_id', $data ?? [], null); @@ -371,7 +371,7 @@ class FullOutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets id * - * @param int|null $id Идентификатор лицензии. Параметр указывается, только если нужно изменить информацию о существующей лицензии. Ее идентификатор можно узнать с помощью запроса [GET campaigns/{campaignId}/outlets/licenses](../../reference/outlets/getOutletLicenses.md). При передаче информации о новой лицензии указывать идентификатор не нужно. Идентификатор лицензии присваивается Маркетом. Не путайте его с номером, указанным на лицензии: он передается в параметре `number`. + * @param int|null $id Идентификатор лицензии. Параметр указывается, только если нужно изменить информацию о существующей лицензии. Ее идентификатор можно узнать с помощью запроса [GET v2/campaigns/{campaignId}/outlets/licenses](../../reference/outlets/getOutletLicenses.md). При передаче информации о новой лицензии указывать идентификатор не нужно. Идентификатор лицензии присваивается Маркетом. Не путайте его с номером, указанным на лицензии: он передается в параметре `number`. * * @return self */ @@ -581,11 +581,11 @@ class FullOutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -593,12 +593,12 @@ class FullOutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -623,11 +623,11 @@ class FullOutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateBannersStatisticsRequest.php b/erp24/lib/yandex_market_api/Model/GenerateBannersStatisticsRequest.php new file mode 100644 index 00000000..4435d216 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateBannersStatisticsRequest.php @@ -0,0 +1,496 @@ + + */ +class GenerateBannersStatisticsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateBannersStatisticsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_id' => 'int', + 'date_from' => '\DateTime', + 'date_to' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_id' => 'int64', + 'date_from' => 'date', + 'date_to' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_id' => false, + 'date_from' => false, + 'date_to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_id' => 'businessId', + 'date_from' => 'dateFrom', + 'date_to' => 'dateTo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_id' => 'setBusinessId', + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_id' => 'getBusinessId', + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['business_id'] === null) { + $invalidProperties[] = "'business_id' can't be null"; + } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if ($this->container['date_from'] === null) { + $invalidProperties[] = "'date_from' can't be null"; + } + if ($this->container['date_to'] === null) { + $invalidProperties[] = "'date_to' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_id + * + * @return int + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateBannersStatisticsRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets date_from + * + * @return \DateTime + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + throw new \InvalidArgumentException('non-nullable date_from cannot be null'); + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + throw new \InvalidArgumentException('non-nullable date_to cannot be null'); + } + $this->container['date_to'] = $date_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateBarcodesReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateBarcodesReportRequest.php new file mode 100644 index 00000000..a86c74fd --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateBarcodesReportRequest.php @@ -0,0 +1,558 @@ + + */ +class GenerateBarcodesReportRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateBarcodesReportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'campaign_id' => 'int', + 'barcode_format' => '\OpenAPI\Client\Model\BarcodeFormatType', + 'barcode_offer_infos' => '\OpenAPI\Client\Model\BarcodeOfferInfoDTO[]', + 'supply_request_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'campaign_id' => 'int64', + 'barcode_format' => null, + 'barcode_offer_infos' => null, + 'supply_request_id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'campaign_id' => false, + 'barcode_format' => false, + 'barcode_offer_infos' => true, + 'supply_request_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaign_id' => 'campaignId', + 'barcode_format' => 'barcodeFormat', + 'barcode_offer_infos' => 'barcodeOfferInfos', + 'supply_request_id' => 'supplyRequestId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaign_id' => 'setCampaignId', + 'barcode_format' => 'setBarcodeFormat', + 'barcode_offer_infos' => 'setBarcodeOfferInfos', + 'supply_request_id' => 'setSupplyRequestId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaign_id' => 'getCampaignId', + 'barcode_format' => 'getBarcodeFormat', + 'barcode_offer_infos' => 'getBarcodeOfferInfos', + 'supply_request_id' => 'getSupplyRequestId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('barcode_format', $data ?? [], null); + $this->setIfExists('barcode_offer_infos', $data ?? [], null); + $this->setIfExists('supply_request_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaign_id'] === null) { + $invalidProperties[] = "'campaign_id' can't be null"; + } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if ($this->container['barcode_format'] === null) { + $invalidProperties[] = "'barcode_format' can't be null"; + } + if (!is_null($this->container['barcode_offer_infos']) && (count($this->container['barcode_offer_infos']) > 100)) { + $invalidProperties[] = "invalid value for 'barcode_offer_infos', number of items must be less than or equal to 100."; + } + + if (!is_null($this->container['barcode_offer_infos']) && (count($this->container['barcode_offer_infos']) < 1)) { + $invalidProperties[] = "invalid value for 'barcode_offer_infos', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['supply_request_id']) && ($this->container['supply_request_id'] < 1)) { + $invalidProperties[] = "invalid value for 'supply_request_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets campaign_id + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateBarcodesReportRequest., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets barcode_format + * + * @return \OpenAPI\Client\Model\BarcodeFormatType + */ + public function getBarcodeFormat() + { + return $this->container['barcode_format']; + } + + /** + * Sets barcode_format + * + * @param \OpenAPI\Client\Model\BarcodeFormatType $barcode_format barcode_format + * + * @return self + */ + public function setBarcodeFormat($barcode_format) + { + if (is_null($barcode_format)) { + throw new \InvalidArgumentException('non-nullable barcode_format cannot be null'); + } + $this->container['barcode_format'] = $barcode_format; + + return $this; + } + + /** + * Gets barcode_offer_infos + * + * @return \OpenAPI\Client\Model\BarcodeOfferInfoDTO[]|null + */ + public function getBarcodeOfferInfos() + { + return $this->container['barcode_offer_infos']; + } + + /** + * Sets barcode_offer_infos + * + * @param \OpenAPI\Client\Model\BarcodeOfferInfoDTO[]|null $barcode_offer_infos Список товаров. Передайте этот параметр и уникальные `offerId`, чтобы вернуть файл со штрихкодами конкретных товаров. В запросе обязательно должен быть либо `barcodeOfferInfos`, либо `supplyRequestId`, но не оба сразу. Если передается информация о товаре, у которого несколько штрихкодов, все штрихкоды будут добавлены в файл, их количество будет задано параметром `barcodeCount`. + * + * @return self + */ + public function setBarcodeOfferInfos($barcode_offer_infos) + { + if (is_null($barcode_offer_infos)) { + array_push($this->openAPINullablesSetToNull, 'barcode_offer_infos'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('barcode_offer_infos', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($barcode_offer_infos) && (count($barcode_offer_infos) > 100)) { + throw new \InvalidArgumentException('invalid value for $barcode_offer_infos when calling GenerateBarcodesReportRequest., number of items must be less than or equal to 100.'); + } + if (!is_null($barcode_offer_infos) && (count($barcode_offer_infos) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcode_offer_infos when calling GenerateBarcodesReportRequest., number of items must be greater than or equal to 1.'); + } + $this->container['barcode_offer_infos'] = $barcode_offer_infos; + + return $this; + } + + /** + * Gets supply_request_id + * + * @return int|null + */ + public function getSupplyRequestId() + { + return $this->container['supply_request_id']; + } + + /** + * Sets supply_request_id + * + * @param int|null $supply_request_id Идентификатор заявки. {% note warning \"Используется только в API\" %} По нему не получится найти заявки в кабинете продавца на Маркете. Для этого используйте `marketplaceRequestId` или `warehouseRequestId`. {% endnote %} + * + * @return self + */ + public function setSupplyRequestId($supply_request_id) + { + if (is_null($supply_request_id)) { + throw new \InvalidArgumentException('non-nullable supply_request_id cannot be null'); + } + + if (($supply_request_id < 1)) { + throw new \InvalidArgumentException('invalid value for $supply_request_id when calling GenerateBarcodesReportRequest., must be bigger than or equal to 1.'); + } + + $this->container['supply_request_id'] = $supply_request_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateBoostConsolidatedRequest.php b/erp24/lib/yandex_market_api/Model/GenerateBoostConsolidatedRequest.php index 3e854824..29fca827 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateBoostConsolidatedRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateBoostConsolidatedRequest.php @@ -2,7 +2,7 @@ /** * GenerateBoostConsolidatedRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('date_from', $data ?? [], null); @@ -292,6 +292,10 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + if ($this->container['date_from'] === null) { $invalidProperties[] = "'date_from' can't be null"; } @@ -326,7 +330,7 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -335,6 +339,11 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateBoostConsolidatedRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -353,7 +362,7 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Sets date_from * - * @param \DateTime $date_from Начало периода, включительно. + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -380,7 +389,7 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Sets date_to * - * @param \DateTime $date_to Конец периода, включительно. + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -396,11 +405,11 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +417,12 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +447,11 @@ class GenerateBoostConsolidatedRequest implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateClosureDocumentsDetalizationRequest.php b/erp24/lib/yandex_market_api/Model/GenerateClosureDocumentsDetalizationRequest.php new file mode 100644 index 00000000..d38b5b5a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateClosureDocumentsDetalizationRequest.php @@ -0,0 +1,496 @@ + + */ +class GenerateClosureDocumentsDetalizationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateClosureDocumentsDetalizationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'campaign_id' => 'int', + 'month_of_year' => '\OpenAPI\Client\Model\ClosureDocumentsMonthOfYearDTO', + 'contract_type' => '\OpenAPI\Client\Model\ClosureDocumentsContractType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'campaign_id' => 'int64', + 'month_of_year' => null, + 'contract_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'campaign_id' => false, + 'month_of_year' => false, + 'contract_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaign_id' => 'campaignId', + 'month_of_year' => 'monthOfYear', + 'contract_type' => 'contractType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaign_id' => 'setCampaignId', + 'month_of_year' => 'setMonthOfYear', + 'contract_type' => 'setContractType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaign_id' => 'getCampaignId', + 'month_of_year' => 'getMonthOfYear', + 'contract_type' => 'getContractType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('month_of_year', $data ?? [], null); + $this->setIfExists('contract_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaign_id'] === null) { + $invalidProperties[] = "'campaign_id' can't be null"; + } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if ($this->container['month_of_year'] === null) { + $invalidProperties[] = "'month_of_year' can't be null"; + } + if ($this->container['contract_type'] === null) { + $invalidProperties[] = "'contract_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets campaign_id + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateClosureDocumentsDetalizationRequest., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets month_of_year + * + * @return \OpenAPI\Client\Model\ClosureDocumentsMonthOfYearDTO + */ + public function getMonthOfYear() + { + return $this->container['month_of_year']; + } + + /** + * Sets month_of_year + * + * @param \OpenAPI\Client\Model\ClosureDocumentsMonthOfYearDTO $month_of_year month_of_year + * + * @return self + */ + public function setMonthOfYear($month_of_year) + { + if (is_null($month_of_year)) { + throw new \InvalidArgumentException('non-nullable month_of_year cannot be null'); + } + $this->container['month_of_year'] = $month_of_year; + + return $this; + } + + /** + * Gets contract_type + * + * @return \OpenAPI\Client\Model\ClosureDocumentsContractType + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param \OpenAPI\Client\Model\ClosureDocumentsContractType $contract_type contract_type + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + throw new \InvalidArgumentException('non-nullable contract_type cannot be null'); + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateClosureDocumentsRequest.php b/erp24/lib/yandex_market_api/Model/GenerateClosureDocumentsRequest.php new file mode 100644 index 00000000..119af1ce --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateClosureDocumentsRequest.php @@ -0,0 +1,515 @@ + + */ +class GenerateClosureDocumentsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateClosureDocumentsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'campaign_id' => 'int', + 'month_of_year' => '\OpenAPI\Client\Model\ClosureDocumentsMonthOfYearDTO', + 'contract_types' => '\OpenAPI\Client\Model\ClosureDocumentsContractType[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'campaign_id' => 'int64', + 'month_of_year' => null, + 'contract_types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'campaign_id' => false, + 'month_of_year' => false, + 'contract_types' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaign_id' => 'campaignId', + 'month_of_year' => 'monthOfYear', + 'contract_types' => 'contractTypes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaign_id' => 'setCampaignId', + 'month_of_year' => 'setMonthOfYear', + 'contract_types' => 'setContractTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaign_id' => 'getCampaignId', + 'month_of_year' => 'getMonthOfYear', + 'contract_types' => 'getContractTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('month_of_year', $data ?? [], null); + $this->setIfExists('contract_types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaign_id'] === null) { + $invalidProperties[] = "'campaign_id' can't be null"; + } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if ($this->container['month_of_year'] === null) { + $invalidProperties[] = "'month_of_year' can't be null"; + } + if (!is_null($this->container['contract_types']) && (count($this->container['contract_types']) > 3)) { + $invalidProperties[] = "invalid value for 'contract_types', number of items must be less than or equal to 3."; + } + + if (!is_null($this->container['contract_types']) && (count($this->container['contract_types']) < 1)) { + $invalidProperties[] = "invalid value for 'contract_types', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets campaign_id + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateClosureDocumentsRequest., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets month_of_year + * + * @return \OpenAPI\Client\Model\ClosureDocumentsMonthOfYearDTO + */ + public function getMonthOfYear() + { + return $this->container['month_of_year']; + } + + /** + * Sets month_of_year + * + * @param \OpenAPI\Client\Model\ClosureDocumentsMonthOfYearDTO $month_of_year month_of_year + * + * @return self + */ + public function setMonthOfYear($month_of_year) + { + if (is_null($month_of_year)) { + throw new \InvalidArgumentException('non-nullable month_of_year cannot be null'); + } + $this->container['month_of_year'] = $month_of_year; + + return $this; + } + + /** + * Gets contract_types + * + * @return \OpenAPI\Client\Model\ClosureDocumentsContractType[]|null + */ + public function getContractTypes() + { + return $this->container['contract_types']; + } + + /** + * Sets contract_types + * + * @param \OpenAPI\Client\Model\ClosureDocumentsContractType[]|null $contract_types Типы договоров, по которым нужны закрывающие документы. Если их не указать, вернется архив с документами по всем найденным договорам. + * + * @return self + */ + public function setContractTypes($contract_types) + { + if (is_null($contract_types)) { + array_push($this->openAPINullablesSetToNull, 'contract_types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contract_types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($contract_types) && (count($contract_types) > 3)) { + throw new \InvalidArgumentException('invalid value for $contract_types when calling GenerateClosureDocumentsRequest., number of items must be less than or equal to 3.'); + } + if (!is_null($contract_types) && (count($contract_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $contract_types when calling GenerateClosureDocumentsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['contract_types'] = $contract_types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateCompetitorsPositionReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateCompetitorsPositionReportRequest.php index e54905e3..7306a001 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateCompetitorsPositionReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateCompetitorsPositionReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateCompetitorsPositionReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('category_id', $data ?? [], null); @@ -299,6 +299,10 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + if ($this->container['category_id'] === null) { $invalidProperties[] = "'category_id' can't be null"; } @@ -336,7 +340,7 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -345,6 +349,11 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateCompetitorsPositionReportRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -390,7 +399,7 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Sets date_from * - * @param \DateTime $date_from Начало периода, включительно. + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -417,7 +426,7 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Sets date_to * - * @param \DateTime $date_to Конец периода, включительно. + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -433,11 +442,11 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +454,12 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +484,11 @@ class GenerateCompetitorsPositionReportRequest implements ModelInterface, ArrayA /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateGoodsFeedbackRequest.php b/erp24/lib/yandex_market_api/Model/GenerateGoodsFeedbackRequest.php index d8bc3940..a7008978 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateGoodsFeedbackRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateGoodsFeedbackRequest.php @@ -2,7 +2,7 @@ /** * GenerateGoodsFeedbackRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); } @@ -278,6 +278,10 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -306,7 +310,7 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -315,6 +319,11 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateGoodsFeedbackRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -322,11 +331,11 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +343,12 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +373,11 @@ class GenerateGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateGoodsMovementReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateGoodsMovementReportRequest.php index 1ca60179..9b7d3d2c 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateGoodsMovementReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateGoodsMovementReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateGoodsMovementReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('date_from', $data ?? [], null); @@ -317,8 +317,8 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -349,7 +349,7 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -381,7 +381,7 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Sets date_from * - * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -408,7 +408,7 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Sets date_to * - * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -435,7 +435,7 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -450,8 +450,8 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling GenerateGoodsMovementReportRequest., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling GenerateGoodsMovementReportRequest., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling GenerateGoodsMovementReportRequest., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -461,11 +461,11 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -473,12 +473,12 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -503,11 +503,11 @@ class GenerateGoodsMovementReportRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateGoodsPricesReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateGoodsPricesReportRequest.php new file mode 100644 index 00000000..94fa2ec5 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateGoodsPricesReportRequest.php @@ -0,0 +1,512 @@ + + */ +class GenerateGoodsPricesReportRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateGoodsPricesReportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_id' => 'int', + 'category_ids' => 'int[]', + 'campaign_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_id' => 'int64', + 'category_ids' => 'int32', + 'campaign_id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_id' => false, + 'category_ids' => true, + 'campaign_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_id' => 'businessId', + 'category_ids' => 'categoryIds', + 'campaign_id' => 'campaignId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_id' => 'setBusinessId', + 'category_ids' => 'setCategoryIds', + 'campaign_id' => 'setCampaignId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_id' => 'getBusinessId', + 'category_ids' => 'getCategoryIds', + 'campaign_id' => 'getCampaignId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('category_ids', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['business_id']) && ($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaign_id']) && ($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_id + * + * @return int|null + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateGoodsPricesReportRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets category_ids + * + * @return int[]|null + */ + public function getCategoryIds() + { + return $this->container['category_ids']; + } + + /** + * Sets category_ids + * + * @param int[]|null $category_ids Фильтр по категориям на Маркете. + * + * @return self + */ + public function setCategoryIds($category_ids) + { + if (is_null($category_ids)) { + array_push($this->openAPINullablesSetToNull, 'category_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('category_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GenerateGoodsPricesReportRequest., number of items must be greater than or equal to 1.'); + } + $this->container['category_ids'] = $category_ids; + + return $this; + } + + /** + * Gets campaign_id + * + * @return int|null + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateGoodsPricesReportRequest., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateGoodsRealizationReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateGoodsRealizationReportRequest.php index be1fb6b7..0c127e6b 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateGoodsRealizationReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateGoodsRealizationReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateGoodsRealizationReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateGoodsRealizationReportRequest Class Doc Comment * * @category Class - * @description Данные, необходимые для генерации отчета: идентификатор магазина и период, за который нужен отчет. + * @description Данные, необходимые для генерации отчета: идентификатор кампании и период, за который нужен отчет. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -252,10 +252,10 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('year', $data ?? [], null); @@ -292,6 +292,10 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + if ($this->container['year'] === null) { $invalidProperties[] = "'year' can't be null"; } @@ -334,7 +338,7 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -343,6 +347,11 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateGoodsRealizationReportRequest., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -412,11 +421,11 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -424,12 +433,12 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -454,11 +463,11 @@ class GenerateGoodsRealizationReportRequest implements ModelInterface, ArrayAcce /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateGoodsTurnoverRequest.php b/erp24/lib/yandex_market_api/Model/GenerateGoodsTurnoverRequest.php index a62cc3fa..1816f4bf 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateGoodsTurnoverRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateGoodsTurnoverRequest.php @@ -2,7 +2,7 @@ /** * GenerateGoodsTurnoverRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('date', $data ?? [], null); @@ -285,6 +285,10 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -313,7 +317,7 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -322,6 +326,11 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateGoodsTurnoverRequest., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -340,7 +349,7 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json /** * Sets date * - * @param \DateTime|null $date Дата, за которую нужно рассчитать оборачиваемость. Если параметр не указан, используется текущая дата. + * @param \DateTime|null $date Дата, за которую нужно рассчитать оборачиваемость. Если параметр не указан, используется текущая дата. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -356,11 +365,11 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +377,12 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +407,11 @@ class GenerateGoodsTurnoverRequest implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateJewelryFiscalReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateJewelryFiscalReportRequest.php new file mode 100644 index 00000000..44dcc5ec --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateJewelryFiscalReportRequest.php @@ -0,0 +1,496 @@ + + */ +class GenerateJewelryFiscalReportRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateJewelryFiscalReportRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'campaign_id' => 'int', + 'date_from' => '\DateTime', + 'date_to' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'campaign_id' => 'int64', + 'date_from' => 'date', + 'date_to' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'campaign_id' => false, + 'date_from' => false, + 'date_to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaign_id' => 'campaignId', + 'date_from' => 'dateFrom', + 'date_to' => 'dateTo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaign_id' => 'setCampaignId', + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaign_id' => 'getCampaignId', + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaign_id'] === null) { + $invalidProperties[] = "'campaign_id' can't be null"; + } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if ($this->container['date_from'] === null) { + $invalidProperties[] = "'date_from' can't be null"; + } + if ($this->container['date_to'] === null) { + $invalidProperties[] = "'date_to' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets campaign_id + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateJewelryFiscalReportRequest., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets date_from + * + * @return \DateTime + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + throw new \InvalidArgumentException('non-nullable date_from cannot be null'); + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + throw new \InvalidArgumentException('non-nullable date_to cannot be null'); + } + $this->container['date_to'] = $date_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateKeyIndicatorsRequest.php b/erp24/lib/yandex_market_api/Model/GenerateKeyIndicatorsRequest.php new file mode 100644 index 00000000..a6ef2243 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateKeyIndicatorsRequest.php @@ -0,0 +1,499 @@ + + */ +class GenerateKeyIndicatorsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateKeyIndicatorsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_id' => 'int', + 'campaign_id' => 'int', + 'detalization_level' => '\OpenAPI\Client\Model\KeyIndicatorsReportDetalizationLevelType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_id' => 'int64', + 'campaign_id' => 'int64', + 'detalization_level' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_id' => false, + 'campaign_id' => false, + 'detalization_level' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_id' => 'businessId', + 'campaign_id' => 'campaignId', + 'detalization_level' => 'detalizationLevel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_id' => 'setBusinessId', + 'campaign_id' => 'setCampaignId', + 'detalization_level' => 'setDetalizationLevel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_id' => 'getBusinessId', + 'campaign_id' => 'getCampaignId', + 'detalization_level' => 'getDetalizationLevel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('detalization_level', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['business_id']) && ($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['campaign_id']) && ($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if ($this->container['detalization_level'] === null) { + $invalidProperties[] = "'detalization_level' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_id + * + * @return int|null + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateKeyIndicatorsRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets campaign_id + * + * @return int|null + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateKeyIndicatorsRequest., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets detalization_level + * + * @return \OpenAPI\Client\Model\KeyIndicatorsReportDetalizationLevelType + */ + public function getDetalizationLevel() + { + return $this->container['detalization_level']; + } + + /** + * Sets detalization_level + * + * @param \OpenAPI\Client\Model\KeyIndicatorsReportDetalizationLevelType $detalization_level detalization_level + * + * @return self + */ + public function setDetalizationLevel($detalization_level) + { + if (is_null($detalization_level)) { + throw new \InvalidArgumentException('non-nullable detalization_level cannot be null'); + } + $this->container['detalization_level'] = $detalization_level; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateMassOrderLabelsRequest.php b/erp24/lib/yandex_market_api/Model/GenerateMassOrderLabelsRequest.php index 53c79b34..d04b4965 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateMassOrderLabelsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateMassOrderLabelsRequest.php @@ -2,7 +2,7 @@ /** * GenerateMassOrderLabelsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('order_ids', $data ?? [], null); @@ -292,6 +292,10 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + if ($this->container['order_ids'] === null) { $invalidProperties[] = "'order_ids' can't be null"; } @@ -331,7 +335,7 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js /** * Sets business_id * - * @param int $business_id Идентификатор кабинета. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -340,6 +344,11 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateMassOrderLabelsRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -408,11 +417,11 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -420,12 +429,12 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -450,11 +459,11 @@ class GenerateMassOrderLabelsRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesRequest.php b/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesRequest.php new file mode 100644 index 00000000..01ce22b5 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesRequest.php @@ -0,0 +1,462 @@ + + */ +class GenerateOfferBarcodesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateOfferBarcodesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offer_ids' => 'string[]', + 'skip_if_exists' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offer_ids' => null, + 'skip_if_exists' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_ids' => false, + 'skip_if_exists' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offer_ids' => 'offerIds', + 'skip_if_exists' => 'skipIfExists' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offer_ids' => 'setOfferIds', + 'skip_if_exists' => 'setSkipIfExists' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offer_ids' => 'getOfferIds', + 'skip_if_exists' => 'getSkipIfExists' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offer_ids', $data ?? [], null); + $this->setIfExists('skip_if_exists', $data ?? [], true); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['offer_ids'] === null) { + $invalidProperties[] = "'offer_ids' can't be null"; + } + if ((count($this->container['offer_ids']) > 100)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 100."; + } + + if ((count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offer_ids + * + * @return string[] + */ + public function getOfferIds() + { + return $this->container['offer_ids']; + } + + /** + * Sets offer_ids + * + * @param string[] $offer_ids Список товаров, для которых нужно сгенерировать штрихкоды. + * + * @return self + */ + public function setOfferIds($offer_ids) + { + if (is_null($offer_ids)) { + throw new \InvalidArgumentException('non-nullable offer_ids cannot be null'); + } + + if ((count($offer_ids) > 100)) { + throw new \InvalidArgumentException('invalid value for $offer_ids when calling GenerateOfferBarcodesRequest., number of items must be less than or equal to 100.'); + } + if ((count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GenerateOfferBarcodesRequest., number of items must be greater than or equal to 1.'); + } + $this->container['offer_ids'] = $offer_ids; + + return $this; + } + + /** + * Gets skip_if_exists + * + * @return bool|null + */ + public function getSkipIfExists() + { + return $this->container['skip_if_exists']; + } + + /** + * Sets skip_if_exists + * + * @param bool|null $skip_if_exists Для каких товаров нужно сгенерировать штрихкоды: * `false` — для всех, которые переданы в запросе. * `true` — только для тех, у которых их нет. + * + * @return self + */ + public function setSkipIfExists($skip_if_exists) + { + if (is_null($skip_if_exists)) { + throw new \InvalidArgumentException('non-nullable skip_if_exists cannot be null'); + } + $this->container['skip_if_exists'] = $skip_if_exists; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesResponse.php b/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesResponse.php new file mode 100644 index 00000000..981a5071 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesResponse.php @@ -0,0 +1,447 @@ + + */ +class GenerateOfferBarcodesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateOfferBarcodesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\GenerateOfferBarcodesResultDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\GenerateOfferBarcodesResultDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\GenerateOfferBarcodesResultDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesResultDTO.php b/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesResultDTO.php new file mode 100644 index 00000000..fff72d9d --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateOfferBarcodesResultDTO.php @@ -0,0 +1,415 @@ + + */ +class GenerateOfferBarcodesResultDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateOfferBarcodesResultDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'unprocessed_offer_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'unprocessed_offer_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'unprocessed_offer_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'unprocessed_offer_ids' => 'unprocessedOfferIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'unprocessed_offer_ids' => 'setUnprocessedOfferIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'unprocessed_offer_ids' => 'getUnprocessedOfferIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('unprocessed_offer_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['unprocessed_offer_ids'] === null) { + $invalidProperties[] = "'unprocessed_offer_ids' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets unprocessed_offer_ids + * + * @return string[] + */ + public function getUnprocessedOfferIds() + { + return $this->container['unprocessed_offer_ids']; + } + + /** + * Sets unprocessed_offer_ids + * + * @param string[] $unprocessed_offer_ids Список товаров, для которых не удалось сгенерировать штрихкоды. + * + * @return self + */ + public function setUnprocessedOfferIds($unprocessed_offer_ids) + { + if (is_null($unprocessed_offer_ids)) { + throw new \InvalidArgumentException('non-nullable unprocessed_offer_ids cannot be null'); + } + + + $this->container['unprocessed_offer_ids'] = $unprocessed_offer_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GeneratePricesReportRequest.php b/erp24/lib/yandex_market_api/Model/GeneratePricesReportRequest.php index d4a51084..3514a2a1 100644 --- a/erp24/lib/yandex_market_api/Model/GeneratePricesReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GeneratePricesReportRequest.php @@ -2,7 +2,7 @@ /** * GeneratePricesReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -75,7 +75,7 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'business_id' => 'int64', 'campaign_id' => 'int64', - 'category_ids' => 'int64', + 'category_ids' => 'int32', 'creation_date_from' => 'date', 'creation_date_to' => 'date' ]; @@ -264,10 +264,10 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('campaign_id', $data ?? [], null); @@ -303,6 +303,18 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; + if (!is_null($this->container['business_id']) && ($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['campaign_id']) && ($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -331,7 +343,7 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets business_id * - * @param int|null $business_id Идентификатор бизнеса. В большинстве случаев обязателен. Не указывается, если задан `campaignId`. + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -340,6 +352,11 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GeneratePricesReportRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -358,7 +375,7 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets campaign_id * - * @param int|null $campaign_id Идентификатор кампании. Как правило, не используется. Передавайте только если в кабинете есть магазины с уникальными ценами и вы хотите получить отчет для них. В этом случае передавать `businessId` не нужно. + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -367,6 +384,11 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GeneratePricesReportRequest., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -401,6 +423,11 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GeneratePricesReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['category_ids'] = $category_ids; return $this; @@ -419,7 +446,7 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets creation_date_from * - * @param \DateTime|null $creation_date_from Фильтр по времени появления предложения — начало периода. Формат даты: `ДД-ММ-ГГГГ`. + * @param \DateTime|null $creation_date_from Фильтр по времени добавления первой информации о товаре — начало периода. Формат даты: `ДД-ММ-ГГГГ`. * * @return self */ @@ -446,7 +473,7 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets creation_date_to * - * @param \DateTime|null $creation_date_to Фильтр по времени появления предложения — окончание периода. Формат даты: `ДД-ММ-ГГГГ`. + * @param \DateTime|null $creation_date_to Фильтр по времени добавления первой информации о товаре — окончание периода. Формат даты: `ДД-ММ-ГГГГ`. * * @return self */ @@ -462,11 +489,11 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -474,12 +501,12 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -504,11 +531,11 @@ class GeneratePricesReportRequest implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateReportDTO.php b/erp24/lib/yandex_market_api/Model/GenerateReportDTO.php index fb762b27..afc0e50c 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateReportDTO.php +++ b/erp24/lib/yandex_market_api/Model/GenerateReportDTO.php @@ -2,7 +2,7 @@ /** * GenerateReportDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateReportDTO Class Doc Comment * * @category Class - * @description Идентификатор, который понадобится для отслеживания статуса генерации и получения готового отчета. + * @description Идентификатор, который понадобится для отслеживания статуса генерации и получения готового отчета или документа. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class GenerateReportDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('report_id', $data ?? [], null); $this->setIfExists('estimated_generation_time', $data ?? [], null); @@ -316,7 +316,7 @@ class GenerateReportDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets report_id * - * @param string $report_id Идентификатор, который понадобится для отслеживания статуса генерации и получения готового отчета. + * @param string $report_id Идентификатор, который понадобится для отслеживания статуса генерации и получения готового отчета или документа. * * @return self */ @@ -359,11 +359,11 @@ class GenerateReportDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class GenerateReportDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class GenerateReportDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateReportResponse.php b/erp24/lib/yandex_market_api/Model/GenerateReportResponse.php index 7088d8bb..13281043 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateReportResponse.php +++ b/erp24/lib/yandex_market_api/Model/GenerateReportResponse.php @@ -2,7 +2,7 @@ /** * GenerateReportResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateReportResponse Class Doc Comment * * @category Class - * @description Ответ на запрос генерации отчета. + * @description Ответ на запрос генерации отчета или документа. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GenerateReportResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateSalesGeographyRequest.php b/erp24/lib/yandex_market_api/Model/GenerateSalesGeographyRequest.php new file mode 100644 index 00000000..b6de919f --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateSalesGeographyRequest.php @@ -0,0 +1,608 @@ + + */ +class GenerateSalesGeographyRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateSalesGeographyRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_id' => 'int', + 'date_from' => '\DateTime', + 'date_to' => '\DateTime', + 'category_ids' => 'int[]', + 'offer_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_id' => 'int64', + 'date_from' => 'date', + 'date_to' => 'date', + 'category_ids' => 'int32', + 'offer_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_id' => false, + 'date_from' => false, + 'date_to' => false, + 'category_ids' => true, + 'offer_ids' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_id' => 'businessId', + 'date_from' => 'dateFrom', + 'date_to' => 'dateTo', + 'category_ids' => 'categoryIds', + 'offer_ids' => 'offerIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_id' => 'setBusinessId', + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo', + 'category_ids' => 'setCategoryIds', + 'offer_ids' => 'setOfferIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_id' => 'getBusinessId', + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo', + 'category_ids' => 'getCategoryIds', + 'offer_ids' => 'getOfferIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + $this->setIfExists('category_ids', $data ?? [], null); + $this->setIfExists('offer_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['business_id'] === null) { + $invalidProperties[] = "'business_id' can't be null"; + } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if ($this->container['date_from'] === null) { + $invalidProperties[] = "'date_from' can't be null"; + } + if ($this->container['date_to'] === null) { + $invalidProperties[] = "'date_to' can't be null"; + } + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) > 1000)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be less than or equal to 1000."; + } + + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) > 1000)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 1000."; + } + + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_id + * + * @return int + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateSalesGeographyRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets date_from + * + * @return \DateTime + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + throw new \InvalidArgumentException('non-nullable date_from cannot be null'); + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + throw new \InvalidArgumentException('non-nullable date_to cannot be null'); + } + $this->container['date_to'] = $date_to; + + return $this; + } + + /** + * Gets category_ids + * + * @return int[]|null + */ + public function getCategoryIds() + { + return $this->container['category_ids']; + } + + /** + * Sets category_ids + * + * @param int[]|null $category_ids Идентификаторы категорий. + * + * @return self + */ + public function setCategoryIds($category_ids) + { + if (is_null($category_ids)) { + array_push($this->openAPINullablesSetToNull, 'category_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('category_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($category_ids) && (count($category_ids) > 1000)) { + throw new \InvalidArgumentException('invalid value for $category_ids when calling GenerateSalesGeographyRequest., number of items must be less than or equal to 1000.'); + } + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GenerateSalesGeographyRequest., number of items must be greater than or equal to 1.'); + } + $this->container['category_ids'] = $category_ids; + + return $this; + } + + /** + * Gets offer_ids + * + * @return string[]|null + */ + public function getOfferIds() + { + return $this->container['offer_ids']; + } + + /** + * Sets offer_ids + * + * @param string[]|null $offer_ids Идентификаторы товаров. + * + * @return self + */ + public function setOfferIds($offer_ids) + { + if (is_null($offer_ids)) { + array_push($this->openAPINullablesSetToNull, 'offer_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('offer_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($offer_ids) && (count($offer_ids) > 1000)) { + throw new \InvalidArgumentException('invalid value for $offer_ids when calling GenerateSalesGeographyRequest., number of items must be less than or equal to 1000.'); + } + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GenerateSalesGeographyRequest., number of items must be greater than or equal to 1.'); + } + $this->container['offer_ids'] = $offer_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateShelfsStatisticsRequest.php b/erp24/lib/yandex_market_api/Model/GenerateShelfsStatisticsRequest.php index c75c286d..e28af739 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateShelfsStatisticsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateShelfsStatisticsRequest.php @@ -2,7 +2,7 @@ /** * GenerateShelfsStatisticsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -61,7 +61,7 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J 'business_id' => 'int', 'date_from' => '\DateTime', 'date_to' => '\DateTime', - 'attribution_type' => '\OpenAPI\Client\Model\ShelfsStatisticsAttributionType' + 'attribution_type' => '\OpenAPI\Client\Model\StatisticsAttributionType' ]; /** @@ -258,10 +258,10 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('date_from', $data ?? [], null); @@ -299,6 +299,10 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + if ($this->container['date_from'] === null) { $invalidProperties[] = "'date_from' can't be null"; } @@ -336,7 +340,7 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -345,6 +349,11 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateShelfsStatisticsRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -407,7 +416,7 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Gets attribution_type * - * @return \OpenAPI\Client\Model\ShelfsStatisticsAttributionType + * @return \OpenAPI\Client\Model\StatisticsAttributionType */ public function getAttributionType() { @@ -417,7 +426,7 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Sets attribution_type * - * @param \OpenAPI\Client\Model\ShelfsStatisticsAttributionType $attribution_type attribution_type + * @param \OpenAPI\Client\Model\StatisticsAttributionType $attribution_type attribution_type * * @return self */ @@ -433,11 +442,11 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +454,12 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +484,11 @@ class GenerateShelfsStatisticsRequest implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateShipmentListDocumentReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateShipmentListDocumentReportRequest.php index c96dcc2e..30b23ee1 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateShipmentListDocumentReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateShipmentListDocumentReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateShipmentListDocumentReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('shipment_id', $data ?? [], null); @@ -292,6 +292,14 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['order_ids']) && (count($this->container['order_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'order_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -320,7 +328,7 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -329,6 +337,11 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateShipmentListDocumentReportRequest., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -347,7 +360,7 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Sets shipment_id * - * @param int|null $shipment_id Идентификатор отгрузки. + * @param int|null $shipment_id Идентификатор отгрузки. В запросе обязательно передавайте `shipmentId` или `orderIds`. * * @return self */ @@ -374,7 +387,7 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Sets order_ids * - * @param int[]|null $order_ids Фильтр по идентификаторам заказа в отгрузке. + * @param int[]|null $order_ids Фильтр по идентификаторам заказа в отгрузке. В запросе обязательно передавайте `shipmentId` или `orderIds`. * * @return self */ @@ -390,6 +403,11 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($order_ids) && (count($order_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $order_ids when calling GenerateShipmentListDocumentReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['order_ids'] = $order_ids; return $this; @@ -397,11 +415,11 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -409,12 +427,12 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -439,11 +457,11 @@ class GenerateShipmentListDocumentReportRequest implements ModelInterface, Array /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateShowsBoostRequest.php b/erp24/lib/yandex_market_api/Model/GenerateShowsBoostRequest.php new file mode 100644 index 00000000..026f7d00 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateShowsBoostRequest.php @@ -0,0 +1,533 @@ + + */ +class GenerateShowsBoostRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateShowsBoostRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_id' => 'int', + 'date_from' => '\DateTime', + 'date_to' => '\DateTime', + 'attribution_type' => '\OpenAPI\Client\Model\StatisticsAttributionType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_id' => 'int64', + 'date_from' => 'date', + 'date_to' => 'date', + 'attribution_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_id' => false, + 'date_from' => false, + 'date_to' => false, + 'attribution_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_id' => 'businessId', + 'date_from' => 'dateFrom', + 'date_to' => 'dateTo', + 'attribution_type' => 'attributionType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_id' => 'setBusinessId', + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo', + 'attribution_type' => 'setAttributionType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_id' => 'getBusinessId', + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo', + 'attribution_type' => 'getAttributionType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + $this->setIfExists('attribution_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['business_id'] === null) { + $invalidProperties[] = "'business_id' can't be null"; + } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if ($this->container['date_from'] === null) { + $invalidProperties[] = "'date_from' can't be null"; + } + if ($this->container['date_to'] === null) { + $invalidProperties[] = "'date_to' can't be null"; + } + if ($this->container['attribution_type'] === null) { + $invalidProperties[] = "'attribution_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_id + * + * @return int + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateShowsBoostRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets date_from + * + * @return \DateTime + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + throw new \InvalidArgumentException('non-nullable date_from cannot be null'); + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + throw new \InvalidArgumentException('non-nullable date_to cannot be null'); + } + $this->container['date_to'] = $date_to; + + return $this; + } + + /** + * Gets attribution_type + * + * @return \OpenAPI\Client\Model\StatisticsAttributionType + */ + public function getAttributionType() + { + return $this->container['attribution_type']; + } + + /** + * Sets attribution_type + * + * @param \OpenAPI\Client\Model\StatisticsAttributionType $attribution_type attribution_type + * + * @return self + */ + public function setAttributionType($attribution_type) + { + if (is_null($attribution_type)) { + throw new \InvalidArgumentException('non-nullable attribution_type cannot be null'); + } + $this->container['attribution_type'] = $attribution_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GenerateShowsSalesReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateShowsSalesReportRequest.php index 5d746a83..51573080 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateShowsSalesReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateShowsSalesReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateShowsSalesReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateShowsSalesReportRequest Class Doc Comment * * @category Class - * @description Данные, необходимые для генерации отчета. + * @description Данные, необходимые для генерации отчета. В запросе обязательно должен быть либо `businessId`, либо `campaignId`, но не оба сразу. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -264,10 +264,10 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('campaign_id', $data ?? [], null); @@ -303,6 +303,14 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J { $invalidProperties = []; + if (!is_null($this->container['business_id']) && ($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['campaign_id']) && ($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + if ($this->container['date_from'] === null) { $invalidProperties[] = "'date_from' can't be null"; } @@ -340,7 +348,7 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Sets business_id * - * @param int|null $business_id Идентификатор бизнеса. Указывается, если нужно составить отчет по всем магазинам бизнеса. В запросе обязательно должен быть либо `businessID`, либо `campaignId`, но не оба сразу. + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -349,6 +357,11 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateShowsSalesReportRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -367,7 +380,7 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Sets campaign_id * - * @param int|null $campaign_id Идентификатор кампании. Указывается, если нужно составить отчет по конкретному магазину. В запросе обязательно должен быть либо `businessID`, либо `campaignId`, но не оба сразу. + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -376,6 +389,11 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateShowsSalesReportRequest., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -394,7 +412,7 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Sets date_from * - * @param \DateTime $date_from Начало периода, включительно. + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -421,7 +439,7 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Sets date_to * - * @param \DateTime $date_to Конец периода, включительно. + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -464,11 +482,11 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -476,12 +494,12 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -506,11 +524,11 @@ class GenerateShowsSalesReportRequest implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateStocksOnWarehousesReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateStocksOnWarehousesReportRequest.php index 315146dd..32b36550 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateStocksOnWarehousesReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateStocksOnWarehousesReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateStocksOnWarehousesReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateStocksOnWarehousesReportRequest Class Doc Comment * * @category Class - * @description Данные, необходимые для генерации отчета. + * @description Данные, необходимые для генерации отчета. Передавайте либо `businessId`, либо `campaignId`/`campaignIds`, но не все сразу. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -59,10 +59,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc */ protected static $openAPITypes = [ 'campaign_id' => 'int', + 'business_id' => 'int', 'warehouse_ids' => 'int[]', 'report_date' => '\DateTime', 'category_ids' => 'int[]', - 'has_stocks' => 'bool' + 'has_stocks' => 'bool', + 'campaign_ids' => 'int[]' ]; /** @@ -74,10 +76,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc */ protected static $openAPIFormats = [ 'campaign_id' => 'int64', + 'business_id' => 'int64', 'warehouse_ids' => 'int64', 'report_date' => 'date', - 'category_ids' => 'int64', - 'has_stocks' => null + 'category_ids' => 'int32', + 'has_stocks' => null, + 'campaign_ids' => 'int64' ]; /** @@ -87,10 +91,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc */ protected static array $openAPINullables = [ 'campaign_id' => false, + 'business_id' => false, 'warehouse_ids' => true, 'report_date' => false, 'category_ids' => true, - 'has_stocks' => false + 'has_stocks' => false, + 'campaign_ids' => true ]; /** @@ -180,10 +186,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc */ protected static $attributeMap = [ 'campaign_id' => 'campaignId', + 'business_id' => 'businessId', 'warehouse_ids' => 'warehouseIds', 'report_date' => 'reportDate', 'category_ids' => 'categoryIds', - 'has_stocks' => 'hasStocks' + 'has_stocks' => 'hasStocks', + 'campaign_ids' => 'campaignIds' ]; /** @@ -193,10 +201,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc */ protected static $setters = [ 'campaign_id' => 'setCampaignId', + 'business_id' => 'setBusinessId', 'warehouse_ids' => 'setWarehouseIds', 'report_date' => 'setReportDate', 'category_ids' => 'setCategoryIds', - 'has_stocks' => 'setHasStocks' + 'has_stocks' => 'setHasStocks', + 'campaign_ids' => 'setCampaignIds' ]; /** @@ -206,10 +216,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc */ protected static $getters = [ 'campaign_id' => 'getCampaignId', + 'business_id' => 'getBusinessId', 'warehouse_ids' => 'getWarehouseIds', 'report_date' => 'getReportDate', 'category_ids' => 'getCategoryIds', - 'has_stocks' => 'getHasStocks' + 'has_stocks' => 'getHasStocks', + 'campaign_ids' => 'getCampaignIds' ]; /** @@ -264,16 +276,18 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('warehouse_ids', $data ?? [], null); $this->setIfExists('report_date', $data ?? [], null); $this->setIfExists('category_ids', $data ?? [], null); $this->setIfExists('has_stocks', $data ?? [], null); + $this->setIfExists('campaign_ids', $data ?? [], null); } /** @@ -303,9 +317,26 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc { $invalidProperties = []; - if ($this->container['campaign_id'] === null) { - $invalidProperties[] = "'campaign_id' can't be null"; + if (!is_null($this->container['campaign_id']) && ($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; } + + if (!is_null($this->container['business_id']) && ($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['warehouse_ids']) && (count($this->container['warehouse_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'warehouse_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -324,7 +355,7 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Gets campaign_id * - * @return int + * @return int|null */ public function getCampaignId() { @@ -334,7 +365,7 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Sets campaign_id * - * @param int $campaign_id Идентификатор магазина. + * @param int|null $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -343,11 +374,48 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling GenerateStocksOnWarehousesReportRequest., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; } + /** + * Gets business_id + * + * @return int|null + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int|null $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateStocksOnWarehousesReportRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + /** * Gets warehouse_ids * @@ -361,7 +429,7 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Sets warehouse_ids * - * @param int[]|null $warehouse_ids Фильтр по идентификаторам складов (только модель FBY). Чтобы узнать идентификатор, воспользуйтесь запросом [GET warehouses](../../reference/warehouses/getFulfillmentWarehouses.md). + * @param int[]|null $warehouse_ids Фильтр по идентификаторам складов (только модель FBY). Чтобы узнать идентификатор, воспользуйтесь запросом [GET v2/warehouses](../../reference/warehouses/getFulfillmentWarehouses.md). * * @return self */ @@ -377,6 +445,11 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warehouse_ids) && (count($warehouse_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $warehouse_ids when calling GenerateStocksOnWarehousesReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['warehouse_ids'] = $warehouse_ids; return $this; @@ -395,7 +468,7 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Sets report_date * - * @param \DateTime|null $report_date Фильтр по дате (для модели FBY). В отчет попадут данные за **предшествующий** дате день. + * @param \DateTime|null $report_date Фильтр по дате (для модели FBY). В отчет попадут данные за **предшествующий** дате день. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -438,6 +511,11 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GenerateStocksOnWarehousesReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['category_ids'] = $category_ids; return $this; @@ -469,14 +547,53 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc return $this; } + + /** + * Gets campaign_ids + * + * @return int[]|null + */ + public function getCampaignIds() + { + return $this->container['campaign_ids']; + } + + /** + * Sets campaign_ids + * + * @param int[]|null $campaign_ids Фильтр по магазинам для отчета по кабинету (кроме модели FBY). Передавайте вместе с `businessId`. + * + * @return self + */ + public function setCampaignIds($campaign_ids) + { + if (is_null($campaign_ids)) { + array_push($this->openAPINullablesSetToNull, 'campaign_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GenerateStocksOnWarehousesReportRequest., number of items must be greater than or equal to 1.'); + } + $this->container['campaign_ids'] = $campaign_ids; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -484,12 +601,12 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -514,11 +631,11 @@ class GenerateStocksOnWarehousesReportRequest implements ModelInterface, ArrayAc /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateUnitedMarketplaceServicesReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateUnitedMarketplaceServicesReportRequest.php index 7e0bed3f..10a5f713 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateUnitedMarketplaceServicesReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateUnitedMarketplaceServicesReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateUnitedMarketplaceServicesReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateUnitedMarketplaceServicesReportRequest Class Doc Comment * * @category Class - * @description Данные, необходимые для генерации отчета: идентификатор магазина, период, за который нужен отчет, а также фильтры. + * @description Данные, необходимые для генерации отчета: идентификатор кампании, период, за который нужен отчет, а также фильтры. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -306,10 +306,10 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('date_time_from', $data ?? [], null); @@ -355,6 +355,10 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + if (!is_null($this->container['month_from']) && ($this->container['month_from'] > 12)) { $invalidProperties[] = "invalid value for 'month_from', must be smaller than or equal to 12."; } @@ -371,6 +375,18 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, $invalidProperties[] = "invalid value for 'month_to', must be bigger than or equal to 1."; } + if (!is_null($this->container['placement_programs']) && (count($this->container['placement_programs']) < 1)) { + $invalidProperties[] = "invalid value for 'placement_programs', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['inns']) && (count($this->container['inns']) < 1)) { + $invalidProperties[] = "invalid value for 'inns', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -399,7 +415,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -408,6 +424,11 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateUnitedMarketplaceServicesReportRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -417,6 +438,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, * Gets date_time_from * * @return \DateTime|null + * @deprecated */ public function getDateTimeFrom() { @@ -426,9 +448,10 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets date_time_from * - * @param \DateTime|null $date_time_from {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Начало периода, включительно. + * @param \DateTime|null $date_time_from Начало периода, включительно. * * @return self + * @deprecated */ public function setDateTimeFrom($date_time_from) { @@ -444,6 +467,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, * Gets date_time_to * * @return \DateTime|null + * @deprecated */ public function getDateTimeTo() { @@ -453,9 +477,10 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets date_time_to * - * @param \DateTime|null $date_time_to {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Конец периода, включительно. Максимальный период — 3 месяца. + * @param \DateTime|null $date_time_to Конец периода, включительно. Максимальный период — 3 месяца. * * @return self + * @deprecated */ public function setDateTimeTo($date_time_to) { @@ -480,7 +505,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets date_from * - * @param \DateTime|null $date_from Начало периода, включительно. + * @param \DateTime|null $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -507,7 +532,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets date_to * - * @param \DateTime|null $date_to Конец периода, включительно. Максимальный период — 3 месяца. + * @param \DateTime|null $date_to Конец периода, включительно. Максимальный период — 3 месяца. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -534,7 +559,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets year_from * - * @param int|null $year_from Начальный год формирования акта. + * @param int|null $year_from Год. * * @return self */ @@ -561,7 +586,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets month_from * - * @param int|null $month_from Начальный номер месяца формирования акта. + * @param int|null $month_from Номер месяца. * * @return self */ @@ -596,7 +621,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets year_to * - * @param int|null $year_to Конечный год формирования акта. + * @param int|null $year_to Год. * * @return self */ @@ -623,7 +648,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets month_to * - * @param int|null $month_to Конечный номер месяца формирования акта. + * @param int|null $month_to Номер месяца. * * @return self */ @@ -674,6 +699,11 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($placement_programs) && (count($placement_programs) < 1)) { + throw new \InvalidArgumentException('invalid length for $placement_programs when calling GenerateUnitedMarketplaceServicesReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['placement_programs'] = $placement_programs; return $this; @@ -708,6 +738,11 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($inns) && (count($inns) < 1)) { + throw new \InvalidArgumentException('invalid length for $inns when calling GenerateUnitedMarketplaceServicesReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['inns'] = $inns; return $this; @@ -726,7 +761,7 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Sets campaign_ids * - * @param int[]|null $campaign_ids Список магазинов, которые нужны в отчете. + * @param int[]|null $campaign_ids Список идентификаторов кампании тех магазинов, которые нужны в отчете. * * @return self */ @@ -742,6 +777,11 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GenerateUnitedMarketplaceServicesReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['campaign_ids'] = $campaign_ids; return $this; @@ -749,11 +789,11 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -761,12 +801,12 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -791,11 +831,11 @@ class GenerateUnitedMarketplaceServicesReportRequest implements ModelInterface, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateUnitedNettingReportRequest.php b/erp24/lib/yandex_market_api/Model/GenerateUnitedNettingReportRequest.php index 1b7521b0..4cdbbcfd 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateUnitedNettingReportRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateUnitedNettingReportRequest.php @@ -2,7 +2,7 @@ /** * GenerateUnitedNettingReportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GenerateUnitedNettingReportRequest Class Doc Comment * * @category Class - * @description Данные, необходимые для генерации отчета: идентификатор магазина, период, за который нужен отчет, а также фильтры. + * @description Данные, необходимые для генерации отчета: идентификатор кампании, период, за который нужен отчет, а также фильтры. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -65,6 +65,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, 'date_to' => '\DateTime', 'bank_order_id' => 'int', 'bank_order_date_time' => '\DateTime', + 'month_of_year' => '\OpenAPI\Client\Model\MonthOfYearDTO', 'placement_programs' => '\OpenAPI\Client\Model\PlacementType[]', 'inns' => 'string[]', 'campaign_ids' => 'int[]' @@ -85,6 +86,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, 'date_to' => 'date', 'bank_order_id' => 'int64', 'bank_order_date_time' => 'date-time', + 'month_of_year' => null, 'placement_programs' => null, 'inns' => null, 'campaign_ids' => 'int64' @@ -103,6 +105,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, 'date_to' => false, 'bank_order_id' => false, 'bank_order_date_time' => false, + 'month_of_year' => false, 'placement_programs' => true, 'inns' => true, 'campaign_ids' => true @@ -201,6 +204,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, 'date_to' => 'dateTo', 'bank_order_id' => 'bankOrderId', 'bank_order_date_time' => 'bankOrderDateTime', + 'month_of_year' => 'monthOfYear', 'placement_programs' => 'placementPrograms', 'inns' => 'inns', 'campaign_ids' => 'campaignIds' @@ -219,6 +223,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, 'date_to' => 'setDateTo', 'bank_order_id' => 'setBankOrderId', 'bank_order_date_time' => 'setBankOrderDateTime', + 'month_of_year' => 'setMonthOfYear', 'placement_programs' => 'setPlacementPrograms', 'inns' => 'setInns', 'campaign_ids' => 'setCampaignIds' @@ -237,6 +242,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, 'date_to' => 'getDateTo', 'bank_order_id' => 'getBankOrderId', 'bank_order_date_time' => 'getBankOrderDateTime', + 'month_of_year' => 'getMonthOfYear', 'placement_programs' => 'getPlacementPrograms', 'inns' => 'getInns', 'campaign_ids' => 'getCampaignIds' @@ -294,10 +300,10 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('date_time_from', $data ?? [], null); @@ -306,6 +312,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, $this->setIfExists('date_to', $data ?? [], null); $this->setIfExists('bank_order_id', $data ?? [], null); $this->setIfExists('bank_order_date_time', $data ?? [], null); + $this->setIfExists('month_of_year', $data ?? [], null); $this->setIfExists('placement_programs', $data ?? [], null); $this->setIfExists('inns', $data ?? [], null); $this->setIfExists('campaign_ids', $data ?? [], null); @@ -341,6 +348,22 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['placement_programs']) && (count($this->container['placement_programs']) < 1)) { + $invalidProperties[] = "invalid value for 'placement_programs', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['inns']) && (count($this->container['inns']) < 1)) { + $invalidProperties[] = "invalid value for 'inns', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -369,7 +392,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -378,6 +401,11 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateUnitedNettingReportRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -387,6 +415,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, * Gets date_time_from * * @return \DateTime|null + * @deprecated */ public function getDateTimeFrom() { @@ -396,9 +425,10 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Sets date_time_from * - * @param \DateTime|null $date_time_from {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Начало периода, включительно. + * @param \DateTime|null $date_time_from Начало периода, включительно. * * @return self + * @deprecated */ public function setDateTimeFrom($date_time_from) { @@ -414,6 +444,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, * Gets date_time_to * * @return \DateTime|null + * @deprecated */ public function getDateTimeTo() { @@ -423,9 +454,10 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Sets date_time_to * - * @param \DateTime|null $date_time_to {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Конец периода, включительно. Максимальный период — 3 месяца. + * @param \DateTime|null $date_time_to Конец периода, включительно. Максимальный период — 3 месяца. * * @return self + * @deprecated */ public function setDateTimeTo($date_time_to) { @@ -450,7 +482,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Sets date_from * - * @param \DateTime|null $date_from Начало периода, включительно. + * @param \DateTime|null $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -477,7 +509,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Sets date_to * - * @param \DateTime|null $date_to Конец периода, включительно. Максимальный период — 3 месяца. + * @param \DateTime|null $date_to Конец периода, включительно. Максимальный период — 3 месяца. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -545,6 +577,33 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, return $this; } + /** + * Gets month_of_year + * + * @return \OpenAPI\Client\Model\MonthOfYearDTO|null + */ + public function getMonthOfYear() + { + return $this->container['month_of_year']; + } + + /** + * Sets month_of_year + * + * @param \OpenAPI\Client\Model\MonthOfYearDTO|null $month_of_year month_of_year + * + * @return self + */ + public function setMonthOfYear($month_of_year) + { + if (is_null($month_of_year)) { + throw new \InvalidArgumentException('non-nullable month_of_year cannot be null'); + } + $this->container['month_of_year'] = $month_of_year; + + return $this; + } + /** * Gets placement_programs * @@ -574,6 +633,11 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($placement_programs) && (count($placement_programs) < 1)) { + throw new \InvalidArgumentException('invalid length for $placement_programs when calling GenerateUnitedNettingReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['placement_programs'] = $placement_programs; return $this; @@ -608,6 +672,11 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($inns) && (count($inns) < 1)) { + throw new \InvalidArgumentException('invalid length for $inns when calling GenerateUnitedNettingReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['inns'] = $inns; return $this; @@ -626,7 +695,7 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Sets campaign_ids * - * @param int[]|null $campaign_ids Список магазинов, которые нужны в отчете. + * @param int[]|null $campaign_ids Список идентификаторов кампании тех магазинов, которые нужны в отчете. * * @return self */ @@ -642,6 +711,11 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GenerateUnitedNettingReportRequest., number of items must be greater than or equal to 1.'); + } $this->container['campaign_ids'] = $campaign_ids; return $this; @@ -649,11 +723,11 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -661,12 +735,12 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -691,11 +765,11 @@ class GenerateUnitedNettingReportRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateUnitedOrdersRequest.php b/erp24/lib/yandex_market_api/Model/GenerateUnitedOrdersRequest.php index 11c70225..f5b725ba 100644 --- a/erp24/lib/yandex_market_api/Model/GenerateUnitedOrdersRequest.php +++ b/erp24/lib/yandex_market_api/Model/GenerateUnitedOrdersRequest.php @@ -2,7 +2,7 @@ /** * GenerateUnitedOrdersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('business_id', $data ?? [], null); $this->setIfExists('date_from', $data ?? [], null); @@ -306,12 +306,20 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS if ($this->container['business_id'] === null) { $invalidProperties[] = "'business_id' can't be null"; } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + if ($this->container['date_from'] === null) { $invalidProperties[] = "'date_from' can't be null"; } if ($this->container['date_to'] === null) { $invalidProperties[] = "'date_to' can't be null"; } + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -340,7 +348,7 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets business_id * - * @param int $business_id Идентификатор бизнеса. + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) * * @return self */ @@ -349,6 +357,11 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS if (is_null($business_id)) { throw new \InvalidArgumentException('non-nullable business_id cannot be null'); } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateUnitedOrdersRequest., must be bigger than or equal to 1.'); + } + $this->container['business_id'] = $business_id; return $this; @@ -367,7 +380,7 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets date_from * - * @param \DateTime $date_from Начало периода, включительно. + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -394,7 +407,7 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets date_to * - * @param \DateTime $date_to Конец периода, включительно. Максимальный период — 1 год. + * @param \DateTime $date_to Конец периода, включительно. Максимальный период — 1 год. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -421,7 +434,7 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets campaign_ids * - * @param int[]|null $campaign_ids Список магазинов, которые нужны в отчете. + * @param int[]|null $campaign_ids Список идентификаторов кампании тех магазинов, которые нужны в отчете. * * @return self */ @@ -437,6 +450,11 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GenerateUnitedOrdersRequest., number of items must be greater than or equal to 1.'); + } $this->container['campaign_ids'] = $campaign_ids; return $this; @@ -471,11 +489,11 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -483,12 +501,12 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -513,11 +531,11 @@ class GenerateUnitedOrdersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GenerateUnitedReturnsRequest.php b/erp24/lib/yandex_market_api/Model/GenerateUnitedReturnsRequest.php new file mode 100644 index 00000000..10f483e1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GenerateUnitedReturnsRequest.php @@ -0,0 +1,630 @@ + + */ +class GenerateUnitedReturnsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateUnitedReturnsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_id' => 'int', + 'date_from' => '\DateTime', + 'date_to' => '\DateTime', + 'campaign_ids' => 'int[]', + 'return_type' => '\OpenAPI\Client\Model\ReturnType', + 'return_status_types' => '\OpenAPI\Client\Model\ReturnShipmentStatusType[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_id' => 'int64', + 'date_from' => 'date', + 'date_to' => 'date', + 'campaign_ids' => 'int64', + 'return_type' => null, + 'return_status_types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_id' => false, + 'date_from' => false, + 'date_to' => false, + 'campaign_ids' => true, + 'return_type' => false, + 'return_status_types' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_id' => 'businessId', + 'date_from' => 'dateFrom', + 'date_to' => 'dateTo', + 'campaign_ids' => 'campaignIds', + 'return_type' => 'returnType', + 'return_status_types' => 'returnStatusTypes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_id' => 'setBusinessId', + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo', + 'campaign_ids' => 'setCampaignIds', + 'return_type' => 'setReturnType', + 'return_status_types' => 'setReturnStatusTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_id' => 'getBusinessId', + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo', + 'campaign_ids' => 'getCampaignIds', + 'return_type' => 'getReturnType', + 'return_status_types' => 'getReturnStatusTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + $this->setIfExists('campaign_ids', $data ?? [], null); + $this->setIfExists('return_type', $data ?? [], null); + $this->setIfExists('return_status_types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['business_id'] === null) { + $invalidProperties[] = "'business_id' can't be null"; + } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if ($this->container['date_from'] === null) { + $invalidProperties[] = "'date_from' can't be null"; + } + if ($this->container['date_to'] === null) { + $invalidProperties[] = "'date_to' can't be null"; + } + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['return_status_types']) && (count($this->container['return_status_types']) < 1)) { + $invalidProperties[] = "invalid value for 'return_status_types', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_id + * + * @return int + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling GenerateUnitedReturnsRequest., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets date_from + * + * @return \DateTime + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime $date_from Начало периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + throw new \InvalidArgumentException('non-nullable date_from cannot be null'); + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime $date_to Конец периода, включительно. Формат даты: `ГГГГ-ММ-ДД`. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + throw new \InvalidArgumentException('non-nullable date_to cannot be null'); + } + $this->container['date_to'] = $date_to; + + return $this; + } + + /** + * Gets campaign_ids + * + * @return int[]|null + */ + public function getCampaignIds() + { + return $this->container['campaign_ids']; + } + + /** + * Sets campaign_ids + * + * @param int[]|null $campaign_ids Список идентификаторов кампании тех магазинов, которые нужны в отчете. + * + * @return self + */ + public function setCampaignIds($campaign_ids) + { + if (is_null($campaign_ids)) { + array_push($this->openAPINullablesSetToNull, 'campaign_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GenerateUnitedReturnsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['campaign_ids'] = $campaign_ids; + + return $this; + } + + /** + * Gets return_type + * + * @return \OpenAPI\Client\Model\ReturnType|null + */ + public function getReturnType() + { + return $this->container['return_type']; + } + + /** + * Sets return_type + * + * @param \OpenAPI\Client\Model\ReturnType|null $return_type return_type + * + * @return self + */ + public function setReturnType($return_type) + { + if (is_null($return_type)) { + throw new \InvalidArgumentException('non-nullable return_type cannot be null'); + } + $this->container['return_type'] = $return_type; + + return $this; + } + + /** + * Gets return_status_types + * + * @return \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null + */ + public function getReturnStatusTypes() + { + return $this->container['return_status_types']; + } + + /** + * Sets return_status_types + * + * @param \OpenAPI\Client\Model\ReturnShipmentStatusType[]|null $return_status_types Статусы передачи возвратов, которые нужны в отчете. Если их не указать, вернется информация по всем возвратам. + * + * @return self + */ + public function setReturnStatusTypes($return_status_types) + { + if (is_null($return_status_types)) { + array_push($this->openAPINullablesSetToNull, 'return_status_types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('return_status_types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($return_status_types) && (count($return_status_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $return_status_types when calling GenerateUnitedReturnsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['return_status_types'] = $return_status_types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetAnswersRequest.php b/erp24/lib/yandex_market_api/Model/GetAnswersRequest.php new file mode 100644 index 00000000..5a99dfbb --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetAnswersRequest.php @@ -0,0 +1,419 @@ + + */ +class GetAnswersRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetAnswersRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'question_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'question_id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'question_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'question_id' => 'questionId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'question_id' => 'setQuestionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'question_id' => 'getQuestionId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('question_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['question_id']) && ($this->container['question_id'] < 1)) { + $invalidProperties[] = "invalid value for 'question_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets question_id + * + * @return int|null + */ + public function getQuestionId() + { + return $this->container['question_id']; + } + + /** + * Sets question_id + * + * @param int|null $question_id Идентификатор вопроса. + * + * @return self + */ + public function setQuestionId($question_id) + { + if (is_null($question_id)) { + throw new \InvalidArgumentException('non-nullable question_id cannot be null'); + } + + if (($question_id < 1)) { + throw new \InvalidArgumentException('invalid value for $question_id when calling GetAnswersRequest., must be bigger than or equal to 1.'); + } + + $this->container['question_id'] = $question_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetAnswersResponse.php b/erp24/lib/yandex_market_api/Model/GetAnswersResponse.php new file mode 100644 index 00000000..5408d1cf --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetAnswersResponse.php @@ -0,0 +1,447 @@ + + */ +class GetAnswersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetAnswersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\AnswerListDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\AnswerListDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\AnswerListDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetBidsInfoRequest.php b/erp24/lib/yandex_market_api/Model/GetBidsInfoRequest.php index 420c5b93..97ba7e58 100644 --- a/erp24/lib/yandex_market_api/Model/GetBidsInfoRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetBidsInfoRequest.php @@ -2,7 +2,7 @@ /** * GetBidsInfoRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetBidsInfoRequest implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('skus', $data ?? [], null); } @@ -341,11 +341,11 @@ class GetBidsInfoRequest implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -353,12 +353,12 @@ class GetBidsInfoRequest implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -383,11 +383,11 @@ class GetBidsInfoRequest implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBidsInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetBidsInfoResponse.php index f91d60f6..883c3681 100644 --- a/erp24/lib/yandex_market_api/Model/GetBidsInfoResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetBidsInfoResponse.php @@ -2,7 +2,7 @@ /** * GetBidsInfoResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetBidsInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBidsInfoResponseDTO.php b/erp24/lib/yandex_market_api/Model/GetBidsInfoResponseDTO.php index b75c8cf4..b7f2e1b5 100644 --- a/erp24/lib/yandex_market_api/Model/GetBidsInfoResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetBidsInfoResponseDTO.php @@ -2,7 +2,7 @@ /** * GetBidsInfoResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetBidsInfoResponseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bids', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class GetBidsInfoResponseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetBidsInfoResponseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetBidsInfoResponseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsRequest.php b/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsRequest.php index 4b0eb5ff..fc4a141b 100644 --- a/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsRequest.php @@ -2,7 +2,7 @@ /** * GetBidsRecommendationsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetBidsRecommendationsRequest implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('skus', $data ?? [], null); } @@ -337,11 +337,11 @@ class GetBidsRecommendationsRequest implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class GetBidsRecommendationsRequest implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class GetBidsRecommendationsRequest implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponse.php b/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponse.php index c81aa09a..0623e11d 100644 --- a/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponse.php @@ -2,7 +2,7 @@ /** * GetBidsRecommendationsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetBidsRecommendationsResponse implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponseDTO.php b/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponseDTO.php index 6a3a5313..5aed93b8 100644 --- a/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetBidsRecommendationsResponseDTO.php @@ -2,7 +2,7 @@ /** * GetBidsRecommendationsResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetBidsRecommendationsResponseDTO implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('recommendations', $data ?? [], null); } @@ -322,11 +322,11 @@ class GetBidsRecommendationsResponseDTO implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class GetBidsRecommendationsResponseDTO implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class GetBidsRecommendationsResponseDTO implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBusinessBuyerInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetBusinessBuyerInfoResponse.php index 160a9727..cdc23acb 100644 --- a/erp24/lib/yandex_market_api/Model/GetBusinessBuyerInfoResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetBusinessBuyerInfoResponse.php @@ -2,7 +2,7 @@ /** * GetBusinessBuyerInfoResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetBusinessBuyerInfoResponse implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBusinessDocumentsInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetBusinessDocumentsInfoResponse.php index d742f439..adc21ec8 100644 --- a/erp24/lib/yandex_market_api/Model/GetBusinessDocumentsInfoResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetBusinessDocumentsInfoResponse.php @@ -2,7 +2,7 @@ /** * GetBusinessDocumentsInfoResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetBusinessDocumentsInfoResponse implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBusinessOrdersRequest.php b/erp24/lib/yandex_market_api/Model/GetBusinessOrdersRequest.php new file mode 100644 index 00000000..b6966896 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetBusinessOrdersRequest.php @@ -0,0 +1,796 @@ + + */ +class GetBusinessOrdersRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetBusinessOrdersRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'order_ids' => 'int[]', + 'external_order_ids' => 'string[]', + 'program_types' => '\OpenAPI\Client\Model\SellingProgramType[]', + 'campaign_ids' => 'int[]', + 'statuses' => '\OpenAPI\Client\Model\OrderStatusType[]', + 'substatuses' => '\OpenAPI\Client\Model\OrderSubstatusType[]', + 'dates' => '\OpenAPI\Client\Model\OrderDatesFilterDTO', + 'fake' => 'bool', + 'waiting_for_cancellation_approve' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'order_ids' => 'int64', + 'external_order_ids' => null, + 'program_types' => null, + 'campaign_ids' => 'int64', + 'statuses' => null, + 'substatuses' => null, + 'dates' => null, + 'fake' => null, + 'waiting_for_cancellation_approve' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'order_ids' => true, + 'external_order_ids' => true, + 'program_types' => true, + 'campaign_ids' => true, + 'statuses' => true, + 'substatuses' => true, + 'dates' => false, + 'fake' => false, + 'waiting_for_cancellation_approve' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_ids' => 'orderIds', + 'external_order_ids' => 'externalOrderIds', + 'program_types' => 'programTypes', + 'campaign_ids' => 'campaignIds', + 'statuses' => 'statuses', + 'substatuses' => 'substatuses', + 'dates' => 'dates', + 'fake' => 'fake', + 'waiting_for_cancellation_approve' => 'waitingForCancellationApprove' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_ids' => 'setOrderIds', + 'external_order_ids' => 'setExternalOrderIds', + 'program_types' => 'setProgramTypes', + 'campaign_ids' => 'setCampaignIds', + 'statuses' => 'setStatuses', + 'substatuses' => 'setSubstatuses', + 'dates' => 'setDates', + 'fake' => 'setFake', + 'waiting_for_cancellation_approve' => 'setWaitingForCancellationApprove' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_ids' => 'getOrderIds', + 'external_order_ids' => 'getExternalOrderIds', + 'program_types' => 'getProgramTypes', + 'campaign_ids' => 'getCampaignIds', + 'statuses' => 'getStatuses', + 'substatuses' => 'getSubstatuses', + 'dates' => 'getDates', + 'fake' => 'getFake', + 'waiting_for_cancellation_approve' => 'getWaitingForCancellationApprove' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('order_ids', $data ?? [], null); + $this->setIfExists('external_order_ids', $data ?? [], null); + $this->setIfExists('program_types', $data ?? [], null); + $this->setIfExists('campaign_ids', $data ?? [], null); + $this->setIfExists('statuses', $data ?? [], null); + $this->setIfExists('substatuses', $data ?? [], null); + $this->setIfExists('dates', $data ?? [], null); + $this->setIfExists('fake', $data ?? [], null); + $this->setIfExists('waiting_for_cancellation_approve', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['order_ids']) && (count($this->container['order_ids']) > 50)) { + $invalidProperties[] = "invalid value for 'order_ids', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['order_ids']) && (count($this->container['order_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'order_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['external_order_ids']) && (count($this->container['external_order_ids']) > 50)) { + $invalidProperties[] = "invalid value for 'external_order_ids', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['external_order_ids']) && (count($this->container['external_order_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'external_order_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['program_types']) && (count($this->container['program_types']) < 1)) { + $invalidProperties[] = "invalid value for 'program_types', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) > 50)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['statuses']) && (count($this->container['statuses']) < 1)) { + $invalidProperties[] = "invalid value for 'statuses', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['substatuses']) && (count($this->container['substatuses']) < 1)) { + $invalidProperties[] = "invalid value for 'substatuses', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_ids + * + * @return int[]|null + */ + public function getOrderIds() + { + return $this->container['order_ids']; + } + + /** + * Sets order_ids + * + * @param int[]|null $order_ids Идентификаторы заказов. + * + * @return self + */ + public function setOrderIds($order_ids) + { + if (is_null($order_ids)) { + array_push($this->openAPINullablesSetToNull, 'order_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('order_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($order_ids) && (count($order_ids) > 50)) { + throw new \InvalidArgumentException('invalid value for $order_ids when calling GetBusinessOrdersRequest., number of items must be less than or equal to 50.'); + } + if (!is_null($order_ids) && (count($order_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $order_ids when calling GetBusinessOrdersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['order_ids'] = $order_ids; + + return $this; + } + + /** + * Gets external_order_ids + * + * @return string[]|null + */ + public function getExternalOrderIds() + { + return $this->container['external_order_ids']; + } + + /** + * Sets external_order_ids + * + * @param string[]|null $external_order_ids Внешние идентификаторы заказов. + * + * @return self + */ + public function setExternalOrderIds($external_order_ids) + { + if (is_null($external_order_ids)) { + array_push($this->openAPINullablesSetToNull, 'external_order_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_order_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($external_order_ids) && (count($external_order_ids) > 50)) { + throw new \InvalidArgumentException('invalid value for $external_order_ids when calling GetBusinessOrdersRequest., number of items must be less than or equal to 50.'); + } + if (!is_null($external_order_ids) && (count($external_order_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_order_ids when calling GetBusinessOrdersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['external_order_ids'] = $external_order_ids; + + return $this; + } + + /** + * Gets program_types + * + * @return \OpenAPI\Client\Model\SellingProgramType[]|null + */ + public function getProgramTypes() + { + return $this->container['program_types']; + } + + /** + * Sets program_types + * + * @param \OpenAPI\Client\Model\SellingProgramType[]|null $program_types Модели работы магазина на Маркете. + * + * @return self + */ + public function setProgramTypes($program_types) + { + if (is_null($program_types)) { + array_push($this->openAPINullablesSetToNull, 'program_types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('program_types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($program_types) && (count($program_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $program_types when calling GetBusinessOrdersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['program_types'] = $program_types; + + return $this; + } + + /** + * Gets campaign_ids + * + * @return int[]|null + */ + public function getCampaignIds() + { + return $this->container['campaign_ids']; + } + + /** + * Sets campaign_ids + * + * @param int[]|null $campaign_ids Идентификаторы кампаний магазинов. + * + * @return self + */ + public function setCampaignIds($campaign_ids) + { + if (is_null($campaign_ids)) { + array_push($this->openAPINullablesSetToNull, 'campaign_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($campaign_ids) && (count($campaign_ids) > 50)) { + throw new \InvalidArgumentException('invalid value for $campaign_ids when calling GetBusinessOrdersRequest., number of items must be less than or equal to 50.'); + } + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GetBusinessOrdersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['campaign_ids'] = $campaign_ids; + + return $this; + } + + /** + * Gets statuses + * + * @return \OpenAPI\Client\Model\OrderStatusType[]|null + */ + public function getStatuses() + { + return $this->container['statuses']; + } + + /** + * Sets statuses + * + * @param \OpenAPI\Client\Model\OrderStatusType[]|null $statuses Статусы заказов. + * + * @return self + */ + public function setStatuses($statuses) + { + if (is_null($statuses)) { + array_push($this->openAPINullablesSetToNull, 'statuses'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statuses', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($statuses) && (count($statuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $statuses when calling GetBusinessOrdersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['statuses'] = $statuses; + + return $this; + } + + /** + * Gets substatuses + * + * @return \OpenAPI\Client\Model\OrderSubstatusType[]|null + */ + public function getSubstatuses() + { + return $this->container['substatuses']; + } + + /** + * Sets substatuses + * + * @param \OpenAPI\Client\Model\OrderSubstatusType[]|null $substatuses Этапы обработки или причины отмены заказов. + * + * @return self + */ + public function setSubstatuses($substatuses) + { + if (is_null($substatuses)) { + array_push($this->openAPINullablesSetToNull, 'substatuses'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('substatuses', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($substatuses) && (count($substatuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $substatuses when calling GetBusinessOrdersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['substatuses'] = $substatuses; + + return $this; + } + + /** + * Gets dates + * + * @return \OpenAPI\Client\Model\OrderDatesFilterDTO|null + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \OpenAPI\Client\Model\OrderDatesFilterDTO|null $dates dates + * + * @return self + */ + public function setDates($dates) + { + if (is_null($dates)) { + throw new \InvalidArgumentException('non-nullable dates cannot be null'); + } + $this->container['dates'] = $dates; + + return $this; + } + + /** + * Gets fake + * + * @return bool|null + */ + public function getFake() + { + return $this->container['fake']; + } + + /** + * Sets fake + * + * @param bool|null $fake Тип заказа: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. + * + * @return self + */ + public function setFake($fake) + { + if (is_null($fake)) { + throw new \InvalidArgumentException('non-nullable fake cannot be null'); + } + $this->container['fake'] = $fake; + + return $this; + } + + /** + * Gets waiting_for_cancellation_approve + * + * @return bool|null + */ + public function getWaitingForCancellationApprove() + { + return $this->container['waiting_for_cancellation_approve']; + } + + /** + * Sets waiting_for_cancellation_approve + * + * @param bool|null $waiting_for_cancellation_approve **Только для модели DBS** Фильтр для получения заказов, по которым есть запросы на отмену. При значении `true` возвращаются только те заказы, которые находятся в статусе `DELIVERY` или `PICKUP`, и пользователи решили их отменить. + * + * @return self + */ + public function setWaitingForCancellationApprove($waiting_for_cancellation_approve) + { + if (is_null($waiting_for_cancellation_approve)) { + throw new \InvalidArgumentException('non-nullable waiting_for_cancellation_approve cannot be null'); + } + $this->container['waiting_for_cancellation_approve'] = $waiting_for_cancellation_approve; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetBusinessOrdersResponse.php b/erp24/lib/yandex_market_api/Model/GetBusinessOrdersResponse.php new file mode 100644 index 00000000..d05d7b46 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetBusinessOrdersResponse.php @@ -0,0 +1,455 @@ + + */ +class GetBusinessOrdersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetBusinessOrdersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'orders' => '\OpenAPI\Client\Model\BusinessOrderDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'orders' => null, + 'paging' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'orders' => false, + 'paging' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'orders' => 'orders', + 'paging' => 'paging' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'orders' => 'setOrders', + 'paging' => 'setPaging' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'orders' => 'getOrders', + 'paging' => 'getPaging' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('orders', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['orders'] === null) { + $invalidProperties[] = "'orders' can't be null"; + } + if ((count($this->container['orders']) > 50)) { + $invalidProperties[] = "invalid value for 'orders', number of items must be less than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets orders + * + * @return \OpenAPI\Client\Model\BusinessOrderDTO[] + */ + public function getOrders() + { + return $this->container['orders']; + } + + /** + * Sets orders + * + * @param \OpenAPI\Client\Model\BusinessOrderDTO[] $orders Список заказов в кабинете. + * + * @return self + */ + public function setOrders($orders) + { + if (is_null($orders)) { + throw new \InvalidArgumentException('non-nullable orders cannot be null'); + } + + if ((count($orders) > 50)) { + throw new \InvalidArgumentException('invalid value for $orders when calling GetBusinessOrdersResponse., number of items must be less than or equal to 50.'); + } + $this->container['orders'] = $orders; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetBusinessSettingsInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetBusinessSettingsInfoDTO.php index 8517967c..76c9db56 100644 --- a/erp24/lib/yandex_market_api/Model/GetBusinessSettingsInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetBusinessSettingsInfoDTO.php @@ -2,7 +2,7 @@ /** * GetBusinessSettingsInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetBusinessSettingsInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('info', $data ?? [], null); $this->setIfExists('settings', $data ?? [], null); @@ -353,11 +353,11 @@ class GetBusinessSettingsInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class GetBusinessSettingsInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class GetBusinessSettingsInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetBusinessSettingsResponse.php b/erp24/lib/yandex_market_api/Model/GetBusinessSettingsResponse.php index 62e10fcf..48503119 100644 --- a/erp24/lib/yandex_market_api/Model/GetBusinessSettingsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetBusinessSettingsResponse.php @@ -2,7 +2,7 @@ /** * GetBusinessSettingsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetBusinessSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignOfferDTO.php b/erp24/lib/yandex_market_api/Model/GetCampaignOfferDTO.php index 36724f51..ec891d21 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignOfferDTO.php @@ -2,7 +2,7 @@ /** * GetCampaignOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -282,10 +282,10 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('quantum', $data ?? [], null); @@ -335,8 +335,16 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['warnings']) && (count($this->container['warnings']) < 1)) { + $invalidProperties[] = "invalid value for 'warnings', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -367,7 +375,7 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -382,8 +390,8 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling GetCampaignOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling GetCampaignOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling GetCampaignOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -395,6 +403,7 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa * Gets quantum * * @return \OpenAPI\Client\Model\QuantumDTO|null + * @deprecated */ public function getQuantum() { @@ -407,6 +416,7 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @param \OpenAPI\Client\Model\QuantumDTO|null $quantum quantum * * @return self + * @deprecated */ public function setQuantum($quantum) { @@ -422,6 +432,7 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa * Gets available * * @return bool|null + * @deprecated */ public function getAvailable() { @@ -431,9 +442,10 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets available * - * @param bool|null $available Есть ли товар в продаже. + * @param bool|null $available {% note warning \"Вместо него используйте методы скрытия товаров с витрины\" %} * [GET v2/campaigns/{campaignId}/hidden-offers](../../reference/assortment/getHiddenOffers.md) — просмотр скрытых товаров; * [POST v2/campaigns/{campaignId}/hidden-offers](../../reference/assortment/addHiddenOffers.md) — скрытие товаров; * [POST v2/campaigns/{campaignId}/hidden-offers/delete](../../reference/assortment/deleteHiddenOffers.md) — возобновление показа. {% endnote %} Есть ли товар в продаже. * * @return self + * @deprecated */ public function setAvailable($available) { @@ -555,6 +567,11 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling GetCampaignOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -589,6 +606,11 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warnings) && (count($warnings) < 1)) { + throw new \InvalidArgumentException('invalid length for $warnings when calling GetCampaignOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['warnings'] = $warnings; return $this; @@ -596,11 +618,11 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -608,12 +630,12 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -638,11 +660,11 @@ class GetCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignOffersRequest.php b/erp24/lib/yandex_market_api/Model/GetCampaignOffersRequest.php index 884d2553..9c3c80de 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignOffersRequest.php @@ -2,7 +2,7 @@ /** * GetCampaignOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GetCampaignOffersRequest Class Doc Comment * * @category Class - * @description Фильтрации товаров В запросе можно указать либо фильтр offerIds, либо любые другие фильтры товаров. Совместное использование фильтра offerIds с другими фильтрациями приведет к ошибке. + * @description Фильтрации товаров В запросе можно указать либо фильтр offerIds, либо любые другие фильтры товаров. Совместное использование фильтра `offerIds` с другими фильтрациями приведет к ошибке. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -75,7 +75,7 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPIFormats = [ 'offer_ids' => null, 'statuses' => null, - 'category_ids' => null, + 'category_ids' => 'int32', 'vendor_names' => null, 'tags' => null ]; @@ -264,10 +264,10 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); $this->setIfExists('statuses', $data ?? [], null); @@ -307,6 +307,26 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 200."; } + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['statuses']) && (count($this->container['statuses']) < 1)) { + $invalidProperties[] = "invalid value for 'statuses', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['vendor_names']) && (count($this->container['vendor_names']) < 1)) { + $invalidProperties[] = "invalid value for 'vendor_names', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -355,6 +375,9 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri if (!is_null($offer_ids) && (count($offer_ids) > 200)) { throw new \InvalidArgumentException('invalid value for $offer_ids when calling GetCampaignOffersRequest., number of items must be less than or equal to 200.'); } + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GetCampaignOffersRequest., number of items must be greater than or equal to 1.'); + } $this->container['offer_ids'] = $offer_ids; return $this; @@ -389,6 +412,11 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($statuses) && (count($statuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $statuses when calling GetCampaignOffersRequest., number of items must be greater than or equal to 1.'); + } $this->container['statuses'] = $statuses; return $this; @@ -423,6 +451,11 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GetCampaignOffersRequest., number of items must be greater than or equal to 1.'); + } $this->container['category_ids'] = $category_ids; return $this; @@ -457,6 +490,11 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($vendor_names) && (count($vendor_names) < 1)) { + throw new \InvalidArgumentException('invalid length for $vendor_names when calling GetCampaignOffersRequest., number of items must be greater than or equal to 1.'); + } $this->container['vendor_names'] = $vendor_names; return $this; @@ -491,6 +529,11 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling GetCampaignOffersRequest., number of items must be greater than or equal to 1.'); + } $this->container['tags'] = $tags; return $this; @@ -498,11 +541,11 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -510,12 +553,12 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -540,11 +583,11 @@ class GetCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignOffersResponse.php b/erp24/lib/yandex_market_api/Model/GetCampaignOffersResponse.php index 797bfed0..e43a56a2 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignOffersResponse.php @@ -2,7 +2,7 @@ /** * GetCampaignOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetCampaignOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignOffersResultDTO.php b/erp24/lib/yandex_market_api/Model/GetCampaignOffersResultDTO.php index c5ac4844..6f2cccab 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignOffersResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignOffersResultDTO.php @@ -2,7 +2,7 @@ /** * GetCampaignOffersResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetCampaignOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('offers', $data ?? [], null); @@ -356,11 +356,11 @@ class GetCampaignOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetCampaignOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetCampaignOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignResponse.php b/erp24/lib/yandex_market_api/Model/GetCampaignResponse.php index 3cd27a38..5d021943 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignResponse.php @@ -2,7 +2,7 @@ /** * GetCampaignResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetCampaignResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign', $data ?? [], null); } @@ -319,11 +319,11 @@ class GetCampaignResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class GetCampaignResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class GetCampaignResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignSettingsResponse.php b/erp24/lib/yandex_market_api/Model/GetCampaignSettingsResponse.php index 0721e66c..ac8f290d 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignSettingsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignSettingsResponse.php @@ -2,7 +2,7 @@ /** * GetCampaignSettingsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetCampaignSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('settings', $data ?? [], null); } @@ -319,11 +319,11 @@ class GetCampaignSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class GetCampaignSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class GetCampaignSettingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCampaignsResponse.php b/erp24/lib/yandex_market_api/Model/GetCampaignsResponse.php index ad7916a2..8305fc3f 100644 --- a/erp24/lib/yandex_market_api/Model/GetCampaignsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCampaignsResponse.php @@ -2,7 +2,7 @@ /** * GetCampaignsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetCampaignsResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaigns', $data ?? [], null); $this->setIfExists('pager', $data ?? [], null); @@ -356,11 +356,11 @@ class GetCampaignsResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetCampaignsResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetCampaignsResponse implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumDTO.php b/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumDTO.php index 0eaccc72..7d627bd5 100644 --- a/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumDTO.php @@ -2,7 +2,7 @@ /** * GetCategoriesMaxSaleQuantumDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetCategoriesMaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('results', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -285,6 +285,10 @@ class GetCategoriesMaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \Js if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -356,6 +360,11 @@ class GetCategoriesMaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \Js $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling GetCategoriesMaxSaleQuantumDTO., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -363,11 +372,11 @@ class GetCategoriesMaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -375,12 +384,12 @@ class GetCategoriesMaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -405,11 +414,11 @@ class GetCategoriesMaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumRequest.php b/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumRequest.php index 98a9f651..699906c6 100644 --- a/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumRequest.php @@ -2,7 +2,7 @@ /** * GetCategoriesMaxSaleQuantumRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetCategoriesMaxSaleQuantumRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('market_category_ids', $data ?? [], null); } @@ -314,7 +314,7 @@ class GetCategoriesMaxSaleQuantumRequest implements ModelInterface, ArrayAccess, /** * Sets market_category_ids * - * @param int[] $market_category_ids Идентификаторы листовых категории на Маркете — тех, у которых нет дочерних категорий. + * @param int[] $market_category_ids Идентификаторы [листовых категорий](*list-categories) на Маркете. * * @return self */ @@ -337,11 +337,11 @@ class GetCategoriesMaxSaleQuantumRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class GetCategoriesMaxSaleQuantumRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class GetCategoriesMaxSaleQuantumRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumResponse.php b/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumResponse.php index 37d17134..e0c5cc41 100644 --- a/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCategoriesMaxSaleQuantumResponse.php @@ -2,7 +2,7 @@ /** * GetCategoriesMaxSaleQuantumResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -251,10 +251,10 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); @@ -288,9 +288,16 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -309,7 +316,7 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -319,7 +326,7 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -389,6 +396,11 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling GetCategoriesMaxSaleQuantumResponse., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -396,11 +408,11 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +420,12 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +450,11 @@ class GetCategoriesMaxSaleQuantumResponse implements ModelInterface, ArrayAccess /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCategoriesRequest.php b/erp24/lib/yandex_market_api/Model/GetCategoriesRequest.php index b5cb125a..46a4fd0c 100644 --- a/erp24/lib/yandex_market_api/Model/GetCategoriesRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetCategoriesRequest.php @@ -2,7 +2,7 @@ /** * GetCategoriesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetCategoriesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('language', $data ?? [], null); } @@ -319,11 +319,11 @@ class GetCategoriesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class GetCategoriesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class GetCategoriesRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCategoriesResponse.php b/erp24/lib/yandex_market_api/Model/GetCategoriesResponse.php index faefdcd3..d6dd49d9 100644 --- a/erp24/lib/yandex_market_api/Model/GetCategoriesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCategoriesResponse.php @@ -2,7 +2,7 @@ /** * GetCategoriesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetCategoriesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetCategoryContentParametersResponse.php b/erp24/lib/yandex_market_api/Model/GetCategoryContentParametersResponse.php index 42d95386..6dfe0522 100644 --- a/erp24/lib/yandex_market_api/Model/GetCategoryContentParametersResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetCategoryContentParametersResponse.php @@ -2,7 +2,7 @@ /** * GetCategoryContentParametersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetCategoryContentParametersResponse implements ModelInterface, ArrayAcces /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetChatHistoryRequest.php b/erp24/lib/yandex_market_api/Model/GetChatHistoryRequest.php index 96182476..9262c8d3 100644 --- a/erp24/lib/yandex_market_api/Model/GetChatHistoryRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetChatHistoryRequest.php @@ -2,7 +2,7 @@ /** * GetChatHistoryRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetChatHistoryRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('message_id_from', $data ?? [], null); } @@ -328,11 +328,11 @@ class GetChatHistoryRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -340,12 +340,12 @@ class GetChatHistoryRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -370,11 +370,11 @@ class GetChatHistoryRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetChatHistoryResponse.php b/erp24/lib/yandex_market_api/Model/GetChatHistoryResponse.php index f484bd01..346d2e10 100644 --- a/erp24/lib/yandex_market_api/Model/GetChatHistoryResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetChatHistoryResponse.php @@ -2,7 +2,7 @@ /** * GetChatHistoryResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetChatHistoryResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetChatInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetChatInfoDTO.php index ef7b191c..93c5bd30 100644 --- a/erp24/lib/yandex_market_api/Model/GetChatInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetChatInfoDTO.php @@ -2,7 +2,7 @@ /** * GetChatInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GetChatInfoDTO Class Doc Comment * * @category Class - * @description Информация о чатах. + * @description Информация о чате. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -60,6 +60,7 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'chat_id' => 'int', 'order_id' => 'int', + 'context' => '\OpenAPI\Client\Model\ChatFullContextDTO', 'type' => '\OpenAPI\Client\Model\ChatType', 'status' => '\OpenAPI\Client\Model\ChatStatusType', 'created_at' => '\DateTime', @@ -76,6 +77,7 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'chat_id' => 'int64', 'order_id' => 'int64', + 'context' => null, 'type' => null, 'status' => null, 'created_at' => 'date-time', @@ -90,6 +92,7 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'chat_id' => false, 'order_id' => false, + 'context' => false, 'type' => false, 'status' => false, 'created_at' => false, @@ -184,6 +187,7 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $attributeMap = [ 'chat_id' => 'chatId', 'order_id' => 'orderId', + 'context' => 'context', 'type' => 'type', 'status' => 'status', 'created_at' => 'createdAt', @@ -198,6 +202,7 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $setters = [ 'chat_id' => 'setChatId', 'order_id' => 'setOrderId', + 'context' => 'setContext', 'type' => 'setType', 'status' => 'setStatus', 'created_at' => 'setCreatedAt', @@ -212,6 +217,7 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $getters = [ 'chat_id' => 'getChatId', 'order_id' => 'getOrderId', + 'context' => 'getContext', 'type' => 'getType', 'status' => 'getStatus', 'created_at' => 'getCreatedAt', @@ -270,13 +276,14 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('chat_id', $data ?? [], null); $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('context', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); @@ -317,8 +324,12 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'chat_id', must be bigger than or equal to 1."; } - if ($this->container['order_id'] === null) { - $invalidProperties[] = "'order_id' can't be null"; + if (!is_null($this->container['order_id']) && ($this->container['order_id'] < 1)) { + $invalidProperties[] = "invalid value for 'order_id', must be bigger than or equal to 1."; + } + + if ($this->container['context'] === null) { + $invalidProperties[] = "'context' can't be null"; } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; @@ -382,7 +393,8 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets order_id * - * @return int + * @return int|null + * @deprecated */ public function getOrderId() { @@ -392,20 +404,53 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets order_id * - * @param int $order_id Идентификатор заказа. + * @param int|null $order_id Идентификатор заказа. * * @return self + * @deprecated */ public function setOrderId($order_id) { if (is_null($order_id)) { throw new \InvalidArgumentException('non-nullable order_id cannot be null'); } + + if (($order_id < 1)) { + throw new \InvalidArgumentException('invalid value for $order_id when calling GetChatInfoDTO., must be bigger than or equal to 1.'); + } + $this->container['order_id'] = $order_id; return $this; } + /** + * Gets context + * + * @return \OpenAPI\Client\Model\ChatFullContextDTO + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \OpenAPI\Client\Model\ChatFullContextDTO $context context + * + * @return self + */ + public function setContext($context) + { + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); + } + $this->container['context'] = $context; + + return $this; + } + /** * Gets type * @@ -516,11 +561,11 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -528,12 +573,12 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -558,11 +603,11 @@ class GetChatInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetChatMessageResponse.php b/erp24/lib/yandex_market_api/Model/GetChatMessageResponse.php new file mode 100644 index 00000000..e5df8fde --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetChatMessageResponse.php @@ -0,0 +1,446 @@ + + */ +class GetChatMessageResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetChatMessageResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\ChatMessageDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\ChatMessageDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\ChatMessageDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetChatResponse.php b/erp24/lib/yandex_market_api/Model/GetChatResponse.php new file mode 100644 index 00000000..f83de1f8 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetChatResponse.php @@ -0,0 +1,446 @@ + + */ +class GetChatResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetChatResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\GetChatInfoDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\GetChatInfoDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\GetChatInfoDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetChatsInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetChatsInfoDTO.php index 424395ee..4d67b5f5 100644 --- a/erp24/lib/yandex_market_api/Model/GetChatsInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetChatsInfoDTO.php @@ -2,7 +2,7 @@ /** * GetChatsInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetChatsInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('chats', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class GetChatsInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetChatsInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetChatsInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetChatsRequest.php b/erp24/lib/yandex_market_api/Model/GetChatsRequest.php index 23a4c5e1..75733644 100644 --- a/erp24/lib/yandex_market_api/Model/GetChatsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetChatsRequest.php @@ -2,7 +2,7 @@ /** * GetChatsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,6 +59,8 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'order_ids' => 'int[]', + 'contexts' => '\OpenAPI\Client\Model\ChatContextDTO[]', + 'context_types' => '\OpenAPI\Client\Model\ChatContextType[]', 'types' => '\OpenAPI\Client\Model\ChatType[]', 'statuses' => '\OpenAPI\Client\Model\ChatStatusType[]' ]; @@ -72,6 +74,8 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'order_ids' => 'int64', + 'contexts' => null, + 'context_types' => null, 'types' => null, 'statuses' => null ]; @@ -83,6 +87,8 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'order_ids' => true, + 'contexts' => true, + 'context_types' => true, 'types' => true, 'statuses' => true ]; @@ -174,6 +180,8 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $attributeMap = [ 'order_ids' => 'orderIds', + 'contexts' => 'contexts', + 'context_types' => 'contextTypes', 'types' => 'types', 'statuses' => 'statuses' ]; @@ -185,6 +193,8 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $setters = [ 'order_ids' => 'setOrderIds', + 'contexts' => 'setContexts', + 'context_types' => 'setContextTypes', 'types' => 'setTypes', 'statuses' => 'setStatuses' ]; @@ -196,6 +206,8 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $getters = [ 'order_ids' => 'getOrderIds', + 'contexts' => 'getContexts', + 'context_types' => 'getContextTypes', 'types' => 'getTypes', 'statuses' => 'getStatuses' ]; @@ -252,12 +264,14 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_ids', $data ?? [], null); + $this->setIfExists('contexts', $data ?? [], null); + $this->setIfExists('context_types', $data ?? [], null); $this->setIfExists('types', $data ?? [], null); $this->setIfExists('statuses', $data ?? [], null); } @@ -293,6 +307,14 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'order_ids', number of items must be greater than or equal to 1."; } + if (!is_null($this->container['contexts']) && (count($this->container['contexts']) < 1)) { + $invalidProperties[] = "invalid value for 'contexts', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['context_types']) && (count($this->container['context_types']) < 1)) { + $invalidProperties[] = "invalid value for 'context_types', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['types']) && (count($this->container['types']) < 1)) { $invalidProperties[] = "invalid value for 'types', number of items must be greater than or equal to 1."; } @@ -320,6 +342,7 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable * Gets order_ids * * @return int[]|null + * @deprecated */ public function getOrderIds() { @@ -332,6 +355,7 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable * @param int[]|null $order_ids Фильтр по идентификаторам заказов на Маркете. * * @return self + * @deprecated */ public function setOrderIds($order_ids) { @@ -355,6 +379,84 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets contexts + * + * @return \OpenAPI\Client\Model\ChatContextDTO[]|null + */ + public function getContexts() + { + return $this->container['contexts']; + } + + /** + * Sets contexts + * + * @param \OpenAPI\Client\Model\ChatContextDTO[]|null $contexts Фильтр по контексту чата. + * + * @return self + */ + public function setContexts($contexts) + { + if (is_null($contexts)) { + array_push($this->openAPINullablesSetToNull, 'contexts'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contexts', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($contexts) && (count($contexts) < 1)) { + throw new \InvalidArgumentException('invalid length for $contexts when calling GetChatsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['contexts'] = $contexts; + + return $this; + } + + /** + * Gets context_types + * + * @return \OpenAPI\Client\Model\ChatContextType[]|null + */ + public function getContextTypes() + { + return $this->container['context_types']; + } + + /** + * Sets context_types + * + * @param \OpenAPI\Client\Model\ChatContextType[]|null $context_types Фильтр по типу контекста чата. + * + * @return self + */ + public function setContextTypes($context_types) + { + if (is_null($context_types)) { + array_push($this->openAPINullablesSetToNull, 'context_types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('context_types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($context_types) && (count($context_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $context_types when calling GetChatsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['context_types'] = $context_types; + + return $this; + } + /** * Gets types * @@ -435,11 +537,11 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -447,12 +549,12 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -477,11 +579,11 @@ class GetChatsRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetChatsResponse.php b/erp24/lib/yandex_market_api/Model/GetChatsResponse.php index b88ad54c..908024a5 100644 --- a/erp24/lib/yandex_market_api/Model/GetChatsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetChatsResponse.php @@ -2,7 +2,7 @@ /** * GetChatsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetChatsResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetDefaultPricesRequest.php b/erp24/lib/yandex_market_api/Model/GetDefaultPricesRequest.php new file mode 100644 index 00000000..b0904b43 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetDefaultPricesRequest.php @@ -0,0 +1,466 @@ + + */ +class GetDefaultPricesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetDefaultPricesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offer_ids' => 'string[]', + 'archived' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offer_ids' => null, + 'archived' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_ids' => true, + 'archived' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offer_ids' => 'offerIds', + 'archived' => 'archived' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offer_ids' => 'setOfferIds', + 'archived' => 'setArchived' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offer_ids' => 'getOfferIds', + 'archived' => 'getArchived' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offer_ids', $data ?? [], null); + $this->setIfExists('archived', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) > 200)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 200."; + } + + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offer_ids + * + * @return string[]|null + */ + public function getOfferIds() + { + return $this->container['offer_ids']; + } + + /** + * Sets offer_ids + * + * @param string[]|null $offer_ids Идентификаторы товаров, информация о которых нужна. + * + * @return self + */ + public function setOfferIds($offer_ids) + { + if (is_null($offer_ids)) { + array_push($this->openAPINullablesSetToNull, 'offer_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('offer_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($offer_ids) && (count($offer_ids) > 200)) { + throw new \InvalidArgumentException('invalid value for $offer_ids when calling GetDefaultPricesRequest., number of items must be less than or equal to 200.'); + } + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GetDefaultPricesRequest., number of items must be greater than or equal to 1.'); + } + $this->container['offer_ids'] = $offer_ids; + + return $this; + } + + /** + * Gets archived + * + * @return bool|null + */ + public function getArchived() + { + return $this->container['archived']; + } + + /** + * Sets archived + * + * @param bool|null $archived Находится ли товар в архиве. + * + * @return self + */ + public function setArchived($archived) + { + if (is_null($archived)) { + throw new \InvalidArgumentException('non-nullable archived cannot be null'); + } + $this->container['archived'] = $archived; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetDefaultPricesResponse.php b/erp24/lib/yandex_market_api/Model/GetDefaultPricesResponse.php new file mode 100644 index 00000000..49b07925 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetDefaultPricesResponse.php @@ -0,0 +1,447 @@ + + */ +class GetDefaultPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetDefaultPricesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\OfferDefaultPriceListResponseDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\OfferDefaultPriceListResponseDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\OfferDefaultPriceListResponseDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetDeliveryServicesResponse.php b/erp24/lib/yandex_market_api/Model/GetDeliveryServicesResponse.php index 7d53f19d..d7fea6f4 100644 --- a/erp24/lib/yandex_market_api/Model/GetDeliveryServicesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetDeliveryServicesResponse.php @@ -2,7 +2,7 @@ /** * GetDeliveryServicesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetDeliveryServicesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('result', $data ?? [], null); } @@ -319,11 +319,11 @@ class GetDeliveryServicesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class GetDeliveryServicesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class GetDeliveryServicesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetFulfillmentWarehousesResponse.php b/erp24/lib/yandex_market_api/Model/GetFulfillmentWarehousesResponse.php index 7647324f..26847ace 100644 --- a/erp24/lib/yandex_market_api/Model/GetFulfillmentWarehousesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetFulfillmentWarehousesResponse.php @@ -2,7 +2,7 @@ /** * GetFulfillmentWarehousesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetFulfillmentWarehousesResponse implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsRequest.php b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsRequest.php index 7026a53e..147a264f 100644 --- a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsRequest.php @@ -2,7 +2,7 @@ /** * GetGoodsFeedbackCommentsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,7 +58,8 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ - 'feedback_id' => 'int' + 'feedback_id' => 'int', + 'comment_ids' => 'int[]' ]; /** @@ -69,7 +70,8 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J * @psalm-var array */ protected static $openAPIFormats = [ - 'feedback_id' => 'int64' + 'feedback_id' => 'int64', + 'comment_ids' => 'int64' ]; /** @@ -78,7 +80,8 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J * @var boolean[] */ protected static array $openAPINullables = [ - 'feedback_id' => false + 'feedback_id' => false, + 'comment_ids' => true ]; /** @@ -167,7 +170,8 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $attributeMap = [ - 'feedback_id' => 'feedbackId' + 'feedback_id' => 'feedbackId', + 'comment_ids' => 'commentIds' ]; /** @@ -176,7 +180,8 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $setters = [ - 'feedback_id' => 'setFeedbackId' + 'feedback_id' => 'setFeedbackId', + 'comment_ids' => 'setCommentIds' ]; /** @@ -185,7 +190,8 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $getters = [ - 'feedback_id' => 'getFeedbackId' + 'feedback_id' => 'getFeedbackId', + 'comment_ids' => 'getCommentIds' ]; /** @@ -240,12 +246,13 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('feedback_id', $data ?? [], null); + $this->setIfExists('comment_ids', $data ?? [], null); } /** @@ -275,9 +282,14 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J { $invalidProperties = []; - if ($this->container['feedback_id'] === null) { - $invalidProperties[] = "'feedback_id' can't be null"; + if (!is_null($this->container['comment_ids']) && (count($this->container['comment_ids']) > 50)) { + $invalidProperties[] = "invalid value for 'comment_ids', number of items must be less than or equal to 50."; } + + if (!is_null($this->container['comment_ids']) && (count($this->container['comment_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'comment_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -296,7 +308,7 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J /** * Gets feedback_id * - * @return int + * @return int|null */ public function getFeedbackId() { @@ -306,7 +318,7 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J /** * Sets feedback_id * - * @param int $feedback_id Идентификатор отзыва. + * @param int|null $feedback_id Идентификатор отзыва. * * @return self */ @@ -319,14 +331,55 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J return $this; } + + /** + * Gets comment_ids + * + * @return int[]|null + */ + public function getCommentIds() + { + return $this->container['comment_ids']; + } + + /** + * Sets comment_ids + * + * @param int[]|null $comment_ids Идентификаторы комментариев. ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. + * + * @return self + */ + public function setCommentIds($comment_ids) + { + if (is_null($comment_ids)) { + array_push($this->openAPINullablesSetToNull, 'comment_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('comment_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($comment_ids) && (count($comment_ids) > 50)) { + throw new \InvalidArgumentException('invalid value for $comment_ids when calling GetGoodsFeedbackCommentsRequest., number of items must be less than or equal to 50.'); + } + if (!is_null($comment_ids) && (count($comment_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $comment_ids when calling GetGoodsFeedbackCommentsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['comment_ids'] = $comment_ids; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +387,12 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +417,11 @@ class GetGoodsFeedbackCommentsRequest implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsResponse.php b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsResponse.php index a8850b99..2fa697aa 100644 --- a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackCommentsResponse.php @@ -2,7 +2,7 @@ /** * GetGoodsFeedbackCommentsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetGoodsFeedbackCommentsResponse implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackRequest.php b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackRequest.php index 7e027997..973d5189 100644 --- a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackRequest.php @@ -2,7 +2,7 @@ /** * GetGoodsFeedbackRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,11 +58,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ + 'feedback_ids' => 'int[]', 'date_time_from' => '\DateTime', 'date_time_to' => '\DateTime', 'reaction_status' => '\OpenAPI\Client\Model\FeedbackReactionStatusType', 'rating_values' => 'int[]', - 'model_ids' => 'int[]', + 'offer_ids' => 'string[]', 'paid' => 'bool' ]; @@ -74,11 +75,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ + 'feedback_ids' => 'int64', 'date_time_from' => 'date-time', 'date_time_to' => 'date-time', 'reaction_status' => null, 'rating_values' => 'int32', - 'model_ids' => 'int64', + 'offer_ids' => null, 'paid' => null ]; @@ -88,11 +90,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ + 'feedback_ids' => true, 'date_time_from' => false, 'date_time_to' => false, 'reaction_status' => false, 'rating_values' => true, - 'model_ids' => true, + 'offer_ids' => true, 'paid' => false ]; @@ -182,11 +185,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $attributeMap = [ + 'feedback_ids' => 'feedbackIds', 'date_time_from' => 'dateTimeFrom', 'date_time_to' => 'dateTimeTo', 'reaction_status' => 'reactionStatus', 'rating_values' => 'ratingValues', - 'model_ids' => 'modelIds', + 'offer_ids' => 'offerIds', 'paid' => 'paid' ]; @@ -196,11 +200,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $setters = [ + 'feedback_ids' => 'setFeedbackIds', 'date_time_from' => 'setDateTimeFrom', 'date_time_to' => 'setDateTimeTo', 'reaction_status' => 'setReactionStatus', 'rating_values' => 'setRatingValues', - 'model_ids' => 'setModelIds', + 'offer_ids' => 'setOfferIds', 'paid' => 'setPaid' ]; @@ -210,11 +215,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $getters = [ + 'feedback_ids' => 'getFeedbackIds', 'date_time_from' => 'getDateTimeFrom', 'date_time_to' => 'getDateTimeTo', 'reaction_status' => 'getReactionStatus', 'rating_values' => 'getRatingValues', - 'model_ids' => 'getModelIds', + 'offer_ids' => 'getOfferIds', 'paid' => 'getPaid' ]; @@ -270,16 +276,17 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { + $this->setIfExists('feedback_ids', $data ?? [], null); $this->setIfExists('date_time_from', $data ?? [], null); $this->setIfExists('date_time_to', $data ?? [], null); $this->setIfExists('reaction_status', $data ?? [], null); $this->setIfExists('rating_values', $data ?? [], null); - $this->setIfExists('model_ids', $data ?? [], null); + $this->setIfExists('offer_ids', $data ?? [], null); $this->setIfExists('paid', $data ?? [], null); } @@ -310,12 +317,28 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria { $invalidProperties = []; + if (!is_null($this->container['feedback_ids']) && (count($this->container['feedback_ids']) > 50)) { + $invalidProperties[] = "invalid value for 'feedback_ids', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['feedback_ids']) && (count($this->container['feedback_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'feedback_ids', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['rating_values']) && (count($this->container['rating_values']) > 5)) { $invalidProperties[] = "invalid value for 'rating_values', number of items must be less than or equal to 5."; } - if (!is_null($this->container['model_ids']) && (count($this->container['model_ids']) > 20)) { - $invalidProperties[] = "invalid value for 'model_ids', number of items must be less than or equal to 20."; + if (!is_null($this->container['rating_values']) && (count($this->container['rating_values']) < 1)) { + $invalidProperties[] = "invalid value for 'rating_values', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) > 20)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 20."; + } + + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -333,6 +356,47 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria } + /** + * Gets feedback_ids + * + * @return int[]|null + */ + public function getFeedbackIds() + { + return $this->container['feedback_ids']; + } + + /** + * Sets feedback_ids + * + * @param int[]|null $feedback_ids Идентификаторы отзывов. ⚠️ Не используйте это поле одновременно с другими фильтрами. Если вы хотите воспользоваться ими, оставьте поле пустым. + * + * @return self + */ + public function setFeedbackIds($feedback_ids) + { + if (is_null($feedback_ids)) { + array_push($this->openAPINullablesSetToNull, 'feedback_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('feedback_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($feedback_ids) && (count($feedback_ids) > 50)) { + throw new \InvalidArgumentException('invalid value for $feedback_ids when calling GetGoodsFeedbackRequest., number of items must be less than or equal to 50.'); + } + if (!is_null($feedback_ids) && (count($feedback_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $feedback_ids when calling GetGoodsFeedbackRequest., number of items must be greater than or equal to 1.'); + } + $this->container['feedback_ids'] = $feedback_ids; + + return $this; + } + /** * Gets date_time_from * @@ -346,7 +410,7 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets date_time_from * - * @param \DateTime|null $date_time_from Начало периода. Не включительно. Если параметр не указан, возвращается информация за 6 месяцев до указанной в `dateTimeTo` даты. + * @param \DateTime|null $date_time_from Начало периода. Не включительно. Если параметр не указан, возвращается информация за 6 месяцев до указанной в `dateTimeTo` даты. Максимальный интервал 6 месяцев. * * @return self */ @@ -373,7 +437,7 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets date_time_to * - * @param \DateTime|null $date_time_to Конец периода. Не включительно. Если параметр не указан, используется текущая дата. + * @param \DateTime|null $date_time_to Конец периода. Не включительно. Если параметр не указан, используется текущая дата. Максимальный интервал 6 месяцев. * * @return self */ @@ -447,45 +511,51 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria if (!is_null($rating_values) && (count($rating_values) > 5)) { throw new \InvalidArgumentException('invalid value for $rating_values when calling GetGoodsFeedbackRequest., number of items must be less than or equal to 5.'); } + if (!is_null($rating_values) && (count($rating_values) < 1)) { + throw new \InvalidArgumentException('invalid length for $rating_values when calling GetGoodsFeedbackRequest., number of items must be greater than or equal to 1.'); + } $this->container['rating_values'] = $rating_values; return $this; } /** - * Gets model_ids + * Gets offer_ids * - * @return int[]|null + * @return string[]|null */ - public function getModelIds() + public function getOfferIds() { - return $this->container['model_ids']; + return $this->container['offer_ids']; } /** - * Sets model_ids + * Sets offer_ids * - * @param int[]|null $model_ids Фильтр по идентификатору модели товара. Получить идентификатор модели можно с помощью одного из запросов: * [POST businesses/{businessId}/offer-mappings](../../reference/business-assortment/getOfferMappings.md); * [POST businesses/{businessId}/offer-cards](../../reference/content/getOfferCardsContentStatus.md); * [POST models](../../reference/models/getModels.md). + * @param string[]|null $offer_ids Фильтр по идентификатору товара. * * @return self */ - public function setModelIds($model_ids) + public function setOfferIds($offer_ids) { - if (is_null($model_ids)) { - array_push($this->openAPINullablesSetToNull, 'model_ids'); + if (is_null($offer_ids)) { + array_push($this->openAPINullablesSetToNull, 'offer_ids'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('model_ids', $nullablesSetToNull); + $index = array_search('offer_ids', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - if (!is_null($model_ids) && (count($model_ids) > 20)) { - throw new \InvalidArgumentException('invalid value for $model_ids when calling GetGoodsFeedbackRequest., number of items must be less than or equal to 20.'); + if (!is_null($offer_ids) && (count($offer_ids) > 20)) { + throw new \InvalidArgumentException('invalid value for $offer_ids when calling GetGoodsFeedbackRequest., number of items must be less than or equal to 20.'); + } + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GetGoodsFeedbackRequest., number of items must be greater than or equal to 1.'); } - $this->container['model_ids'] = $model_ids; + $this->container['offer_ids'] = $offer_ids; return $this; } @@ -519,11 +589,11 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -531,12 +601,12 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -561,11 +631,11 @@ class GetGoodsFeedbackRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackResponse.php b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackResponse.php index 937a1993..23d84c35 100644 --- a/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetGoodsFeedbackResponse.php @@ -2,7 +2,7 @@ /** * GetGoodsFeedbackResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetGoodsFeedbackResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetGoodsStatsRequest.php b/erp24/lib/yandex_market_api/Model/GetGoodsStatsRequest.php index 1b86e60b..83d27b09 100644 --- a/erp24/lib/yandex_market_api/Model/GetGoodsStatsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetGoodsStatsRequest.php @@ -2,7 +2,7 @@ /** * GetGoodsStatsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetGoodsStatsRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('shop_skus', $data ?? [], null); } @@ -337,11 +337,11 @@ class GetGoodsStatsRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class GetGoodsStatsRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class GetGoodsStatsRequest implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetGoodsStatsResponse.php b/erp24/lib/yandex_market_api/Model/GetGoodsStatsResponse.php index 342ec8d2..24b99e19 100644 --- a/erp24/lib/yandex_market_api/Model/GetGoodsStatsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetGoodsStatsResponse.php @@ -2,7 +2,7 @@ /** * GetGoodsStatsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetGoodsStatsResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetHiddenOffersResponse.php b/erp24/lib/yandex_market_api/Model/GetHiddenOffersResponse.php index af74a887..35c588cb 100644 --- a/erp24/lib/yandex_market_api/Model/GetHiddenOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetHiddenOffersResponse.php @@ -2,7 +2,7 @@ /** * GetHiddenOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetHiddenOffersResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetHiddenOffersResultDTO.php b/erp24/lib/yandex_market_api/Model/GetHiddenOffersResultDTO.php index 0429e023..071b7665 100644 --- a/erp24/lib/yandex_market_api/Model/GetHiddenOffersResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetHiddenOffersResultDTO.php @@ -2,7 +2,7 @@ /** * GetHiddenOffersResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetHiddenOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('hidden_offers', $data ?? [], null); @@ -356,11 +356,11 @@ class GetHiddenOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetHiddenOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetHiddenOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetMappingDTO.php b/erp24/lib/yandex_market_api/Model/GetMappingDTO.php index cd188af0..f101f88f 100644 --- a/erp24/lib/yandex_market_api/Model/GetMappingDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetMappingDTO.php @@ -2,7 +2,7 @@ /** * GetMappingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -60,7 +60,6 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'market_sku' => 'int', 'market_sku_name' => 'string', - 'market_model_id' => 'int', 'market_model_name' => 'string', 'market_category_id' => 'int', 'market_category_name' => 'string' @@ -76,7 +75,6 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'market_sku' => 'int64', 'market_sku_name' => null, - 'market_model_id' => 'int64', 'market_model_name' => null, 'market_category_id' => 'int64', 'market_category_name' => null @@ -90,7 +88,6 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'market_sku' => false, 'market_sku_name' => false, - 'market_model_id' => false, 'market_model_name' => false, 'market_category_id' => false, 'market_category_name' => false @@ -184,7 +181,6 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $attributeMap = [ 'market_sku' => 'marketSku', 'market_sku_name' => 'marketSkuName', - 'market_model_id' => 'marketModelId', 'market_model_name' => 'marketModelName', 'market_category_id' => 'marketCategoryId', 'market_category_name' => 'marketCategoryName' @@ -198,7 +194,6 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $setters = [ 'market_sku' => 'setMarketSku', 'market_sku_name' => 'setMarketSkuName', - 'market_model_id' => 'setMarketModelId', 'market_model_name' => 'setMarketModelName', 'market_category_id' => 'setMarketCategoryId', 'market_category_name' => 'setMarketCategoryName' @@ -212,7 +207,6 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable protected static $getters = [ 'market_sku' => 'getMarketSku', 'market_sku_name' => 'getMarketSkuName', - 'market_model_id' => 'getMarketModelId', 'market_model_name' => 'getMarketModelName', 'market_category_id' => 'getMarketCategoryId', 'market_category_name' => 'getMarketCategoryName' @@ -270,14 +264,13 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('market_sku', $data ?? [], null); $this->setIfExists('market_sku_name', $data ?? [], null); - $this->setIfExists('market_model_id', $data ?? [], null); $this->setIfExists('market_model_name', $data ?? [], null); $this->setIfExists('market_category_id', $data ?? [], null); $this->setIfExists('market_category_name', $data ?? [], null); @@ -342,7 +335,7 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -388,37 +381,11 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } - /** - * Gets market_model_id - * - * @return int|null - */ - public function getMarketModelId() - { - return $this->container['market_model_id']; - } - - /** - * Sets market_model_id - * - * @param int|null $market_model_id Идентификатор модели на Маркете. Может отсутствовать в ответе, если товар еще не привязан к карточке. - * - * @return self - */ - public function setMarketModelId($market_model_id) - { - if (is_null($market_model_id)) { - throw new \InvalidArgumentException('non-nullable market_model_id cannot be null'); - } - $this->container['market_model_id'] = $market_model_id; - - return $this; - } - /** * Gets market_model_name * * @return string|null + * @deprecated */ public function getMarketModelName() { @@ -431,6 +398,7 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable * @param string|null $market_model_name Название модели на Маркете. Может отсутствовать в ответе, если товар еще не привязан к карточке. * * @return self + * @deprecated */ public function setMarketModelName($market_model_name) { @@ -498,11 +466,11 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -510,12 +478,12 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -540,11 +508,11 @@ class GetMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusRequest.php b/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusRequest.php index 56092086..d33ab237 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusRequest.php @@ -2,7 +2,7 @@ /** * GetOfferCardsContentStatusRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,8 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, protected static $openAPITypes = [ 'offer_ids' => 'string[]', 'card_statuses' => '\OpenAPI\Client\Model\OfferCardStatusType[]', - 'category_ids' => 'int[]' + 'category_ids' => 'int[]', + 'with_recommendations' => 'bool' ]; /** @@ -72,7 +73,8 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, protected static $openAPIFormats = [ 'offer_ids' => null, 'card_statuses' => null, - 'category_ids' => 'int32' + 'category_ids' => 'int32', + 'with_recommendations' => null ]; /** @@ -83,7 +85,8 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, protected static array $openAPINullables = [ 'offer_ids' => true, 'card_statuses' => true, - 'category_ids' => true + 'category_ids' => true, + 'with_recommendations' => false ]; /** @@ -174,7 +177,8 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, protected static $attributeMap = [ 'offer_ids' => 'offerIds', 'card_statuses' => 'cardStatuses', - 'category_ids' => 'categoryIds' + 'category_ids' => 'categoryIds', + 'with_recommendations' => 'withRecommendations' ]; /** @@ -185,7 +189,8 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, protected static $setters = [ 'offer_ids' => 'setOfferIds', 'card_statuses' => 'setCardStatuses', - 'category_ids' => 'setCategoryIds' + 'category_ids' => 'setCategoryIds', + 'with_recommendations' => 'setWithRecommendations' ]; /** @@ -196,7 +201,8 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, protected static $getters = [ 'offer_ids' => 'getOfferIds', 'card_statuses' => 'getCardStatuses', - 'category_ids' => 'getCategoryIds' + 'category_ids' => 'getCategoryIds', + 'with_recommendations' => 'getWithRecommendations' ]; /** @@ -251,14 +257,15 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); $this->setIfExists('card_statuses', $data ?? [], null); $this->setIfExists('category_ids', $data ?? [], null); + $this->setIfExists('with_recommendations', $data ?? [], false); } /** @@ -292,10 +299,22 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 200."; } + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['card_statuses']) && (count($this->container['card_statuses']) < 1)) { + $invalidProperties[] = "invalid value for 'card_statuses', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) > 200)) { $invalidProperties[] = "invalid value for 'category_ids', number of items must be less than or equal to 200."; } + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -344,6 +363,9 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, if (!is_null($offer_ids) && (count($offer_ids) > 200)) { throw new \InvalidArgumentException('invalid value for $offer_ids when calling GetOfferCardsContentStatusRequest., number of items must be less than or equal to 200.'); } + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GetOfferCardsContentStatusRequest., number of items must be greater than or equal to 1.'); + } $this->container['offer_ids'] = $offer_ids; return $this; @@ -380,6 +402,9 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, } + if (!is_null($card_statuses) && (count($card_statuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $card_statuses when calling GetOfferCardsContentStatusRequest., number of items must be greater than or equal to 1.'); + } $this->container['card_statuses'] = $card_statuses; return $this; @@ -418,18 +443,48 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, if (!is_null($category_ids) && (count($category_ids) > 200)) { throw new \InvalidArgumentException('invalid value for $category_ids when calling GetOfferCardsContentStatusRequest., number of items must be less than or equal to 200.'); } + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GetOfferCardsContentStatusRequest., number of items must be greater than or equal to 1.'); + } $this->container['category_ids'] = $category_ids; return $this; } + + /** + * Gets with_recommendations + * + * @return bool|null + */ + public function getWithRecommendations() + { + return $this->container['with_recommendations']; + } + + /** + * Sets with_recommendations + * + * @param bool|null $with_recommendations Возвращать ли список рекомендаций к заполнению карточки и средний рейтинг карточки у товаров той категории, которая указана в `marketCategoryId`. Значение по умолчанию: `false`. Если информация нужна, передайте значение `true`. + * + * @return self + */ + public function setWithRecommendations($with_recommendations) + { + if (is_null($with_recommendations)) { + throw new \InvalidArgumentException('non-nullable with_recommendations cannot be null'); + } + $this->container['with_recommendations'] = $with_recommendations; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -437,12 +492,12 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -467,11 +522,11 @@ class GetOfferCardsContentStatusRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusResponse.php b/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusResponse.php index d18428b4..ce810ce2 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferCardsContentStatusResponse.php @@ -2,7 +2,7 @@ /** * GetOfferCardsContentStatusResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetOfferCardsContentStatusResponse implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferDTO.php b/erp24/lib/yandex_market_api/Model/GetOfferDTO.php index d0d114e9..7290e416 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferDTO.php @@ -2,7 +2,7 @@ /** * GetOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -76,6 +76,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => '\OpenAPI\Client\Model\TimePeriodDTO', 'guarantee_period' => '\OpenAPI\Client\Model\TimePeriodDTO', 'customs_commodity_code' => 'string', + 'commodity_codes' => '\OpenAPI\Client\Model\CommodityCodeDTO[]', 'certificates' => 'string[]', 'box_count' => 'int', 'condition' => '\OpenAPI\Client\Model\OfferConditionDTO', @@ -87,11 +88,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => '\OpenAPI\Client\Model\GetPriceWithDiscountDTO', 'purchase_price' => '\OpenAPI\Client\Model\GetPriceDTO', 'additional_expenses' => '\OpenAPI\Client\Model\GetPriceDTO', - 'cofinance_price' => '\OpenAPI\Client\Model\GetPriceDTO', 'card_status' => '\OpenAPI\Client\Model\OfferCardStatusType', 'campaigns' => '\OpenAPI\Client\Model\OfferCampaignStatusDTO[]', 'selling_programs' => '\OpenAPI\Client\Model\OfferSellingProgramDTO[]', - 'archived' => 'bool' + 'media_files' => '\OpenAPI\Client\Model\OfferMediaFilesDTO', + 'archived' => 'bool', + 'group_id' => 'string' ]; /** @@ -120,6 +122,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => null, 'guarantee_period' => null, 'customs_commodity_code' => null, + 'commodity_codes' => null, 'certificates' => null, 'box_count' => 'int32', 'condition' => null, @@ -131,11 +134,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => null, 'purchase_price' => null, 'additional_expenses' => null, - 'cofinance_price' => null, 'card_status' => null, 'campaigns' => null, 'selling_programs' => null, - 'archived' => null + 'media_files' => null, + 'archived' => null, + 'group_id' => null ]; /** @@ -162,6 +166,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => false, 'guarantee_period' => false, 'customs_commodity_code' => false, + 'commodity_codes' => true, 'certificates' => true, 'box_count' => false, 'condition' => false, @@ -173,11 +178,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => false, 'purchase_price' => false, 'additional_expenses' => false, - 'cofinance_price' => false, 'card_status' => false, 'campaigns' => true, 'selling_programs' => true, - 'archived' => false + 'media_files' => false, + 'archived' => false, + 'group_id' => false ]; /** @@ -284,6 +290,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'lifeTime', 'guarantee_period' => 'guaranteePeriod', 'customs_commodity_code' => 'customsCommodityCode', + 'commodity_codes' => 'commodityCodes', 'certificates' => 'certificates', 'box_count' => 'boxCount', 'condition' => 'condition', @@ -295,11 +302,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => 'basicPrice', 'purchase_price' => 'purchasePrice', 'additional_expenses' => 'additionalExpenses', - 'cofinance_price' => 'cofinancePrice', 'card_status' => 'cardStatus', 'campaigns' => 'campaigns', 'selling_programs' => 'sellingPrograms', - 'archived' => 'archived' + 'media_files' => 'mediaFiles', + 'archived' => 'archived', + 'group_id' => 'groupId' ]; /** @@ -326,6 +334,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'setLifeTime', 'guarantee_period' => 'setGuaranteePeriod', 'customs_commodity_code' => 'setCustomsCommodityCode', + 'commodity_codes' => 'setCommodityCodes', 'certificates' => 'setCertificates', 'box_count' => 'setBoxCount', 'condition' => 'setCondition', @@ -337,11 +346,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => 'setBasicPrice', 'purchase_price' => 'setPurchasePrice', 'additional_expenses' => 'setAdditionalExpenses', - 'cofinance_price' => 'setCofinancePrice', 'card_status' => 'setCardStatus', 'campaigns' => 'setCampaigns', 'selling_programs' => 'setSellingPrograms', - 'archived' => 'setArchived' + 'media_files' => 'setMediaFiles', + 'archived' => 'setArchived', + 'group_id' => 'setGroupId' ]; /** @@ -368,6 +378,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'getLifeTime', 'guarantee_period' => 'getGuaranteePeriod', 'customs_commodity_code' => 'getCustomsCommodityCode', + 'commodity_codes' => 'getCommodityCodes', 'certificates' => 'getCertificates', 'box_count' => 'getBoxCount', 'condition' => 'getCondition', @@ -379,11 +390,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => 'getBasicPrice', 'purchase_price' => 'getPurchasePrice', 'additional_expenses' => 'getAdditionalExpenses', - 'cofinance_price' => 'getCofinancePrice', 'card_status' => 'getCardStatus', 'campaigns' => 'getCampaigns', 'selling_programs' => 'getSellingPrograms', - 'archived' => 'getArchived' + 'media_files' => 'getMediaFiles', + 'archived' => 'getArchived', + 'group_id' => 'getGroupId' ]; /** @@ -438,10 +450,10 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -461,6 +473,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('life_time', $data ?? [], null); $this->setIfExists('guarantee_period', $data ?? [], null); $this->setIfExists('customs_commodity_code', $data ?? [], null); + $this->setIfExists('commodity_codes', $data ?? [], null); $this->setIfExists('certificates', $data ?? [], null); $this->setIfExists('box_count', $data ?? [], null); $this->setIfExists('condition', $data ?? [], null); @@ -472,11 +485,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('basic_price', $data ?? [], null); $this->setIfExists('purchase_price', $data ?? [], null); $this->setIfExists('additional_expenses', $data ?? [], null); - $this->setIfExists('cofinance_price', $data ?? [], null); $this->setIfExists('card_status', $data ?? [], null); $this->setIfExists('campaigns', $data ?? [], null); $this->setIfExists('selling_programs', $data ?? [], null); + $this->setIfExists('media_files', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); + $this->setIfExists('group_id', $data ?? [], null); } /** @@ -517,24 +531,64 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } - if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) { - $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256."; + if (!is_null($this->container['market_category_id']) && ($this->container['market_category_id'] <= 0)) { + $invalidProperties[] = "invalid value for 'market_category_id', must be bigger than 0."; } - if (!is_null($this->container['videos']) && (count($this->container['videos']) > 6)) { - $invalidProperties[] = "invalid value for 'videos', number of items must be less than or equal to 6."; + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; } - if (!is_null($this->container['manuals']) && (count($this->container['manuals']) > 6)) { - $invalidProperties[] = "invalid value for 'manuals', number of items must be less than or equal to 6."; + if (!is_null($this->container['videos']) && (count($this->container['videos']) < 1)) { + $invalidProperties[] = "invalid value for 'videos', number of items must be greater than or equal to 1."; } - if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { - $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 6000."; + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) < 1)) { + $invalidProperties[] = "invalid value for 'manuals', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) > 50)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['commodity_codes']) && (count($this->container['commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['certificates']) && (count($this->container['certificates']) < 1)) { + $invalidProperties[] = "invalid value for 'certificates', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['box_count']) && ($this->container['box_count'] < 1)) { + $invalidProperties[] = "invalid value for 'box_count', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['params']) && (count($this->container['params']) < 1)) { + $invalidProperties[] = "invalid value for 'params', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaigns']) && (count($this->container['campaigns']) < 1)) { + $invalidProperties[] = "invalid value for 'campaigns', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['selling_programs']) && (count($this->container['selling_programs']) < 1)) { + $invalidProperties[] = "invalid value for 'selling_programs', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -565,7 +619,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -580,8 +634,8 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling GetOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling GetOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling GetOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -611,10 +665,6 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($name)) { throw new \InvalidArgumentException('non-nullable name cannot be null'); } - if ((mb_strlen($name) > 256)) { - throw new \InvalidArgumentException('invalid length for $name when calling GetOfferDTO., must be smaller than or equal to 256.'); - } - $this->container['name'] = $name; return $this; @@ -633,7 +683,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_category_id * - * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. Если не указать `marketCategoryId`, то маркетная категория будет определена автоматически. При изменении информации о товаре передавайте тот же идентификатор категории. Если вы укажете другой, категория товара не поменяется. Изменить ее можно только в кабинете продавца на Маркете. Список категорий Маркета можно получить с помощью запроса [POST categories/tree](../../reference/categories/getCategoriesTree.md). + * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. {% note warning \"Всегда указывайте, когда передаете `parameterValues`\" %} Если при изменении характеристик передать `parameterValues` и не указать `marketCategoryId`, характеристики обновятся, но в ответе придет предупреждение (параметр `warnings`). Если не передать их оба, будет использована информация из устаревших параметров `params` и `category`, а `marketCategoryId` будет определен автоматически. {% endnote %} При изменении категории убедитесь, что характеристики товара и их значения в параметре `parameterValues` вы передаете для новой категории. Список категорий Маркета можно получить с помощью запроса [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). * * @return self */ @@ -642,6 +692,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($market_category_id)) { throw new \InvalidArgumentException('non-nullable market_category_id cannot be null'); } + + if (($market_category_id <= 0)) { + throw new \InvalidArgumentException('invalid value for $market_category_id when calling GetOfferDTO., must be bigger than 0.'); + } + $this->container['market_category_id'] = $market_category_id; return $this; @@ -651,6 +706,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -660,9 +716,10 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -703,6 +760,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -721,7 +783,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets videos * - * @param string[]|null $videos Ссылка (URL) на видео товара. Максимальное количество ссылок — 6. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) + * @param string[]|null $videos Ссылки (URL) на видео товара. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) * * @return self */ @@ -738,8 +800,9 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable } } - if (!is_null($videos) && (count($videos) > 6)) { - throw new \InvalidArgumentException('invalid value for $videos when calling GetOfferDTO., number of items must be less than or equal to 6.'); + + if (!is_null($videos) && (count($videos) < 1)) { + throw new \InvalidArgumentException('invalid length for $videos when calling GetOfferDTO., number of items must be greater than or equal to 1.'); } $this->container['videos'] = $videos; @@ -759,7 +822,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets manuals * - * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. Максимальное количество инструкций — 6. Если вы передадите пустое поле `manuals`, загруженные ранее инструкции удалятся. + * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. * * @return self */ @@ -776,8 +839,9 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable } } - if (!is_null($manuals) && (count($manuals) > 6)) { - throw new \InvalidArgumentException('invalid value for $manuals when calling GetOfferDTO., number of items must be less than or equal to 6.'); + + if (!is_null($manuals) && (count($manuals) < 1)) { + throw new \InvalidArgumentException('invalid length for $manuals when calling GetOfferDTO., number of items must be greater than or equal to 1.'); } $this->container['manuals'] = $manuals; @@ -824,7 +888,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -840,6 +904,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -858,7 +927,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                                          , \\

                                          и так далее — для заголовков; * \\
                                          и \\

                                          — для переноса строки; * \\

                                            — для нумерованного списка; * \\
                                              — для маркированного списка; * \\
                                            • — для создания элементов списка (должен находиться внутри \\
                                                или \\
                                                  ); * \\
                                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                  , \\

                                                  и так далее — для заголовков; * \\
                                                  и \\

                                                  — для переноса строки; * \\

                                                    — для нумерованного списка; * \\
                                                      — для маркированного списка; * \\
                                                    • — для создания элементов списка (должен находиться внутри \\
                                                        или \\
                                                          ); * \\
                                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -867,10 +936,6 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($description)) { throw new \InvalidArgumentException('non-nullable description cannot be null'); } - if ((mb_strlen($description) > 6000)) { - throw new \InvalidArgumentException('invalid length for $description when calling GetOfferDTO., must be smaller than or equal to 6000.'); - } - $this->container['description'] = $description; return $this; @@ -905,6 +970,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -977,7 +1047,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets tags * - * @param string[]|null $tags Метки товара, используемые магазином. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега 20 символов. У одного товара может быть максимум 10 тегов. Всего можно создать не больше 50 разных тегов. + * @param string[]|null $tags Метки товара, которые использует магазин. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега — 20 символов. У одного товара может быть максимум 10 тегов. * * @return self */ @@ -993,6 +1063,13 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($tags) && (count($tags) > 50)) { + throw new \InvalidArgumentException('invalid value for $tags when calling GetOfferDTO., number of items must be less than or equal to 50.'); + } + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['tags'] = $tags; return $this; @@ -1083,6 +1160,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets customs_commodity_code * * @return string|null + * @deprecated */ public function getCustomsCommodityCode() { @@ -1092,9 +1170,10 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets customs_commodity_code * - * @param string|null $customs_commodity_code Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. + * @param string|null $customs_commodity_code {% note warning \"Вместо него используйте `commodityCodes` с типом `CUSTOMS_COMMODITY_CODE`.\" %}   {% endnote %} Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. * * @return self + * @deprecated */ public function setCustomsCommodityCode($customs_commodity_code) { @@ -1106,6 +1185,45 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets commodity_codes + * + * @return \OpenAPI\Client\Model\CommodityCodeDTO[]|null + */ + public function getCommodityCodes() + { + return $this->container['commodity_codes']; + } + + /** + * Sets commodity_codes + * + * @param \OpenAPI\Client\Model\CommodityCodeDTO[]|null $commodity_codes Товарные коды. + * + * @return self + */ + public function setCommodityCodes($commodity_codes) + { + if (is_null($commodity_codes)) { + array_push($this->openAPINullablesSetToNull, 'commodity_codes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commodity_codes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($commodity_codes) && (count($commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $commodity_codes when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } + $this->container['commodity_codes'] = $commodity_codes; + + return $this; + } + /** * Gets certificates * @@ -1135,6 +1253,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($certificates) && (count($certificates) < 1)) { + throw new \InvalidArgumentException('invalid length for $certificates when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['certificates'] = $certificates; return $this; @@ -1162,6 +1285,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($box_count)) { throw new \InvalidArgumentException('non-nullable box_count cannot be null'); } + + if (($box_count < 1)) { + throw new \InvalidArgumentException('invalid value for $box_count when calling GetOfferDTO., must be bigger than or equal to 1.'); + } + $this->container['box_count'] = $box_count; return $this; @@ -1316,7 +1444,7 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets params * - * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"\" %} Этот параметр устарел. При передаче характеристик используйте `parameterValues`. {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. + * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"При передаче характеристик используйте `parameterValues`.\" %}   {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. * * @return self * @deprecated @@ -1333,6 +1461,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($params) && (count($params) < 1)) { + throw new \InvalidArgumentException('invalid length for $params when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['params'] = $params; return $this; @@ -1419,33 +1552,6 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } - /** - * Gets cofinance_price - * - * @return \OpenAPI\Client\Model\GetPriceDTO|null - */ - public function getCofinancePrice() - { - return $this->container['cofinance_price']; - } - - /** - * Sets cofinance_price - * - * @param \OpenAPI\Client\Model\GetPriceDTO|null $cofinance_price cofinance_price - * - * @return self - */ - public function setCofinancePrice($cofinance_price) - { - if (is_null($cofinance_price)) { - throw new \InvalidArgumentException('non-nullable cofinance_price cannot be null'); - } - $this->container['cofinance_price'] = $cofinance_price; - - return $this; - } - /** * Gets card_status * @@ -1502,6 +1608,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($campaigns) && (count($campaigns) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaigns when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['campaigns'] = $campaigns; return $this; @@ -1536,11 +1647,43 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($selling_programs) && (count($selling_programs) < 1)) { + throw new \InvalidArgumentException('invalid length for $selling_programs when calling GetOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['selling_programs'] = $selling_programs; return $this; } + /** + * Gets media_files + * + * @return \OpenAPI\Client\Model\OfferMediaFilesDTO|null + */ + public function getMediaFiles() + { + return $this->container['media_files']; + } + + /** + * Sets media_files + * + * @param \OpenAPI\Client\Model\OfferMediaFilesDTO|null $media_files media_files + * + * @return self + */ + public function setMediaFiles($media_files) + { + if (is_null($media_files)) { + throw new \InvalidArgumentException('non-nullable media_files cannot be null'); + } + $this->container['media_files'] = $media_files; + + return $this; + } + /** * Gets archived * @@ -1567,14 +1710,41 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + + /** + * Gets group_id + * + * @return string|null + */ + public function getGroupId() + { + return $this->container['group_id']; + } + + /** + * Sets group_id + * + * @param string|null $group_id Идентификатор группы товаров. У товаров, которые объединены в одну группу, будет одинаковый идентификатор. [Как объединить товары на карточке](../../step-by-step/assortment-add-goods.md#combine-variants) + * + * @return self + */ + public function setGroupId($group_id) + { + if (is_null($group_id)) { + throw new \InvalidArgumentException('non-nullable group_id cannot be null'); + } + $this->container['group_id'] = $group_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1582,12 +1752,12 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1612,11 +1782,11 @@ class GetOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferMappingDTO.php b/erp24/lib/yandex_market_api/Model/GetOfferMappingDTO.php index e878cfd4..564cea85 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferMappingDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferMappingDTO.php @@ -2,7 +2,7 @@ /** * GetOfferMappingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,8 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'offer' => '\OpenAPI\Client\Model\GetOfferDTO', - 'mapping' => '\OpenAPI\Client\Model\GetMappingDTO' + 'mapping' => '\OpenAPI\Client\Model\GetMappingDTO', + 'showcase_urls' => '\OpenAPI\Client\Model\ShowcaseUrlDTO[]' ]; /** @@ -71,7 +72,8 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'offer' => null, - 'mapping' => null + 'mapping' => null, + 'showcase_urls' => null ]; /** @@ -81,7 +83,8 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'offer' => false, - 'mapping' => false + 'mapping' => false, + 'showcase_urls' => true ]; /** @@ -171,7 +174,8 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $attributeMap = [ 'offer' => 'offer', - 'mapping' => 'mapping' + 'mapping' => 'mapping', + 'showcase_urls' => 'showcaseUrls' ]; /** @@ -181,7 +185,8 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $setters = [ 'offer' => 'setOffer', - 'mapping' => 'setMapping' + 'mapping' => 'setMapping', + 'showcase_urls' => 'setShowcaseUrls' ]; /** @@ -191,7 +196,8 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $getters = [ 'offer' => 'getOffer', - 'mapping' => 'getMapping' + 'mapping' => 'getMapping', + 'showcase_urls' => 'getShowcaseUrls' ]; /** @@ -246,13 +252,14 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer', $data ?? [], null); $this->setIfExists('mapping', $data ?? [], null); + $this->setIfExists('showcase_urls', $data ?? [], null); } /** @@ -282,6 +289,10 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab { $invalidProperties = []; + if (!is_null($this->container['showcase_urls']) && (count($this->container['showcase_urls']) < 1)) { + $invalidProperties[] = "invalid value for 'showcase_urls', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -350,14 +361,53 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab return $this; } + + /** + * Gets showcase_urls + * + * @return \OpenAPI\Client\Model\ShowcaseUrlDTO[]|null + */ + public function getShowcaseUrls() + { + return $this->container['showcase_urls']; + } + + /** + * Sets showcase_urls + * + * @param \OpenAPI\Client\Model\ShowcaseUrlDTO[]|null $showcase_urls Ссылки на один и тот же товар на разных витринах Маркета. + * + * @return self + */ + public function setShowcaseUrls($showcase_urls) + { + if (is_null($showcase_urls)) { + array_push($this->openAPINullablesSetToNull, 'showcase_urls'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('showcase_urls', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($showcase_urls) && (count($showcase_urls) < 1)) { + throw new \InvalidArgumentException('invalid length for $showcase_urls when calling GetOfferMappingDTO., number of items must be greater than or equal to 1.'); + } + $this->container['showcase_urls'] = $showcase_urls; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +415,12 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +445,11 @@ class GetOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferMappingEntriesResponse.php b/erp24/lib/yandex_market_api/Model/GetOfferMappingEntriesResponse.php index 191d59cb..e2588831 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferMappingEntriesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferMappingEntriesResponse.php @@ -2,7 +2,7 @@ /** * GetOfferMappingEntriesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetOfferMappingEntriesResponse implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferMappingsRequest.php b/erp24/lib/yandex_market_api/Model/GetOfferMappingsRequest.php index c9b391de..a896b12d 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferMappingsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferMappingsRequest.php @@ -2,7 +2,7 @@ /** * GetOfferMappingsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -75,7 +75,7 @@ class GetOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPIFormats = [ 'offer_ids' => null, 'card_statuses' => null, - 'category_ids' => null, + 'category_ids' => 'int32', 'vendor_names' => null, 'tags' => null, 'archived' => null @@ -269,10 +269,10 @@ class GetOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); $this->setIfExists('card_statuses', $data ?? [], null); @@ -574,11 +574,11 @@ class GetOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -586,12 +586,12 @@ class GetOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -616,11 +616,11 @@ class GetOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferMappingsResponse.php b/erp24/lib/yandex_market_api/Model/GetOfferMappingsResponse.php index 2b75ab72..cc55db92 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferMappingsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferMappingsResponse.php @@ -2,7 +2,7 @@ /** * GetOfferMappingsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferMappingsResultDTO.php b/erp24/lib/yandex_market_api/Model/GetOfferMappingsResultDTO.php index 764927b1..3f182d23 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferMappingsResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferMappingsResultDTO.php @@ -2,7 +2,7 @@ /** * GetOfferMappingsResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetOfferMappingsResultDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('offer_mappings', $data ?? [], null); @@ -356,11 +356,11 @@ class GetOfferMappingsResultDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetOfferMappingsResultDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetOfferMappingsResultDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsRequest.php b/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsRequest.php index ed3fedd4..374abc0e 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsRequest.php @@ -2,7 +2,7 @@ /** * GetOfferRecommendationsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,8 +58,6 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPITypes = [ 'offer_ids' => 'string[]', - 'cofinance_price_filter' => '\OpenAPI\Client\Model\FieldStateType', - 'recommended_cofinance_price_filter' => '\OpenAPI\Client\Model\FieldStateType', 'competitiveness_filter' => '\OpenAPI\Client\Model\PriceCompetitivenessType' ]; @@ -72,8 +70,6 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPIFormats = [ 'offer_ids' => null, - 'cofinance_price_filter' => null, - 'recommended_cofinance_price_filter' => null, 'competitiveness_filter' => null ]; @@ -84,8 +80,6 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js */ protected static array $openAPINullables = [ 'offer_ids' => true, - 'cofinance_price_filter' => false, - 'recommended_cofinance_price_filter' => false, 'competitiveness_filter' => false ]; @@ -176,8 +170,6 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js */ protected static $attributeMap = [ 'offer_ids' => 'offerIds', - 'cofinance_price_filter' => 'cofinancePriceFilter', - 'recommended_cofinance_price_filter' => 'recommendedCofinancePriceFilter', 'competitiveness_filter' => 'competitivenessFilter' ]; @@ -188,8 +180,6 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js */ protected static $setters = [ 'offer_ids' => 'setOfferIds', - 'cofinance_price_filter' => 'setCofinancePriceFilter', - 'recommended_cofinance_price_filter' => 'setRecommendedCofinancePriceFilter', 'competitiveness_filter' => 'setCompetitivenessFilter' ]; @@ -200,8 +190,6 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js */ protected static $getters = [ 'offer_ids' => 'getOfferIds', - 'cofinance_price_filter' => 'getCofinancePriceFilter', - 'recommended_cofinance_price_filter' => 'getRecommendedCofinancePriceFilter', 'competitiveness_filter' => 'getCompetitivenessFilter' ]; @@ -257,14 +245,12 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); - $this->setIfExists('cofinance_price_filter', $data ?? [], null); - $this->setIfExists('recommended_cofinance_price_filter', $data ?? [], null); $this->setIfExists('competitiveness_filter', $data ?? [], null); } @@ -295,6 +281,10 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js { $invalidProperties = []; + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -339,61 +329,12 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['offer_ids'] = $offer_ids; - return $this; - } - - /** - * Gets cofinance_price_filter - * - * @return \OpenAPI\Client\Model\FieldStateType|null - */ - public function getCofinancePriceFilter() - { - return $this->container['cofinance_price_filter']; - } - /** - * Sets cofinance_price_filter - * - * @param \OpenAPI\Client\Model\FieldStateType|null $cofinance_price_filter cofinance_price_filter - * - * @return self - */ - public function setCofinancePriceFilter($cofinance_price_filter) - { - if (is_null($cofinance_price_filter)) { - throw new \InvalidArgumentException('non-nullable cofinance_price_filter cannot be null'); + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GetOfferRecommendationsRequest., number of items must be greater than or equal to 1.'); } - $this->container['cofinance_price_filter'] = $cofinance_price_filter; - - return $this; - } - - /** - * Gets recommended_cofinance_price_filter - * - * @return \OpenAPI\Client\Model\FieldStateType|null - */ - public function getRecommendedCofinancePriceFilter() - { - return $this->container['recommended_cofinance_price_filter']; - } - - /** - * Sets recommended_cofinance_price_filter - * - * @param \OpenAPI\Client\Model\FieldStateType|null $recommended_cofinance_price_filter recommended_cofinance_price_filter - * - * @return self - */ - public function setRecommendedCofinancePriceFilter($recommended_cofinance_price_filter) - { - if (is_null($recommended_cofinance_price_filter)) { - throw new \InvalidArgumentException('non-nullable recommended_cofinance_price_filter cannot be null'); - } - $this->container['recommended_cofinance_price_filter'] = $recommended_cofinance_price_filter; + $this->container['offer_ids'] = $offer_ids; return $this; } @@ -427,11 +368,11 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -439,12 +380,12 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -469,11 +410,11 @@ class GetOfferRecommendationsRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsResponse.php b/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsResponse.php index 70e1a598..7fc9255b 100644 --- a/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOfferRecommendationsResponse.php @@ -2,7 +2,7 @@ /** * GetOfferRecommendationsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetOfferRecommendationsResponse implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOrderBuyerInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetOrderBuyerInfoResponse.php index 839efc88..0fae1d82 100644 --- a/erp24/lib/yandex_market_api/Model/GetOrderBuyerInfoResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOrderBuyerInfoResponse.php @@ -2,7 +2,7 @@ /** * GetOrderBuyerInfoResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetOrderBuyerInfoResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOrderIdentifiersStatusDTO.php b/erp24/lib/yandex_market_api/Model/GetOrderIdentifiersStatusDTO.php new file mode 100644 index 00000000..4a7f4cfd --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetOrderIdentifiersStatusDTO.php @@ -0,0 +1,413 @@ + + */ +class GetOrderIdentifiersStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetOrderIdentifiersStatusDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OpenAPI\Client\Model\OrderItemValidationStatusDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OpenAPI\Client\Model\OrderItemValidationStatusDTO[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OpenAPI\Client\Model\OrderItemValidationStatusDTO[] $items Список идентификаторов товаров и информация по проверке кодов. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetOrderIdentifiersStatusResponse.php b/erp24/lib/yandex_market_api/Model/GetOrderIdentifiersStatusResponse.php new file mode 100644 index 00000000..bf022cef --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetOrderIdentifiersStatusResponse.php @@ -0,0 +1,446 @@ + + */ +class GetOrderIdentifiersStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetOrderIdentifiersStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\GetOrderIdentifiersStatusDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\GetOrderIdentifiersStatusDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\GetOrderIdentifiersStatusDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetOrderLabelsDataResponse.php b/erp24/lib/yandex_market_api/Model/GetOrderLabelsDataResponse.php index 20275c6d..99f10a0e 100644 --- a/erp24/lib/yandex_market_api/Model/GetOrderLabelsDataResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOrderLabelsDataResponse.php @@ -2,7 +2,7 @@ /** * GetOrderLabelsDataResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetOrderLabelsDataResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOrderResponse.php b/erp24/lib/yandex_market_api/Model/GetOrderResponse.php index 0d6891b5..e8ca8f97 100644 --- a/erp24/lib/yandex_market_api/Model/GetOrderResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOrderResponse.php @@ -2,7 +2,7 @@ /** * GetOrderResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -239,10 +239,10 @@ class GetOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order', $data ?? [], null); } @@ -318,11 +318,11 @@ class GetOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -330,12 +330,12 @@ class GetOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -360,11 +360,11 @@ class GetOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOrdersResponse.php b/erp24/lib/yandex_market_api/Model/GetOrdersResponse.php index 5d6f4394..6581e430 100644 --- a/erp24/lib/yandex_market_api/Model/GetOrdersResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOrdersResponse.php @@ -2,7 +2,7 @@ /** * GetOrdersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GetOrdersResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('pager', $data ?? [], null); $this->setIfExists('orders', $data ?? [], null); @@ -398,11 +398,11 @@ class GetOrdersResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -410,12 +410,12 @@ class GetOrdersResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -440,11 +440,11 @@ class GetOrdersResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOrdersStatsRequest.php b/erp24/lib/yandex_market_api/Model/GetOrdersStatsRequest.php index deefc75c..eddd1174 100644 --- a/erp24/lib/yandex_market_api/Model/GetOrdersStatsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetOrdersStatsRequest.php @@ -2,7 +2,7 @@ /** * GetOrdersStatsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -276,10 +276,10 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('date_from', $data ?? [], null); $this->setIfExists('date_to', $data ?? [], null); @@ -317,6 +317,14 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if (!is_null($this->container['orders']) && (count($this->container['orders']) < 1)) { + $invalidProperties[] = "invalid value for 'orders', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['statuses']) && (count($this->container['statuses']) < 1)) { + $invalidProperties[] = "invalid value for 'statuses', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -399,7 +407,7 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets update_from * - * @param \DateTime|null $update_from Начальная дата периода, за который были изменения статуса заказа. Формат даты: `ГГГГ‑ММ‑ДД`. Нельзя использовать вместе с параметрами `dateFrom` и `dateTo`. + * @param \DateTime|null $update_from Начальная дата периода, за который были изменения в заказе (например, статуса или информации о платежах). Формат даты: `ГГГГ‑ММ‑ДД`. Нельзя использовать вместе с параметрами `dateFrom` и `dateTo`. * * @return self */ @@ -426,7 +434,7 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets update_to * - * @param \DateTime|null $update_to Конечная дата периода, за который были изменения статуса заказа. Формат даты: `ГГГГ‑ММ‑ДД`. Нельзя использовать вместе с параметрами `dateFrom` и `dateTo`. + * @param \DateTime|null $update_to Конечная дата периода, за который были изменения в заказе (например, статуса или информации о платежах). Формат даты: `ГГГГ‑ММ‑ДД`. Нельзя использовать вместе с параметрами `dateFrom` и `dateTo`. * * @return self */ @@ -469,6 +477,11 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($orders) && (count($orders) < 1)) { + throw new \InvalidArgumentException('invalid length for $orders when calling GetOrdersStatsRequest., number of items must be greater than or equal to 1.'); + } $this->container['orders'] = $orders; return $this; @@ -503,6 +516,11 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($statuses) && (count($statuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $statuses when calling GetOrdersStatsRequest., number of items must be greater than or equal to 1.'); + } $this->container['statuses'] = $statuses; return $this; @@ -521,7 +539,7 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets has_cis * - * @param bool|null $has_cis Нужно ли вернуть только те заказы, в составе которых есть хотя бы один товар с кодом идентификации [в системе «Честный ЗНАК»](https://честныйзнак.рф/): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. + * @param bool|null $has_cis Фильтр для получения заказов, в которых есть хотя бы один товар с кодом идентификации в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]): * `true` — да. * `false` — нет. Такие коды присваиваются товарам, которые подлежат маркировке и относятся к определенным категориям. * * @return self */ @@ -537,11 +555,11 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -549,12 +567,12 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -579,11 +597,11 @@ class GetOrdersStatsRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOrdersStatsResponse.php b/erp24/lib/yandex_market_api/Model/GetOrdersStatsResponse.php index e0bf0280..407b71f7 100644 --- a/erp24/lib/yandex_market_api/Model/GetOrdersStatsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOrdersStatsResponse.php @@ -2,7 +2,7 @@ /** * GetOrdersStatsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetOrdersStatsResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOutletLicensesResponse.php b/erp24/lib/yandex_market_api/Model/GetOutletLicensesResponse.php index 22479ed8..7e166f1f 100644 --- a/erp24/lib/yandex_market_api/Model/GetOutletLicensesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOutletLicensesResponse.php @@ -2,7 +2,7 @@ /** * GetOutletLicensesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetOutletLicensesResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOutletResponse.php b/erp24/lib/yandex_market_api/Model/GetOutletResponse.php index 89c53ccc..eac4b8fe 100644 --- a/erp24/lib/yandex_market_api/Model/GetOutletResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOutletResponse.php @@ -2,7 +2,7 @@ /** * GetOutletResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('outlet', $data ?? [], null); } @@ -319,11 +319,11 @@ class GetOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class GetOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class GetOutletResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetOutletsResponse.php b/erp24/lib/yandex_market_api/Model/GetOutletsResponse.php index dda0489e..2d4d1605 100644 --- a/erp24/lib/yandex_market_api/Model/GetOutletsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetOutletsResponse.php @@ -2,7 +2,7 @@ /** * GetOutletsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GetOutletsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('outlets', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -390,11 +390,11 @@ class GetOutletsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class GetOutletsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class GetOutletsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPagedWarehousesRequest.php b/erp24/lib/yandex_market_api/Model/GetPagedWarehousesRequest.php new file mode 100644 index 00000000..5a6b0e07 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetPagedWarehousesRequest.php @@ -0,0 +1,482 @@ + + */ +class GetPagedWarehousesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetPagedWarehousesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'components' => '\OpenAPI\Client\Model\WarehouseComponentType[]', + 'campaign_ids' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'components' => null, + 'campaign_ids' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'components' => true, + 'campaign_ids' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'components' => 'components', + 'campaign_ids' => 'campaignIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'components' => 'setComponents', + 'campaign_ids' => 'setCampaignIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'components' => 'getComponents', + 'campaign_ids' => 'getCampaignIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('components', $data ?? [], null); + $this->setIfExists('campaign_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['components']) && (count($this->container['components']) < 1)) { + $invalidProperties[] = "invalid value for 'components', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) > 25)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be less than or equal to 25."; + } + + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets components + * + * @return \OpenAPI\Client\Model\WarehouseComponentType[]|null + */ + public function getComponents() + { + return $this->container['components']; + } + + /** + * Sets components + * + * @param \OpenAPI\Client\Model\WarehouseComponentType[]|null $components Свойства складов, которые необходимо вернуть. Если какое-то значение параметра не задано, этой информации в ответе не будет. Передавайте параметр, только если нужна информация, которую он возвращает. Можно передать сразу несколько значений. + * + * @return self + */ + public function setComponents($components) + { + if (is_null($components)) { + array_push($this->openAPINullablesSetToNull, 'components'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('components', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($components) && (count($components) < 1)) { + throw new \InvalidArgumentException('invalid length for $components when calling GetPagedWarehousesRequest., number of items must be greater than or equal to 1.'); + } + $this->container['components'] = $components; + + return $this; + } + + /** + * Gets campaign_ids + * + * @return int[]|null + */ + public function getCampaignIds() + { + return $this->container['campaign_ids']; + } + + /** + * Sets campaign_ids + * + * @param int[]|null $campaign_ids Список идентификаторов кампании тех магазинов, склады которых необходимо вернуть. Их можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете — нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не используйте вместо них идентификаторы магазинов, которые указаны в кабинете продавца на Маркете рядом с названием магазина и в некоторых отчетах. + * + * @return self + */ + public function setCampaignIds($campaign_ids) + { + if (is_null($campaign_ids)) { + array_push($this->openAPINullablesSetToNull, 'campaign_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('campaign_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($campaign_ids) && (count($campaign_ids) > 25)) { + throw new \InvalidArgumentException('invalid value for $campaign_ids when calling GetPagedWarehousesRequest., number of items must be less than or equal to 25.'); + } + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling GetPagedWarehousesRequest., number of items must be greater than or equal to 1.'); + } + $this->container['campaign_ids'] = $campaign_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetPagedWarehousesResponse.php b/erp24/lib/yandex_market_api/Model/GetPagedWarehousesResponse.php new file mode 100644 index 00000000..aad2a19a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetPagedWarehousesResponse.php @@ -0,0 +1,446 @@ + + */ +class GetPagedWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetPagedWarehousesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\PagedWarehousesDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\PagedWarehousesDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\PagedWarehousesDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetPriceDTO.php b/erp24/lib/yandex_market_api/Model/GetPriceDTO.php index c37e0dbc..e1efc7a5 100644 --- a/erp24/lib/yandex_market_api/Model/GetPriceDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPriceDTO.php @@ -2,7 +2,7 @@ /** * GetPriceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GetPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('currency_id', $data ?? [], null); @@ -330,7 +330,7 @@ class GetPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets value * - * @param float $value Значение. + * @param float $value Цена товара. * * @return self */ @@ -405,11 +405,11 @@ class GetPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -417,12 +417,12 @@ class GetPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -447,11 +447,11 @@ class GetPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPriceWithDiscountDTO.php b/erp24/lib/yandex_market_api/Model/GetPriceWithDiscountDTO.php index 11276ac2..1626ab71 100644 --- a/erp24/lib/yandex_market_api/Model/GetPriceWithDiscountDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPriceWithDiscountDTO.php @@ -2,7 +2,7 @@ /** * GetPriceWithDiscountDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GetPriceWithDiscountDTO Class Doc Comment * * @category Class - * @description Цена с указанием скидки и времени последнего обновления. + * @description Цена с указанием валюты, скидки и времени последнего обновления. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -258,10 +258,10 @@ class GetPriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('currency_id', $data ?? [], null); @@ -341,7 +341,7 @@ class GetPriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets value * - * @param float $value Значение. + * @param float $value Цена товара. * * @return self */ @@ -400,7 +400,7 @@ class GetPriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets discount_base * - * @param float|null $discount_base Цена до скидки. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. + * @param float|null $discount_base Зачеркнутая цена. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. * * @return self */ @@ -448,11 +448,11 @@ class GetPriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -460,12 +460,12 @@ class GetPriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -490,11 +490,11 @@ class GetPriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPriceWithVatDTO.php b/erp24/lib/yandex_market_api/Model/GetPriceWithVatDTO.php index 282ddd52..03c4ce83 100644 --- a/erp24/lib/yandex_market_api/Model/GetPriceWithVatDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPriceWithVatDTO.php @@ -2,7 +2,7 @@ /** * GetPriceWithVatDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GetPriceWithVatDTO Class Doc Comment * * @category Class - * @description Цена с указанием ставки НДС и времени последнего обновления. + * @description Цена с указанием НДС и времени последнего обновления. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -264,10 +264,10 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('discount_base', $data ?? [], null); @@ -303,6 +303,14 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab { $invalidProperties = []; + if (!is_null($this->container['value']) && ($this->container['value'] <= 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than 0."; + } + + if (!is_null($this->container['discount_base']) && ($this->container['discount_base'] <= 0)) { + $invalidProperties[] = "invalid value for 'discount_base', must be bigger than 0."; + } + if ($this->container['updated_at'] === null) { $invalidProperties[] = "'updated_at' can't be null"; } @@ -334,7 +342,7 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets value * - * @param float|null $value Цена на товар. + * @param float|null $value Цена товара. * * @return self */ @@ -343,6 +351,11 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab if (is_null($value)) { throw new \InvalidArgumentException('non-nullable value cannot be null'); } + + if (($value <= 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling GetPriceWithVatDTO., must be bigger than 0.'); + } + $this->container['value'] = $value; return $this; @@ -361,7 +374,7 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets discount_base * - * @param float|null $discount_base Цена на товар без скидки. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. + * @param float|null $discount_base Зачеркнутая цена. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. * * @return self */ @@ -370,6 +383,11 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab if (is_null($discount_base)) { throw new \InvalidArgumentException('non-nullable discount_base cannot be null'); } + + if (($discount_base <= 0)) { + throw new \InvalidArgumentException('invalid value for $discount_base when calling GetPriceWithVatDTO., must be bigger than 0.'); + } + $this->container['discount_base'] = $discount_base; return $this; @@ -415,7 +433,7 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets vat * - * @param int|null $vat Идентификатор ставки НДС, применяемой для товара: * `2` — 10%. * `5` — 0%. * `6` — не облагается НДС. * `7` — 20%. Если параметр не указан, используется ставка НДС, установленная в кабинете. + * @param int|null $vat Идентификатор НДС, применяемый для товара: * `2` — НДС 10%. Например, используется при реализации отдельных продовольственных и медицинских товаров. * `5` — НДС 0%. Например, используется при продаже товаров, вывезенных в таможенной процедуре экспорта, или при оказании услуг по международной перевозке товаров. * `6` — НДС не облагается, используется только для отдельных видов услуг. * `7` — НДС 20%. Основной НДС с 2019 года до 1 января 2026 года. * `10` — НДС 5%. НДС для упрощенной системы налогообложения (УСН). * `11` — НДС 7%. НДС для упрощенной системы налогообложения (УСН). * `14` — НДС 22%. Основной НДС с 1 января 2026 года. Если параметр не указан, используется НДС, установленный в кабинете. **Для продавцов :no-translate[Market Yandex Go]** недоступна передача и получение НДС. * * @return self */ @@ -458,11 +476,11 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -470,12 +488,12 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -500,11 +518,11 @@ class GetPriceWithVatDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsRequest.php b/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsRequest.php index 1624c680..ede782ae 100644 --- a/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsRequest.php @@ -2,7 +2,7 @@ /** * GetPricesByOfferIdsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetPricesByOfferIdsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); } @@ -341,11 +341,11 @@ class GetPricesByOfferIdsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -353,12 +353,12 @@ class GetPricesByOfferIdsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -383,11 +383,11 @@ class GetPricesByOfferIdsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsResponse.php b/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsResponse.php index 4f4b0ef9..b629a435 100644 --- a/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetPricesByOfferIdsResponse.php @@ -2,7 +2,7 @@ /** * GetPricesByOfferIdsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetPricesByOfferIdsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPricesResponse.php b/erp24/lib/yandex_market_api/Model/GetPricesResponse.php index e0c73751..957c5159 100644 --- a/erp24/lib/yandex_market_api/Model/GetPricesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetPricesResponse.php @@ -2,7 +2,7 @@ /** * GetPricesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetPricesResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoAssortmentInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoAssortmentInfoDTO.php index 3dad78f4..7677896a 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoAssortmentInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoAssortmentInfoDTO.php @@ -2,7 +2,7 @@ /** * GetPromoAssortmentInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GetPromoAssortmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('active_offers', $data ?? [], null); $this->setIfExists('potential_offers', $data ?? [], null); @@ -320,7 +320,7 @@ class GetPromoAssortmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Sets active_offers * - * @param int $active_offers Количество товаров, которые участвуют или участвовали в акции. Учитываются только товары, которые были добавлены вручную. Об автоматическом и ручном добавлении товаров в акцию читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/marketing/promos/market/index). + * @param int $active_offers Количество товаров, которые участвуют или участвовали в акции. Не учитываются товары, которые были добавлены автоматически. Об автоматическом и ручном добавлении товаров в акцию читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/marketing/promos/market/index). * * @return self */ @@ -390,11 +390,11 @@ class GetPromoAssortmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class GetPromoAssortmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class GetPromoAssortmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoBestsellerInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoBestsellerInfoDTO.php index f53e5a74..43fc3bcb 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoBestsellerInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoBestsellerInfoDTO.php @@ -2,7 +2,7 @@ /** * GetPromoBestsellerInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,8 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPITypes = [ 'bestseller' => 'bool', - 'entry_deadline' => '\DateTime' + 'entry_deadline' => '\DateTime', + 'renewal_enabled' => 'bool' ]; /** @@ -71,7 +72,8 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPIFormats = [ 'bestseller' => null, - 'entry_deadline' => 'date-time' + 'entry_deadline' => 'date-time', + 'renewal_enabled' => null ]; /** @@ -81,7 +83,8 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static array $openAPINullables = [ 'bestseller' => false, - 'entry_deadline' => false + 'entry_deadline' => false, + 'renewal_enabled' => false ]; /** @@ -171,7 +174,8 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static $attributeMap = [ 'bestseller' => 'bestseller', - 'entry_deadline' => 'entryDeadline' + 'entry_deadline' => 'entryDeadline', + 'renewal_enabled' => 'renewalEnabled' ]; /** @@ -181,7 +185,8 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static $setters = [ 'bestseller' => 'setBestseller', - 'entry_deadline' => 'setEntryDeadline' + 'entry_deadline' => 'setEntryDeadline', + 'renewal_enabled' => 'setRenewalEnabled' ]; /** @@ -191,7 +196,8 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static $getters = [ 'bestseller' => 'getBestseller', - 'entry_deadline' => 'getEntryDeadline' + 'entry_deadline' => 'getEntryDeadline', + 'renewal_enabled' => 'getRenewalEnabled' ]; /** @@ -246,13 +252,14 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bestseller', $data ?? [], null); $this->setIfExists('entry_deadline', $data ?? [], null); + $this->setIfExists('renewal_enabled', $data ?? [], null); } /** @@ -353,14 +360,41 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer return $this; } + + /** + * Gets renewal_enabled + * + * @return bool|null + */ + public function getRenewalEnabled() + { + return $this->container['renewal_enabled']; + } + + /** + * Sets renewal_enabled + * + * @param bool|null $renewal_enabled Включен ли автоматический перенос ассортимента между акциями «Бестселлеры Маркета». О том, как это работает, читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/marketing/promos/market/bestsellers#next). Параметр возвращается только для текущих и будущих акций «Бестселлеры Маркета». + * + * @return self + */ + public function setRenewalEnabled($renewal_enabled) + { + if (is_null($renewal_enabled)) { + throw new \InvalidArgumentException('non-nullable renewal_enabled cannot be null'); + } + $this->container['renewal_enabled'] = $renewal_enabled; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +402,12 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +432,11 @@ class GetPromoBestsellerInfoDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoConstraintsDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoConstraintsDTO.php index d4130cdb..24ea641e 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoConstraintsDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoConstraintsDTO.php @@ -2,7 +2,7 @@ /** * GetPromoConstraintsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetPromoConstraintsDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('warehouse_ids', $data ?? [], null); } @@ -275,6 +275,10 @@ class GetPromoConstraintsDTO implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if (!is_null($this->container['warehouse_ids']) && (count($this->container['warehouse_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'warehouse_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -319,6 +323,11 @@ class GetPromoConstraintsDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warehouse_ids) && (count($warehouse_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $warehouse_ids when calling GetPromoConstraintsDTO., number of items must be greater than or equal to 1.'); + } $this->container['warehouse_ids'] = $warehouse_ids; return $this; @@ -326,11 +335,11 @@ class GetPromoConstraintsDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class GetPromoConstraintsDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class GetPromoConstraintsDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoDTO.php index b6a1ec5d..af85c831 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoDTO.php @@ -2,7 +2,7 @@ /** * GetPromoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -288,10 +288,10 @@ class GetPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -352,6 +352,10 @@ class GetPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['bestseller_info'] === null) { $invalidProperties[] = "'bestseller_info' can't be null"; } + if (!is_null($this->container['channels']) && (count($this->container['channels']) < 1)) { + $invalidProperties[] = "invalid value for 'channels', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -585,6 +589,11 @@ class GetPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($channels) && (count($channels) < 1)) { + throw new \InvalidArgumentException('invalid length for $channels when calling GetPromoDTO., number of items must be greater than or equal to 1.'); + } $this->container['channels'] = $channels; return $this; @@ -619,11 +628,11 @@ class GetPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -631,12 +640,12 @@ class GetPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -661,11 +670,11 @@ class GetPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoMechanicsInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoMechanicsInfoDTO.php index a09179b0..64d8d1f4 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoMechanicsInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoMechanicsInfoDTO.php @@ -2,7 +2,7 @@ /** * GetPromoMechanicsInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetPromoMechanicsInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('promocode_info', $data ?? [], null); @@ -356,11 +356,11 @@ class GetPromoMechanicsInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetPromoMechanicsInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetPromoMechanicsInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoOfferDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoOfferDTO.php index 4abda469..ac8470d6 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoOfferDTO.php @@ -2,7 +2,7 @@ /** * GetPromoOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -307,8 +307,8 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['status'] === null) { @@ -345,7 +345,7 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -360,8 +360,8 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling GetPromoOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling GetPromoOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling GetPromoOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -452,11 +452,11 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -464,12 +464,12 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -494,11 +494,11 @@ class GetPromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoOffersRequest.php b/erp24/lib/yandex_market_api/Model/GetPromoOffersRequest.php index 708f8e8a..c6da7d43 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoOffersRequest.php @@ -2,7 +2,7 @@ /** * GetPromoOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,8 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'promo_id' => 'string', - 'status_type' => '\OpenAPI\Client\Model\PromoOfferParticipationStatusFilterType' + 'status_type' => '\OpenAPI\Client\Model\PromoOfferParticipationStatusFilterType', + 'statuses' => '\OpenAPI\Client\Model\PromoOfferParticipationStatusMultiFilterType[]' ]; /** @@ -71,7 +72,8 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPIFormats = [ 'promo_id' => null, - 'status_type' => null + 'status_type' => null, + 'statuses' => null ]; /** @@ -81,7 +83,8 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'promo_id' => false, - 'status_type' => false + 'status_type' => false, + 'statuses' => true ]; /** @@ -171,7 +174,8 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $attributeMap = [ 'promo_id' => 'promoId', - 'status_type' => 'statusType' + 'status_type' => 'statusType', + 'statuses' => 'statuses' ]; /** @@ -181,7 +185,8 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $setters = [ 'promo_id' => 'setPromoId', - 'status_type' => 'setStatusType' + 'status_type' => 'setStatusType', + 'statuses' => 'setStatuses' ]; /** @@ -191,7 +196,8 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $getters = [ 'promo_id' => 'getPromoId', - 'status_type' => 'getStatusType' + 'status_type' => 'getStatusType', + 'statuses' => 'getStatuses' ]; /** @@ -246,13 +252,14 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('promo_id', $data ?? [], null); $this->setIfExists('status_type', $data ?? [], null); + $this->setIfExists('statuses', $data ?? [], null); } /** @@ -285,6 +292,10 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali if ($this->container['promo_id'] === null) { $invalidProperties[] = "'promo_id' can't be null"; } + if (!is_null($this->container['statuses']) && (count($this->container['statuses']) < 1)) { + $invalidProperties[] = "invalid value for 'statuses', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -353,14 +364,53 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali return $this; } + + /** + * Gets statuses + * + * @return \OpenAPI\Client\Model\PromoOfferParticipationStatusMultiFilterType[]|null + */ + public function getStatuses() + { + return $this->container['statuses']; + } + + /** + * Sets statuses + * + * @param \OpenAPI\Client\Model\PromoOfferParticipationStatusMultiFilterType[]|null $statuses Фильтр для товаров, которые могут участвовать в акции. Можно задать несколько значений. + * + * @return self + */ + public function setStatuses($statuses) + { + if (is_null($statuses)) { + array_push($this->openAPINullablesSetToNull, 'statuses'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('statuses', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($statuses) && (count($statuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $statuses when calling GetPromoOffersRequest., number of items must be greater than or equal to 1.'); + } + $this->container['statuses'] = $statuses; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +418,12 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +448,11 @@ class GetPromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoOffersResponse.php b/erp24/lib/yandex_market_api/Model/GetPromoOffersResponse.php index 9f91e27b..e40df36f 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoOffersResponse.php @@ -2,7 +2,7 @@ /** * GetPromoOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetPromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoOffersResultDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoOffersResultDTO.php index 3898f3e9..11ef6a36 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoOffersResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoOffersResultDTO.php @@ -2,7 +2,7 @@ /** * GetPromoOffersResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetPromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class GetPromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetPromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetPromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromoPromocodeInfoDTO.php b/erp24/lib/yandex_market_api/Model/GetPromoPromocodeInfoDTO.php index 9a521284..7bc6d931 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromoPromocodeInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromoPromocodeInfoDTO.php @@ -2,7 +2,7 @@ /** * GetPromoPromocodeInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetPromoPromocodeInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('promocode', $data ?? [], null); $this->setIfExists('discount', $data ?? [], null); @@ -359,11 +359,11 @@ class GetPromoPromocodeInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class GetPromoPromocodeInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class GetPromoPromocodeInfoDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromosRequest.php b/erp24/lib/yandex_market_api/Model/GetPromosRequest.php index faf1beff..4caabd59 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromosRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetPromosRequest.php @@ -2,7 +2,7 @@ /** * GetPromosRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetPromosRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('participation', $data ?? [], null); $this->setIfExists('mechanics', $data ?? [], null); @@ -353,11 +353,11 @@ class GetPromosRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class GetPromosRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class GetPromosRequest implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromosResponse.php b/erp24/lib/yandex_market_api/Model/GetPromosResponse.php index ebc1b0d0..9d9c118c 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromosResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetPromosResponse.php @@ -2,7 +2,7 @@ /** * GetPromosResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetPromosResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetPromosResultDTO.php b/erp24/lib/yandex_market_api/Model/GetPromosResultDTO.php index e789888c..38ef5156 100644 --- a/erp24/lib/yandex_market_api/Model/GetPromosResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetPromosResultDTO.php @@ -2,7 +2,7 @@ /** * GetPromosResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetPromosResultDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('promos', $data ?? [], null); } @@ -322,11 +322,11 @@ class GetPromosResultDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class GetPromosResultDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class GetPromosResultDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQualityRatingDetailsResponse.php b/erp24/lib/yandex_market_api/Model/GetQualityRatingDetailsResponse.php index b8886398..3b1e30a9 100644 --- a/erp24/lib/yandex_market_api/Model/GetQualityRatingDetailsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetQualityRatingDetailsResponse.php @@ -2,7 +2,7 @@ /** * GetQualityRatingDetailsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetQualityRatingDetailsResponse implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQualityRatingRequest.php b/erp24/lib/yandex_market_api/Model/GetQualityRatingRequest.php index d95cf842..3c47573e 100644 --- a/erp24/lib/yandex_market_api/Model/GetQualityRatingRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetQualityRatingRequest.php @@ -2,7 +2,7 @@ /** * GetQualityRatingRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GetQualityRatingRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('date_from', $data ?? [], null); $this->setIfExists('date_to', $data ?? [], null); @@ -382,7 +382,7 @@ class GetQualityRatingRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets campaign_ids * - * @param int[] $campaign_ids Список идентификаторов магазинов. + * @param int[] $campaign_ids Список идентификаторов кампаний магазинов. * * @return self */ @@ -405,11 +405,11 @@ class GetQualityRatingRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -417,12 +417,12 @@ class GetQualityRatingRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -447,11 +447,11 @@ class GetQualityRatingRequest implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQualityRatingResponse.php b/erp24/lib/yandex_market_api/Model/GetQualityRatingResponse.php index f1e5b041..21493ec7 100644 --- a/erp24/lib/yandex_market_api/Model/GetQualityRatingResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetQualityRatingResponse.php @@ -2,7 +2,7 @@ /** * GetQualityRatingResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetQualityRatingResponse implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQuarantineOffersRequest.php b/erp24/lib/yandex_market_api/Model/GetQuarantineOffersRequest.php index e996846a..2677df13 100644 --- a/erp24/lib/yandex_market_api/Model/GetQuarantineOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetQuarantineOffersRequest.php @@ -2,7 +2,7 @@ /** * GetQuarantineOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GetQuarantineOffersRequest Class Doc Comment * * @category Class - * @description Фильтрации товаров В запросе можно указать либо фильтр offerIds, либо любые другие фильтры товаров. Совместное использование фильтра offerIds с другими фильтрациями приведет к ошибке. + * @description Фильтрации товаров В запросе можно указать либо фильтр `offerIds, либо любые другие фильтры товаров. Совместное использование фильтра offerIds с другими фильтрациями приведет к ошибке. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -75,7 +75,7 @@ class GetQuarantineOffersRequest implements ModelInterface, ArrayAccess, \JsonSe protected static $openAPIFormats = [ 'offer_ids' => null, 'card_statuses' => null, - 'category_ids' => null, + 'category_ids' => 'int32', 'vendor_names' => null, 'tags' => null ]; @@ -264,10 +264,10 @@ class GetQuarantineOffersRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_ids', $data ?? [], null); $this->setIfExists('card_statuses', $data ?? [], null); @@ -541,11 +541,11 @@ class GetQuarantineOffersRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -553,12 +553,12 @@ class GetQuarantineOffersRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -583,11 +583,11 @@ class GetQuarantineOffersRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResponse.php b/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResponse.php index 75bfd660..36094fb8 100644 --- a/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResponse.php @@ -2,7 +2,7 @@ /** * GetQuarantineOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetQuarantineOffersResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResultDTO.php b/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResultDTO.php index db7f38e3..a8749d9d 100644 --- a/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetQuarantineOffersResultDTO.php @@ -2,7 +2,7 @@ /** * GetQuarantineOffersResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetQuarantineOffersResultDTO implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('offers', $data ?? [], null); @@ -356,11 +356,11 @@ class GetQuarantineOffersResultDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetQuarantineOffersResultDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetQuarantineOffersResultDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetQuestionsRequest.php b/erp24/lib/yandex_market_api/Model/GetQuestionsRequest.php new file mode 100644 index 00000000..c104d934 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetQuestionsRequest.php @@ -0,0 +1,562 @@ + + */ +class GetQuestionsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetQuestionsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'category_ids' => 'int[]', + 'date_from' => '\DateTime', + 'date_to' => '\DateTime', + 'need_answer' => 'bool', + 'sort' => '\OpenAPI\Client\Model\QuestionSortOrderType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'category_ids' => 'int64', + 'date_from' => 'date', + 'date_to' => 'date', + 'need_answer' => null, + 'sort' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'category_ids' => true, + 'date_from' => false, + 'date_to' => false, + 'need_answer' => false, + 'sort' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'category_ids' => 'categoryIds', + 'date_from' => 'dateFrom', + 'date_to' => 'dateTo', + 'need_answer' => 'needAnswer', + 'sort' => 'sort' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category_ids' => 'setCategoryIds', + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo', + 'need_answer' => 'setNeedAnswer', + 'sort' => 'setSort' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category_ids' => 'getCategoryIds', + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo', + 'need_answer' => 'getNeedAnswer', + 'sort' => 'getSort' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('category_ids', $data ?? [], null); + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + $this->setIfExists('need_answer', $data ?? [], false); + $this->setIfExists('sort', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['category_ids']) && (count($this->container['category_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'category_ids', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets category_ids + * + * @return int[]|null + */ + public function getCategoryIds() + { + return $this->container['category_ids']; + } + + /** + * Sets category_ids + * + * @param int[]|null $category_ids Идентификаторы категорий товаров. + * + * @return self + */ + public function setCategoryIds($category_ids) + { + if (is_null($category_ids)) { + array_push($this->openAPINullablesSetToNull, 'category_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('category_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($category_ids) && (count($category_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $category_ids when calling GetQuestionsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['category_ids'] = $category_ids; + + return $this; + } + + /** + * Gets date_from + * + * @return \DateTime|null + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime|null $date_from Дата начала периода создания вопроса. Если параметр не указан, возвращается информация за 1 месяц до указанной в `dateTo` даты. Максимальный интервал 1 месяц. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + throw new \InvalidArgumentException('non-nullable date_from cannot be null'); + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime|null + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime|null $date_to Дата окончания периода создания вопроса. Если параметр не указан, используется текущая дата. Максимальный интервал 1 месяц. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + throw new \InvalidArgumentException('non-nullable date_to cannot be null'); + } + $this->container['date_to'] = $date_to; + + return $this; + } + + /** + * Gets need_answer + * + * @return bool|null + */ + public function getNeedAnswer() + { + return $this->container['need_answer']; + } + + /** + * Sets need_answer + * + * @param bool|null $need_answer Нужен ли ответ на вопрос. * `true` — только вопросы, которые ждут ответа. * `false` — все вопросы. + * + * @return self + */ + public function setNeedAnswer($need_answer) + { + if (is_null($need_answer)) { + throw new \InvalidArgumentException('non-nullable need_answer cannot be null'); + } + $this->container['need_answer'] = $need_answer; + + return $this; + } + + /** + * Gets sort + * + * @return \OpenAPI\Client\Model\QuestionSortOrderType|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param \OpenAPI\Client\Model\QuestionSortOrderType|null $sort sort + * + * @return self + */ + public function setSort($sort) + { + if (is_null($sort)) { + throw new \InvalidArgumentException('non-nullable sort cannot be null'); + } + $this->container['sort'] = $sort; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetQuestionsResponse.php b/erp24/lib/yandex_market_api/Model/GetQuestionsResponse.php new file mode 100644 index 00000000..4fab6af4 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetQuestionsResponse.php @@ -0,0 +1,447 @@ + + */ +class GetQuestionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetQuestionsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\QuestionListDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\QuestionListDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\QuestionListDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetRegionWithChildrenResponse.php b/erp24/lib/yandex_market_api/Model/GetRegionWithChildrenResponse.php index 6ece2ca5..f630bb07 100644 --- a/erp24/lib/yandex_market_api/Model/GetRegionWithChildrenResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetRegionWithChildrenResponse.php @@ -2,7 +2,7 @@ /** * GetRegionWithChildrenResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,7 +58,7 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPITypes = [ 'pager' => '\OpenAPI\Client\Model\FlippingPagerDTO', - 'regions' => '\OpenAPI\Client\Model\RegionDTO' + 'regions' => '\OpenAPI\Client\Model\RegionWithChildrenDTO' ]; /** @@ -245,10 +245,10 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('pager', $data ?? [], null); $this->setIfExists('regions', $data ?? [], null); @@ -326,7 +326,7 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso /** * Gets regions * - * @return \OpenAPI\Client\Model\RegionDTO|null + * @return \OpenAPI\Client\Model\RegionWithChildrenDTO|null */ public function getRegions() { @@ -336,7 +336,7 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso /** * Sets regions * - * @param \OpenAPI\Client\Model\RegionDTO|null $regions regions + * @param \OpenAPI\Client\Model\RegionWithChildrenDTO|null $regions regions * * @return self */ @@ -352,11 +352,11 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +364,12 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +394,11 @@ class GetRegionWithChildrenResponse implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetRegionsCodesResponse.php b/erp24/lib/yandex_market_api/Model/GetRegionsCodesResponse.php new file mode 100644 index 00000000..1c28e0e9 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetRegionsCodesResponse.php @@ -0,0 +1,412 @@ + + */ +class GetRegionsCodesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetRegionsCodesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'countries' => '\OpenAPI\Client\Model\CountryDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'countries' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'countries' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'countries' => 'countries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'countries' => 'setCountries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'countries' => 'getCountries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('countries', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['countries'] === null) { + $invalidProperties[] = "'countries' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets countries + * + * @return \OpenAPI\Client\Model\CountryDTO[] + */ + public function getCountries() + { + return $this->container['countries']; + } + + /** + * Sets countries + * + * @param \OpenAPI\Client\Model\CountryDTO[] $countries Список стран с их кодами в формате :no-translate[ISO 3166-1 alpha-2]. + * + * @return self + */ + public function setCountries($countries) + { + if (is_null($countries)) { + throw new \InvalidArgumentException('non-nullable countries cannot be null'); + } + $this->container['countries'] = $countries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetRegionsResponse.php b/erp24/lib/yandex_market_api/Model/GetRegionsResponse.php index 3027c9ab..a4cffe4c 100644 --- a/erp24/lib/yandex_market_api/Model/GetRegionsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetRegionsResponse.php @@ -2,7 +2,7 @@ /** * GetRegionsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetRegionsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('regions', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -355,11 +355,11 @@ class GetRegionsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -367,12 +367,12 @@ class GetRegionsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -397,11 +397,11 @@ class GetRegionsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetReportInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetReportInfoResponse.php index db0b154d..bcbc83b8 100644 --- a/erp24/lib/yandex_market_api/Model/GetReportInfoResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetReportInfoResponse.php @@ -2,7 +2,7 @@ /** * GetReportInfoResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GetReportInfoResponse Class Doc Comment * * @category Class - * @description Ответ на запрос информации об отчете. + * @description Ответ на запрос информации об отчете или документе. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetReportInfoResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetReturnResponse.php b/erp24/lib/yandex_market_api/Model/GetReturnResponse.php index a48eba1b..9acc7973 100644 --- a/erp24/lib/yandex_market_api/Model/GetReturnResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetReturnResponse.php @@ -2,7 +2,7 @@ /** * GetReturnResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetReturnResponse implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetReturnsResponse.php b/erp24/lib/yandex_market_api/Model/GetReturnsResponse.php index c1d8b295..c4637ce8 100644 --- a/erp24/lib/yandex_market_api/Model/GetReturnsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetReturnsResponse.php @@ -2,7 +2,7 @@ /** * GetReturnsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetReturnsResponse implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetShipmentOrdersInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetShipmentOrdersInfoResponse.php index 27d6004f..01d551af 100644 --- a/erp24/lib/yandex_market_api/Model/GetShipmentOrdersInfoResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetShipmentOrdersInfoResponse.php @@ -2,7 +2,7 @@ /** * GetShipmentOrdersInfoResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetShipmentOrdersInfoResponse implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetShipmentResponse.php b/erp24/lib/yandex_market_api/Model/GetShipmentResponse.php index 6cacd439..e002a19d 100644 --- a/erp24/lib/yandex_market_api/Model/GetShipmentResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetShipmentResponse.php @@ -2,7 +2,7 @@ /** * GetShipmentResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetShipmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesRequest.php b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesRequest.php index 9163e1b7..3ba39102 100644 --- a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesRequest.php @@ -2,7 +2,7 @@ /** * GetSuggestedOfferMappingEntriesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetSuggestedOfferMappingEntriesRequest implements ModelInterface, ArrayAcc /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -337,11 +337,11 @@ class GetSuggestedOfferMappingEntriesRequest implements ModelInterface, ArrayAcc /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class GetSuggestedOfferMappingEntriesRequest implements ModelInterface, ArrayAcc /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class GetSuggestedOfferMappingEntriesRequest implements ModelInterface, ArrayAcc /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesResponse.php b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesResponse.php index d8e8fdee..453b06a3 100644 --- a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingEntriesResponse.php @@ -2,7 +2,7 @@ /** * GetSuggestedOfferMappingEntriesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class GetSuggestedOfferMappingEntriesResponse implements ModelInterface, ArrayAc /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsRequest.php b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsRequest.php index 6a18c86d..015833fc 100644 --- a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsRequest.php @@ -2,7 +2,7 @@ /** * GetSuggestedOfferMappingsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -239,10 +239,10 @@ class GetSuggestedOfferMappingsRequest implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -340,11 +340,11 @@ class GetSuggestedOfferMappingsRequest implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -352,12 +352,12 @@ class GetSuggestedOfferMappingsRequest implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -382,11 +382,11 @@ class GetSuggestedOfferMappingsRequest implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResponse.php b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResponse.php index 52b4e4b7..3a80cc70 100644 --- a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResponse.php @@ -2,7 +2,7 @@ /** * GetSuggestedOfferMappingsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetSuggestedOfferMappingsResponse implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResultDTO.php b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResultDTO.php index a68dce69..0273f22a 100644 --- a/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetSuggestedOfferMappingsResultDTO.php @@ -2,7 +2,7 @@ /** * GetSuggestedOfferMappingsResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GetSuggestedOfferMappingsResultDTO implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -322,11 +322,11 @@ class GetSuggestedOfferMappingsResultDTO implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class GetSuggestedOfferMappingsResultDTO implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class GetSuggestedOfferMappingsResultDTO implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsDTO.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsDTO.php new file mode 100644 index 00000000..000ebad7 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsDTO.php @@ -0,0 +1,422 @@ + + */ +class GetSupplyRequestDocumentsDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestDocumentsDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'documents' => '\OpenAPI\Client\Model\SupplyRequestDocumentDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'documents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'documents' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'documents' => 'documents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'documents' => 'setDocuments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'documents' => 'getDocuments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('documents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['documents'] === null) { + $invalidProperties[] = "'documents' can't be null"; + } + if ((count($this->container['documents']) < 0)) { + $invalidProperties[] = "invalid value for 'documents', number of items must be greater than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets documents + * + * @return \OpenAPI\Client\Model\SupplyRequestDocumentDTO[] + */ + public function getDocuments() + { + return $this->container['documents']; + } + + /** + * Sets documents + * + * @param \OpenAPI\Client\Model\SupplyRequestDocumentDTO[] $documents Список документов. + * + * @return self + */ + public function setDocuments($documents) + { + if (is_null($documents)) { + throw new \InvalidArgumentException('non-nullable documents cannot be null'); + } + + + if ((count($documents) < 0)) { + throw new \InvalidArgumentException('invalid length for $documents when calling GetSupplyRequestDocumentsDTO., number of items must be greater than or equal to 0.'); + } + $this->container['documents'] = $documents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsRequest.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsRequest.php new file mode 100644 index 00000000..e6906029 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsRequest.php @@ -0,0 +1,421 @@ + + */ +class GetSupplyRequestDocumentsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestDocumentsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'requestId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('request_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if (($this->container['request_id'] < 1)) { + $invalidProperties[] = "invalid value for 'request_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets request_id + * + * @return int + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param int $request_id Идентификатор заявки. {% note warning \"Используется только в API\" %} По нему не получится найти заявки в кабинете продавца на Маркете. Для этого используйте `marketplaceRequestId` или `warehouseRequestId`. {% endnote %} + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + + if (($request_id < 1)) { + throw new \InvalidArgumentException('invalid value for $request_id when calling GetSupplyRequestDocumentsRequest., must be bigger than or equal to 1.'); + } + + $this->container['request_id'] = $request_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsResponse.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsResponse.php new file mode 100644 index 00000000..172b50fa --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestDocumentsResponse.php @@ -0,0 +1,446 @@ + + */ +class GetSupplyRequestDocumentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestDocumentsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\GetSupplyRequestDocumentsDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\GetSupplyRequestDocumentsDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\GetSupplyRequestDocumentsDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsDTO.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsDTO.php new file mode 100644 index 00000000..32f81880 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsDTO.php @@ -0,0 +1,462 @@ + + */ +class GetSupplyRequestItemsDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestItemsDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OpenAPI\Client\Model\SupplyRequestItemDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'paging' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => false, + 'paging' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'paging' => 'paging' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'paging' => 'setPaging' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'paging' => 'getPaging' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + if ((count($this->container['items']) > 100)) { + $invalidProperties[] = "invalid value for 'items', number of items must be less than or equal to 100."; + } + + if ((count($this->container['items']) < 0)) { + $invalidProperties[] = "invalid value for 'items', number of items must be greater than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OpenAPI\Client\Model\SupplyRequestItemDTO[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OpenAPI\Client\Model\SupplyRequestItemDTO[] $items Список товаров. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + + if ((count($items) > 100)) { + throw new \InvalidArgumentException('invalid value for $items when calling GetSupplyRequestItemsDTO., number of items must be less than or equal to 100.'); + } + if ((count($items) < 0)) { + throw new \InvalidArgumentException('invalid length for $items when calling GetSupplyRequestItemsDTO., number of items must be greater than or equal to 0.'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsRequest.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsRequest.php new file mode 100644 index 00000000..c28e8f01 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsRequest.php @@ -0,0 +1,421 @@ + + */ +class GetSupplyRequestItemsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestItemsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_id' => 'requestId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_id' => 'setRequestId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_id' => 'getRequestId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('request_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if (($this->container['request_id'] < 1)) { + $invalidProperties[] = "invalid value for 'request_id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets request_id + * + * @return int + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param int $request_id Идентификатор заявки. {% note warning \"Используется только в API\" %} По нему не получится найти заявки в кабинете продавца на Маркете. Для этого используйте `marketplaceRequestId` или `warehouseRequestId`. {% endnote %} + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + + if (($request_id < 1)) { + throw new \InvalidArgumentException('invalid value for $request_id when calling GetSupplyRequestItemsRequest., must be bigger than or equal to 1.'); + } + + $this->container['request_id'] = $request_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsResponse.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsResponse.php new file mode 100644 index 00000000..b1be4056 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestItemsResponse.php @@ -0,0 +1,446 @@ + + */ +class GetSupplyRequestItemsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestItemsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\GetSupplyRequestItemsDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\GetSupplyRequestItemsDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\GetSupplyRequestItemsDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestsDTO.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestsDTO.php new file mode 100644 index 00000000..b7ce4e0c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestsDTO.php @@ -0,0 +1,462 @@ + + */ +class GetSupplyRequestsDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestsDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\OpenAPI\Client\Model\SupplyRequestDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + 'paging' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'requests' => false, + 'paging' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + 'paging' => 'paging' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + 'paging' => 'setPaging' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + 'paging' => 'getPaging' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('requests', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + if ((count($this->container['requests']) > 100)) { + $invalidProperties[] = "invalid value for 'requests', number of items must be less than or equal to 100."; + } + + if ((count($this->container['requests']) < 0)) { + $invalidProperties[] = "invalid value for 'requests', number of items must be greater than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets requests + * + * @return \OpenAPI\Client\Model\SupplyRequestDTO[] + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \OpenAPI\Client\Model\SupplyRequestDTO[] $requests Список заявок. + * + * @return self + */ + public function setRequests($requests) + { + if (is_null($requests)) { + throw new \InvalidArgumentException('non-nullable requests cannot be null'); + } + + if ((count($requests) > 100)) { + throw new \InvalidArgumentException('invalid value for $requests when calling GetSupplyRequestsDTO., number of items must be less than or equal to 100.'); + } + if ((count($requests) < 0)) { + throw new \InvalidArgumentException('invalid length for $requests when calling GetSupplyRequestsDTO., number of items must be greater than or equal to 0.'); + } + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestsRequest.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestsRequest.php new file mode 100644 index 00000000..6ec85a18 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestsRequest.php @@ -0,0 +1,698 @@ + + */ +class GetSupplyRequestsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'request_ids' => 'int[]', + 'request_date_from' => '\DateTime', + 'request_date_to' => '\DateTime', + 'request_types' => '\OpenAPI\Client\Model\SupplyRequestType[]', + 'request_subtypes' => '\OpenAPI\Client\Model\SupplyRequestSubType[]', + 'request_statuses' => '\OpenAPI\Client\Model\SupplyRequestStatusType[]', + 'sorting' => '\OpenAPI\Client\Model\SupplyRequestSortingDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'request_ids' => 'int64', + 'request_date_from' => 'date-time', + 'request_date_to' => 'date-time', + 'request_types' => null, + 'request_subtypes' => null, + 'request_statuses' => null, + 'sorting' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'request_ids' => true, + 'request_date_from' => true, + 'request_date_to' => true, + 'request_types' => true, + 'request_subtypes' => true, + 'request_statuses' => true, + 'sorting' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'request_ids' => 'requestIds', + 'request_date_from' => 'requestDateFrom', + 'request_date_to' => 'requestDateTo', + 'request_types' => 'requestTypes', + 'request_subtypes' => 'requestSubtypes', + 'request_statuses' => 'requestStatuses', + 'sorting' => 'sorting' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'request_ids' => 'setRequestIds', + 'request_date_from' => 'setRequestDateFrom', + 'request_date_to' => 'setRequestDateTo', + 'request_types' => 'setRequestTypes', + 'request_subtypes' => 'setRequestSubtypes', + 'request_statuses' => 'setRequestStatuses', + 'sorting' => 'setSorting' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'request_ids' => 'getRequestIds', + 'request_date_from' => 'getRequestDateFrom', + 'request_date_to' => 'getRequestDateTo', + 'request_types' => 'getRequestTypes', + 'request_subtypes' => 'getRequestSubtypes', + 'request_statuses' => 'getRequestStatuses', + 'sorting' => 'getSorting' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('request_ids', $data ?? [], null); + $this->setIfExists('request_date_from', $data ?? [], null); + $this->setIfExists('request_date_to', $data ?? [], null); + $this->setIfExists('request_types', $data ?? [], null); + $this->setIfExists('request_subtypes', $data ?? [], null); + $this->setIfExists('request_statuses', $data ?? [], null); + $this->setIfExists('sorting', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['request_ids']) && (count($this->container['request_ids']) > 100)) { + $invalidProperties[] = "invalid value for 'request_ids', number of items must be less than or equal to 100."; + } + + if (!is_null($this->container['request_ids']) && (count($this->container['request_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'request_ids', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['request_types']) && (count($this->container['request_types']) < 1)) { + $invalidProperties[] = "invalid value for 'request_types', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['request_subtypes']) && (count($this->container['request_subtypes']) < 1)) { + $invalidProperties[] = "invalid value for 'request_subtypes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['request_statuses']) && (count($this->container['request_statuses']) < 1)) { + $invalidProperties[] = "invalid value for 'request_statuses', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets request_ids + * + * @return int[]|null + */ + public function getRequestIds() + { + return $this->container['request_ids']; + } + + /** + * Sets request_ids + * + * @param int[]|null $request_ids Идентификаторы заявок. + * + * @return self + */ + public function setRequestIds($request_ids) + { + if (is_null($request_ids)) { + array_push($this->openAPINullablesSetToNull, 'request_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request_ids', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($request_ids) && (count($request_ids) > 100)) { + throw new \InvalidArgumentException('invalid value for $request_ids when calling GetSupplyRequestsRequest., number of items must be less than or equal to 100.'); + } + if (!is_null($request_ids) && (count($request_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $request_ids when calling GetSupplyRequestsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['request_ids'] = $request_ids; + + return $this; + } + + /** + * Gets request_date_from + * + * @return \DateTime|null + */ + public function getRequestDateFrom() + { + return $this->container['request_date_from']; + } + + /** + * Sets request_date_from + * + * @param \DateTime|null $request_date_from Дата начала периода для фильтрации заявок. + * + * @return self + */ + public function setRequestDateFrom($request_date_from) + { + if (is_null($request_date_from)) { + array_push($this->openAPINullablesSetToNull, 'request_date_from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request_date_from', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['request_date_from'] = $request_date_from; + + return $this; + } + + /** + * Gets request_date_to + * + * @return \DateTime|null + */ + public function getRequestDateTo() + { + return $this->container['request_date_to']; + } + + /** + * Sets request_date_to + * + * @param \DateTime|null $request_date_to Дата окончания периода для фильтрации заявок. + * + * @return self + */ + public function setRequestDateTo($request_date_to) + { + if (is_null($request_date_to)) { + array_push($this->openAPINullablesSetToNull, 'request_date_to'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request_date_to', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['request_date_to'] = $request_date_to; + + return $this; + } + + /** + * Gets request_types + * + * @return \OpenAPI\Client\Model\SupplyRequestType[]|null + */ + public function getRequestTypes() + { + return $this->container['request_types']; + } + + /** + * Sets request_types + * + * @param \OpenAPI\Client\Model\SupplyRequestType[]|null $request_types Типы заявок для фильтрации. + * + * @return self + */ + public function setRequestTypes($request_types) + { + if (is_null($request_types)) { + array_push($this->openAPINullablesSetToNull, 'request_types'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request_types', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($request_types) && (count($request_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $request_types when calling GetSupplyRequestsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['request_types'] = $request_types; + + return $this; + } + + /** + * Gets request_subtypes + * + * @return \OpenAPI\Client\Model\SupplyRequestSubType[]|null + */ + public function getRequestSubtypes() + { + return $this->container['request_subtypes']; + } + + /** + * Sets request_subtypes + * + * @param \OpenAPI\Client\Model\SupplyRequestSubType[]|null $request_subtypes Подтипы заявок для фильтрации. + * + * @return self + */ + public function setRequestSubtypes($request_subtypes) + { + if (is_null($request_subtypes)) { + array_push($this->openAPINullablesSetToNull, 'request_subtypes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request_subtypes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($request_subtypes) && (count($request_subtypes) < 1)) { + throw new \InvalidArgumentException('invalid length for $request_subtypes when calling GetSupplyRequestsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['request_subtypes'] = $request_subtypes; + + return $this; + } + + /** + * Gets request_statuses + * + * @return \OpenAPI\Client\Model\SupplyRequestStatusType[]|null + */ + public function getRequestStatuses() + { + return $this->container['request_statuses']; + } + + /** + * Sets request_statuses + * + * @param \OpenAPI\Client\Model\SupplyRequestStatusType[]|null $request_statuses Статусы заявок для фильтрации. + * + * @return self + */ + public function setRequestStatuses($request_statuses) + { + if (is_null($request_statuses)) { + array_push($this->openAPINullablesSetToNull, 'request_statuses'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('request_statuses', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($request_statuses) && (count($request_statuses) < 1)) { + throw new \InvalidArgumentException('invalid length for $request_statuses when calling GetSupplyRequestsRequest., number of items must be greater than or equal to 1.'); + } + $this->container['request_statuses'] = $request_statuses; + + return $this; + } + + /** + * Gets sorting + * + * @return \OpenAPI\Client\Model\SupplyRequestSortingDTO|null + */ + public function getSorting() + { + return $this->container['sorting']; + } + + /** + * Sets sorting + * + * @param \OpenAPI\Client\Model\SupplyRequestSortingDTO|null $sorting sorting + * + * @return self + */ + public function setSorting($sorting) + { + if (is_null($sorting)) { + throw new \InvalidArgumentException('non-nullable sorting cannot be null'); + } + $this->container['sorting'] = $sorting; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetSupplyRequestsResponse.php b/erp24/lib/yandex_market_api/Model/GetSupplyRequestsResponse.php new file mode 100644 index 00000000..e73f378c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetSupplyRequestsResponse.php @@ -0,0 +1,446 @@ + + */ +class GetSupplyRequestsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSupplyRequestsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\GetSupplyRequestsDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\GetSupplyRequestsDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\GetSupplyRequestsDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetTokenInfoResponse.php b/erp24/lib/yandex_market_api/Model/GetTokenInfoResponse.php new file mode 100644 index 00000000..53576d82 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/GetTokenInfoResponse.php @@ -0,0 +1,450 @@ + + */ +class GetTokenInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTokenInfoResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\TokenDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['result'] === null) { + $invalidProperties[] = "'result' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\TokenDTO + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\TokenDTO $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/GetWarehouseStocksDTO.php b/erp24/lib/yandex_market_api/Model/GetWarehouseStocksDTO.php index 492a4029..9b1a54a5 100644 --- a/erp24/lib/yandex_market_api/Model/GetWarehouseStocksDTO.php +++ b/erp24/lib/yandex_market_api/Model/GetWarehouseStocksDTO.php @@ -2,7 +2,7 @@ /** * GetWarehouseStocksDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GetWarehouseStocksDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('warehouses', $data ?? [], null); @@ -340,7 +340,7 @@ class GetWarehouseStocksDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets warehouses * - * @param \OpenAPI\Client\Model\WarehouseOffersDTO[] $warehouses Страница списка складов. + * @param \OpenAPI\Client\Model\WarehouseOffersDTO[] $warehouses Страница списка складов. **Для модели FBY:** может содержать несколько складов Маркета. **Для модели FBS:** может содержать как партнерский склад, так и склад возвратов Маркета. * * @return self */ @@ -356,11 +356,11 @@ class GetWarehouseStocksDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GetWarehouseStocksDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GetWarehouseStocksDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetWarehouseStocksRequest.php b/erp24/lib/yandex_market_api/Model/GetWarehouseStocksRequest.php index b165dae2..b6f66437 100644 --- a/erp24/lib/yandex_market_api/Model/GetWarehouseStocksRequest.php +++ b/erp24/lib/yandex_market_api/Model/GetWarehouseStocksRequest.php @@ -2,7 +2,7 @@ /** * GetWarehouseStocksRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,6 +58,8 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'stocks_warehouse_id' => 'int', + 'has_stocks' => 'bool', 'with_turnover' => 'bool', 'archived' => 'bool', 'offer_ids' => 'string[]' @@ -71,6 +73,8 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'stocks_warehouse_id' => 'int64', + 'has_stocks' => null, 'with_turnover' => null, 'archived' => null, 'offer_ids' => null @@ -82,6 +86,8 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ + 'stocks_warehouse_id' => false, + 'has_stocks' => false, 'with_turnover' => false, 'archived' => false, 'offer_ids' => true @@ -173,6 +179,8 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $attributeMap = [ + 'stocks_warehouse_id' => 'stocksWarehouseId', + 'has_stocks' => 'hasStocks', 'with_turnover' => 'withTurnover', 'archived' => 'archived', 'offer_ids' => 'offerIds' @@ -184,6 +192,8 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $setters = [ + 'stocks_warehouse_id' => 'setStocksWarehouseId', + 'has_stocks' => 'setHasStocks', 'with_turnover' => 'setWithTurnover', 'archived' => 'setArchived', 'offer_ids' => 'setOfferIds' @@ -195,6 +205,8 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $getters = [ + 'stocks_warehouse_id' => 'getStocksWarehouseId', + 'has_stocks' => 'getHasStocks', 'with_turnover' => 'getWithTurnover', 'archived' => 'getArchived', 'offer_ids' => 'getOfferIds' @@ -252,11 +264,13 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { + $this->setIfExists('stocks_warehouse_id', $data ?? [], null); + $this->setIfExists('has_stocks', $data ?? [], null); $this->setIfExists('with_turnover', $data ?? [], false); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('offer_ids', $data ?? [], null); @@ -289,10 +303,18 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if (!is_null($this->container['stocks_warehouse_id']) && ($this->container['stocks_warehouse_id'] < 1)) { + $invalidProperties[] = "invalid value for 'stocks_warehouse_id', must be bigger than or equal to 1."; + } + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) > 500)) { $invalidProperties[] = "invalid value for 'offer_ids', number of items must be less than or equal to 500."; } + if (!is_null($this->container['offer_ids']) && (count($this->container['offer_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -308,6 +330,65 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer } + /** + * Gets stocks_warehouse_id + * + * @return int|null + */ + public function getStocksWarehouseId() + { + return $this->container['stocks_warehouse_id']; + } + + /** + * Sets stocks_warehouse_id + * + * @param int|null $stocks_warehouse_id Идентификатор склада. Если параметр указан, возвращаются только товары на переданном складе. **Для модели FBY:** получить список складов Маркета можно с помощью метода [GET v2/warehouses](../../reference/warehouses/getFulfillmentWarehouses.md). + * + * @return self + */ + public function setStocksWarehouseId($stocks_warehouse_id) + { + if (is_null($stocks_warehouse_id)) { + throw new \InvalidArgumentException('non-nullable stocks_warehouse_id cannot be null'); + } + + if (($stocks_warehouse_id < 1)) { + throw new \InvalidArgumentException('invalid value for $stocks_warehouse_id when calling GetWarehouseStocksRequest., must be bigger than or equal to 1.'); + } + + $this->container['stocks_warehouse_id'] = $stocks_warehouse_id; + + return $this; + } + + /** + * Gets has_stocks + * + * @return bool|null + */ + public function getHasStocks() + { + return $this->container['has_stocks']; + } + + /** + * Sets has_stocks + * + * @param bool|null $has_stocks **Только для модели FBY** Фильтр по наличию товаров. Используйте только вместе со `stocksWarehouseId`. Передайте `false`, чтобы получить информацию о товарах, которых нет в наличие. При значении `true` возвращаются данные о товарах, которые есть на указанном складе. + * + * @return self + */ + public function setHasStocks($has_stocks) + { + if (is_null($has_stocks)) { + throw new \InvalidArgumentException('non-nullable has_stocks cannot be null'); + } + $this->container['has_stocks'] = $has_stocks; + + return $this; + } + /** * Gets with_turnover * @@ -321,7 +402,7 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Sets with_turnover * - * @param bool|null $with_turnover **Только для модели FBY** Возвращать ли информацию по оборачиваемости. Значение по умолчанию — `false`. Если информация нужна, передайте значение `true`. + * @param bool|null $with_turnover **Только для модели FBY** Возвращать ли информацию по оборачиваемости. Значение по умолчанию: `false`. Если информация нужна, передайте значение `true`. * * @return self */ @@ -375,7 +456,7 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Sets offer_ids * - * @param string[]|null $offer_ids Фильтр по вашим SKU товаров. Возвращается информация об остатках всех переданных SKU, включая товары в архиве. {% note warning \"Такой список возвращается только целиком\" %} Если вы запрашиваете информацию по конкретным SKU, не заполняйте: * `page_token` * `limit` * `archived` {% endnote %}   + * @param string[]|null $offer_ids Фильтр по вашим SKU товаров. Возвращается информация об остатках всех переданных SKU, включая товары в архиве. {% note warning \"Такой список возвращается только целиком\" %} Если вы запрашиваете информацию по конкретным SKU, не заполняйте: * `page_token` * `limit` * `archived` * `stocksOnWarehouse` {% endnote %}   * * @return self */ @@ -395,6 +476,9 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer if (!is_null($offer_ids) && (count($offer_ids) > 500)) { throw new \InvalidArgumentException('invalid value for $offer_ids when calling GetWarehouseStocksRequest., number of items must be less than or equal to 500.'); } + if (!is_null($offer_ids) && (count($offer_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_ids when calling GetWarehouseStocksRequest., number of items must be greater than or equal to 1.'); + } $this->container['offer_ids'] = $offer_ids; return $this; @@ -402,11 +486,11 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -414,12 +498,12 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -444,11 +528,11 @@ class GetWarehouseStocksRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetWarehouseStocksResponse.php b/erp24/lib/yandex_market_api/Model/GetWarehouseStocksResponse.php index f6cac86d..85523f4c 100644 --- a/erp24/lib/yandex_market_api/Model/GetWarehouseStocksResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetWarehouseStocksResponse.php @@ -2,7 +2,7 @@ /** * GetWarehouseStocksResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetWarehouseStocksResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GetWarehousesResponse.php b/erp24/lib/yandex_market_api/Model/GetWarehousesResponse.php index 943b6528..2c360733 100644 --- a/erp24/lib/yandex_market_api/Model/GetWarehousesResponse.php +++ b/erp24/lib/yandex_market_api/Model/GetWarehousesResponse.php @@ -2,7 +2,7 @@ /** * GetWarehousesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class GetWarehousesResponse implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorDTO.php index e44d6cc9..82701f64 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackCommentAuthorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GoodsFeedbackCommentAuthorDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -353,11 +353,11 @@ class GoodsFeedbackCommentAuthorDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class GoodsFeedbackCommentAuthorDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class GoodsFeedbackCommentAuthorDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorType.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorType.php index 524f73bb..3a1cab49 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorType.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentAuthorType.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackCommentAuthorType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentDTO.php index 9a932ccb..f4108060 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackCommentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -63,7 +63,8 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria 'can_modify' => 'bool', 'parent_id' => 'int', 'author' => '\OpenAPI\Client\Model\GoodsFeedbackCommentAuthorDTO', - 'status' => '\OpenAPI\Client\Model\GoodsFeedbackCommentStatusType' + 'status' => '\OpenAPI\Client\Model\GoodsFeedbackCommentStatusType', + 'feedback_id' => 'int' ]; /** @@ -79,7 +80,8 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria 'can_modify' => null, 'parent_id' => 'int64', 'author' => null, - 'status' => null + 'status' => null, + 'feedback_id' => 'int64' ]; /** @@ -93,7 +95,8 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria 'can_modify' => false, 'parent_id' => false, 'author' => false, - 'status' => false + 'status' => false, + 'feedback_id' => false ]; /** @@ -187,7 +190,8 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria 'can_modify' => 'canModify', 'parent_id' => 'parentId', 'author' => 'author', - 'status' => 'status' + 'status' => 'status', + 'feedback_id' => 'feedbackId' ]; /** @@ -201,7 +205,8 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria 'can_modify' => 'setCanModify', 'parent_id' => 'setParentId', 'author' => 'setAuthor', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'feedback_id' => 'setFeedbackId' ]; /** @@ -215,7 +220,8 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria 'can_modify' => 'getCanModify', 'parent_id' => 'getParentId', 'author' => 'getAuthor', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'feedback_id' => 'getFeedbackId' ]; /** @@ -270,10 +276,10 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('text', $data ?? [], null); @@ -281,6 +287,7 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria $this->setIfExists('parent_id', $data ?? [], null); $this->setIfExists('author', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('feedback_id', $data ?? [], null); } /** @@ -324,12 +331,12 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1."; } - if ($this->container['author'] === null) { - $invalidProperties[] = "'author' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } + if ($this->container['feedback_id'] === null) { + $invalidProperties[] = "'feedback_id' can't be null"; + } return $invalidProperties; } @@ -385,7 +392,7 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets text * - * @param string $text Текст комментария. + * @param string $text Текст комментария. Не должен содержать контакты магазина и ссылки на сайты, кроме Маркета. * * @return self */ @@ -446,7 +453,7 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets parent_id * - * @param int|null $parent_id Идентификатор комментария к отзыву. + * @param int|null $parent_id Идентификатор родительского комментария. * * @return self */ @@ -463,7 +470,7 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets author * - * @return \OpenAPI\Client\Model\GoodsFeedbackCommentAuthorDTO + * @return \OpenAPI\Client\Model\GoodsFeedbackCommentAuthorDTO|null */ public function getAuthor() { @@ -473,7 +480,7 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets author * - * @param \OpenAPI\Client\Model\GoodsFeedbackCommentAuthorDTO $author author + * @param \OpenAPI\Client\Model\GoodsFeedbackCommentAuthorDTO|null $author author * * @return self */ @@ -513,14 +520,41 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria return $this; } + + /** + * Gets feedback_id + * + * @return int + */ + public function getFeedbackId() + { + return $this->container['feedback_id']; + } + + /** + * Sets feedback_id + * + * @param int $feedback_id Идентификатор отзыва. + * + * @return self + */ + public function setFeedbackId($feedback_id) + { + if (is_null($feedback_id)) { + throw new \InvalidArgumentException('non-nullable feedback_id cannot be null'); + } + $this->container['feedback_id'] = $feedback_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -528,12 +562,12 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -558,11 +592,11 @@ class GoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentListDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentListDTO.php index df3ce6b4..fb88cf40 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentListDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentListDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackCommentListDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GoodsFeedbackCommentListDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('comments', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class GoodsFeedbackCommentListDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GoodsFeedbackCommentListDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GoodsFeedbackCommentListDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentStatusType.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentStatusType.php index d6fb439b..d3ae776a 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentStatusType.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackCommentStatusType.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackCommentStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackDTO.php index d15ea34a..2e17338b 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -282,10 +282,10 @@ class GoodsFeedbackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('feedback_id', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); @@ -421,7 +421,7 @@ class GoodsFeedbackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets need_reaction * - * @param bool $need_reaction Нужен ли ответ на отзыв. + * @param bool $need_reaction Прочитан ли отзыв. Принимает значение `false`, если магазин: * Прочитал отзыв в кабинете продавца на Маркете. * Отметил отзыв прочитанным — метод [POST v2/businesses/{businessId}/goods-feedback/skip-reaction](../../reference/goods-feedback/skipGoodsFeedbacksReaction.md). * Оставил комментарий к отзыву — метод [POST v2/businesses/{businessId}/goods-feedback/comments/update](../../reference/goods-feedback/updateGoodsFeedbackComment.md). * * @return self */ @@ -572,11 +572,11 @@ class GoodsFeedbackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -584,12 +584,12 @@ class GoodsFeedbackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -614,11 +614,11 @@ class GoodsFeedbackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackDescriptionDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackDescriptionDTO.php index 062cad84..daa34686 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackDescriptionDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackDescriptionDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackDescriptionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GoodsFeedbackDescriptionDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('advantages', $data ?? [], null); $this->setIfExists('disadvantages', $data ?? [], null); @@ -387,11 +387,11 @@ class GoodsFeedbackDescriptionDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class GoodsFeedbackDescriptionDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class GoodsFeedbackDescriptionDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackIdentifiersDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackIdentifiersDTO.php index e95748a0..6b556a21 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackIdentifiersDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackIdentifiersDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackIdentifiersDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPITypes = [ 'order_id' => 'int', - 'model_id' => 'int' + 'offer_id' => 'string' ]; /** @@ -71,7 +71,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPIFormats = [ 'order_id' => 'int64', - 'model_id' => 'int64' + 'offer_id' => null ]; /** @@ -81,7 +81,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static array $openAPINullables = [ 'order_id' => false, - 'model_id' => false + 'offer_id' => false ]; /** @@ -171,7 +171,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static $attributeMap = [ 'order_id' => 'orderId', - 'model_id' => 'modelId' + 'offer_id' => 'offerId' ]; /** @@ -181,7 +181,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static $setters = [ 'order_id' => 'setOrderId', - 'model_id' => 'setModelId' + 'offer_id' => 'setOfferId' ]; /** @@ -191,7 +191,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static $getters = [ 'order_id' => 'getOrderId', - 'model_id' => 'getModelId' + 'offer_id' => 'getOfferId' ]; /** @@ -246,13 +246,13 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_id', $data ?? [], null); - $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('offer_id', $data ?? [], null); } /** @@ -282,12 +282,18 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; - if ($this->container['order_id'] === null) { - $invalidProperties[] = "'order_id' can't be null"; + if (!is_null($this->container['offer_id']) && (mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; } - if ($this->container['model_id'] === null) { - $invalidProperties[] = "'model_id' can't be null"; + + if (!is_null($this->container['offer_id']) && (mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } + return $invalidProperties; } @@ -306,7 +312,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets order_id * - * @return int + * @return int|null */ public function getOrderId() { @@ -316,7 +322,7 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets order_id * - * @param int $order_id Идентификатор заказа на Маркете. + * @param int|null $order_id Идентификатор заказа на Маркете. * * @return self */ @@ -331,39 +337,49 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS } /** - * Gets model_id + * Gets offer_id * - * @return int + * @return string|null */ - public function getModelId() + public function getOfferId() { - return $this->container['model_id']; + return $this->container['offer_id']; } /** - * Sets model_id + * Sets offer_id * - * @param int $model_id Идентификатор модели товара. + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ - public function setModelId($model_id) + public function setOfferId($offer_id) { - if (is_null($model_id)) { - throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); } - $this->container['model_id'] = $model_id; + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling GoodsFeedbackIdentifiersDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling GoodsFeedbackIdentifiersDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling GoodsFeedbackIdentifiersDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +387,12 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +417,11 @@ class GoodsFeedbackIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackListDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackListDTO.php index dad1e5ac..0a38dd44 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackListDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackListDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackListDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class GoodsFeedbackListDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('feedbacks', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class GoodsFeedbackListDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class GoodsFeedbackListDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class GoodsFeedbackListDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackMediaDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackMediaDTO.php index 25214a22..15afda8a 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackMediaDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackMediaDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackMediaDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * GoodsFeedbackMediaDTO Class Doc Comment * * @category Class - * @description Фото и видео. + * @description Фотографии и видео. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('photos', $data ?? [], null); $this->setIfExists('videos', $data ?? [], null); @@ -282,6 +282,14 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if (!is_null($this->container['photos']) && (count($this->container['photos']) < 1)) { + $invalidProperties[] = "invalid value for 'photos', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['videos']) && (count($this->container['videos']) < 1)) { + $invalidProperties[] = "invalid value for 'videos', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -310,7 +318,7 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets photos * - * @param string[]|null $photos Ссылки на фото. + * @param string[]|null $photos Ссылки на фотографии. * * @return self */ @@ -326,6 +334,11 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($photos) && (count($photos) < 1)) { + throw new \InvalidArgumentException('invalid length for $photos when calling GoodsFeedbackMediaDTO., number of items must be greater than or equal to 1.'); + } $this->container['photos'] = $photos; return $this; @@ -360,6 +373,11 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($videos) && (count($videos) < 1)) { + throw new \InvalidArgumentException('invalid length for $videos when calling GoodsFeedbackMediaDTO., number of items must be greater than or equal to 1.'); + } $this->container['videos'] = $videos; return $this; @@ -367,11 +385,11 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -379,12 +397,12 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -409,11 +427,11 @@ class GoodsFeedbackMediaDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsFeedbackStatisticsDTO.php b/erp24/lib/yandex_market_api/Model/GoodsFeedbackStatisticsDTO.php index 5bd387e9..89c3bd22 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsFeedbackStatisticsDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsFeedbackStatisticsDTO.php @@ -2,7 +2,7 @@ /** * GoodsFeedbackStatisticsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class GoodsFeedbackStatisticsDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('rating', $data ?? [], null); $this->setIfExists('comments_count', $data ?? [], null); @@ -443,11 +443,11 @@ class GoodsFeedbackStatisticsDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -455,12 +455,12 @@ class GoodsFeedbackStatisticsDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -485,11 +485,11 @@ class GoodsFeedbackStatisticsDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsStatsDTO.php b/erp24/lib/yandex_market_api/Model/GoodsStatsDTO.php index 312a35f1..6ebb7d56 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsStatsDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsStatsDTO.php @@ -2,7 +2,7 @@ /** * GoodsStatsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class GoodsStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('shop_skus', $data ?? [], null); } @@ -322,11 +322,11 @@ class GoodsStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class GoodsStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class GoodsStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsStatsGoodsDTO.php b/erp24/lib/yandex_market_api/Model/GoodsStatsGoodsDTO.php index ea20e336..28180721 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsStatsGoodsDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsStatsGoodsDTO.php @@ -2,7 +2,7 @@ /** * GoodsStatsGoodsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -294,10 +294,10 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('shop_sku', $data ?? [], null); $this->setIfExists('market_sku', $data ?? [], null); @@ -346,14 +346,26 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['market_sku']) && ($this->container['market_sku'] < 1)) { $invalidProperties[] = "invalid value for 'market_sku', must be bigger than or equal to 1."; } + if (!is_null($this->container['warehouses']) && (count($this->container['warehouses']) < 1)) { + $invalidProperties[] = "invalid value for 'warehouses', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tariffs']) && (count($this->container['tariffs']) < 1)) { + $invalidProperties[] = "invalid value for 'tariffs', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -382,7 +394,7 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -397,8 +409,8 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling GoodsStatsGoodsDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling GoodsStatsGoodsDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling GoodsStatsGoodsDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -419,7 +431,7 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -478,7 +490,7 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets price * - * @param float|null $price Цена на товар в валюте, которая установлена [в кабинете продавца на Маркете](https://partner.market.yandex.ru/). + * @param float|null $price Цена товара в валюте, которая установлена [в кабинете продавца на Маркете](https://partner.market.yandex.ru/). * * @return self */ @@ -602,6 +614,11 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warehouses) && (count($warehouses) < 1)) { + throw new \InvalidArgumentException('invalid length for $warehouses when calling GoodsStatsGoodsDTO., number of items must be greater than or equal to 1.'); + } $this->container['warehouses'] = $warehouses; return $this; @@ -636,6 +653,11 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($tariffs) && (count($tariffs) < 1)) { + throw new \InvalidArgumentException('invalid length for $tariffs when calling GoodsStatsGoodsDTO., number of items must be greater than or equal to 1.'); + } $this->container['tariffs'] = $tariffs; return $this; @@ -670,6 +692,11 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling GoodsStatsGoodsDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -677,11 +704,11 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -689,12 +716,12 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -719,11 +746,11 @@ class GoodsStatsGoodsDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsStatsWarehouseDTO.php b/erp24/lib/yandex_market_api/Model/GoodsStatsWarehouseDTO.php index 4b951045..c17a1bbc 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsStatsWarehouseDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsStatsWarehouseDTO.php @@ -2,7 +2,7 @@ /** * GoodsStatsWarehouseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class GoodsStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -390,11 +390,11 @@ class GoodsStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class GoodsStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class GoodsStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GoodsStatsWeightDimensionsDTO.php b/erp24/lib/yandex_market_api/Model/GoodsStatsWeightDimensionsDTO.php index d3b124f1..e109460a 100644 --- a/erp24/lib/yandex_market_api/Model/GoodsStatsWeightDimensionsDTO.php +++ b/erp24/lib/yandex_market_api/Model/GoodsStatsWeightDimensionsDTO.php @@ -2,7 +2,7 @@ /** * GoodsStatsWeightDimensionsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class GoodsStatsWeightDimensionsDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('length', $data ?? [], null); $this->setIfExists('width', $data ?? [], null); @@ -421,11 +421,11 @@ class GoodsStatsWeightDimensionsDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ class GoodsStatsWeightDimensionsDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ class GoodsStatsWeightDimensionsDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/GpsDTO.php b/erp24/lib/yandex_market_api/Model/GpsDTO.php index 99f11f25..06ef7480 100644 --- a/erp24/lib/yandex_market_api/Model/GpsDTO.php +++ b/erp24/lib/yandex_market_api/Model/GpsDTO.php @@ -2,7 +2,7 @@ /** * GpsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -70,8 +70,8 @@ class GpsDTO implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'latitude' => 'decimal', - 'longitude' => 'decimal' + 'latitude' => null, + 'longitude' => null ]; /** @@ -246,10 +246,10 @@ class GpsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('latitude', $data ?? [], null); $this->setIfExists('longitude', $data ?? [], null); @@ -359,11 +359,11 @@ class GpsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class GpsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class GpsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/HiddenOfferDTO.php b/erp24/lib/yandex_market_api/Model/HiddenOfferDTO.php index 23e1feb0..76aacaf1 100644 --- a/erp24/lib/yandex_market_api/Model/HiddenOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/HiddenOfferDTO.php @@ -2,7 +2,7 @@ /** * HiddenOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); } @@ -286,8 +286,8 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -318,7 +318,7 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -333,8 +333,8 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling HiddenOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling HiddenOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling HiddenOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -344,11 +344,11 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -356,12 +356,12 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -386,11 +386,11 @@ class HiddenOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ItemPriceDTO.php b/erp24/lib/yandex_market_api/Model/ItemPriceDTO.php new file mode 100644 index 00000000..89301c0f --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ItemPriceDTO.php @@ -0,0 +1,512 @@ + + */ +class ItemPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ItemPriceDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'subsidy' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'cashback' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'vat' => '\OpenAPI\Client\Model\OrderVatType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment' => null, + 'subsidy' => null, + 'cashback' => null, + 'vat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment' => false, + 'subsidy' => false, + 'cashback' => false, + 'vat' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment' => 'payment', + 'subsidy' => 'subsidy', + 'cashback' => 'cashback', + 'vat' => 'vat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment' => 'setPayment', + 'subsidy' => 'setSubsidy', + 'cashback' => 'setCashback', + 'vat' => 'setVat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment' => 'getPayment', + 'subsidy' => 'getSubsidy', + 'cashback' => 'getCashback', + 'vat' => 'getVat' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('subsidy', $data ?? [], null); + $this->setIfExists('cashback', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getPayment() + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $payment payment + * + * @return self + */ + public function setPayment($payment) + { + if (is_null($payment)) { + throw new \InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets subsidy + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getSubsidy() + { + return $this->container['subsidy']; + } + + /** + * Sets subsidy + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $subsidy subsidy + * + * @return self + */ + public function setSubsidy($subsidy) + { + if (is_null($subsidy)) { + throw new \InvalidArgumentException('non-nullable subsidy cannot be null'); + } + $this->container['subsidy'] = $subsidy; + + return $this; + } + + /** + * Gets cashback + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getCashback() + { + return $this->container['cashback']; + } + + /** + * Sets cashback + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $cashback cashback + * + * @return self + */ + public function setCashback($cashback) + { + if (is_null($cashback)) { + throw new \InvalidArgumentException('non-nullable cashback cannot be null'); + } + $this->container['cashback'] = $cashback; + + return $this; + } + + /** + * Gets vat + * + * @return \OpenAPI\Client\Model\OrderVatType|null + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \OpenAPI\Client\Model\OrderVatType|null $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/KeyIndicatorsReportDetalizationLevelType.php b/erp24/lib/yandex_market_api/Model/KeyIndicatorsReportDetalizationLevelType.php new file mode 100644 index 00000000..1cd1b104 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/KeyIndicatorsReportDetalizationLevelType.php @@ -0,0 +1,63 @@ +setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -489,11 +489,11 @@ class LogisticPickupPointDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -501,12 +501,12 @@ class LogisticPickupPointDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -531,11 +531,11 @@ class LogisticPickupPointDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/LogisticPointType.php b/erp24/lib/yandex_market_api/Model/LogisticPointType.php index 8052f372..267b78e3 100644 --- a/erp24/lib/yandex_market_api/Model/LogisticPointType.php +++ b/erp24/lib/yandex_market_api/Model/LogisticPointType.php @@ -2,7 +2,7 @@ /** * LogisticPointType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -55,8 +55,6 @@ class LogisticPointType public const PICKUP_RETAIL = 'PICKUP_RETAIL'; - public const UNKNOWN = 'UNKNOWN'; - /** * Gets allowable values of the enum * @return string[] @@ -69,8 +67,7 @@ class LogisticPointType self::PICKUP_TERMINAL, self::PICKUP_POST_OFFICE, self::PICKUP_MIXED, - self::PICKUP_RETAIL, - self::UNKNOWN + self::PICKUP_RETAIL ]; } } diff --git a/erp24/lib/yandex_market_api/Model/MappingsOfferDTO.php b/erp24/lib/yandex_market_api/Model/MappingsOfferDTO.php index 50d1e4cf..2ff9a967 100644 --- a/erp24/lib/yandex_market_api/Model/MappingsOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/MappingsOfferDTO.php @@ -2,7 +2,7 @@ /** * MappingsOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -420,10 +420,10 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('shop_sku', $data ?? [], null); @@ -497,8 +497,8 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { @@ -513,8 +513,40 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { - $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { + $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['urls']) && (count($this->container['urls']) < 1)) { + $invalidProperties[] = "invalid value for 'urls', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) > 30)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be less than or equal to 30."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) > 5)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be less than or equal to 5."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['customs_commodity_codes']) && (count($this->container['customs_commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'customs_commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['supply_schedule_days']) && (count($this->container['supply_schedule_days']) < 1)) { + $invalidProperties[] = "invalid value for 'supply_schedule_days', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -576,7 +608,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -591,8 +623,8 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling MappingsOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling MappingsOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling MappingsOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -604,6 +636,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -613,9 +646,10 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -694,7 +728,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                                                          , \\

                                                          и так далее — для заголовков; * \\
                                                          и \\

                                                          — для переноса строки; * \\

                                                            — для нумерованного списка; * \\
                                                              — для маркированного списка; * \\
                                                            • — для создания элементов списка (должен находиться внутри \\
                                                                или \\
                                                                  ); * \\
                                                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                                  , \\

                                                                  и так далее — для заголовков; * \\
                                                                  и \\

                                                                  — для переноса строки; * \\

                                                                    — для нумерованного списка; * \\
                                                                      — для маркированного списка; * \\
                                                                    • — для создания элементов списка (должен находиться внутри \\
                                                                        или \\
                                                                          ); * \\
                                                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -725,7 +759,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -740,8 +774,8 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($id) < 1)) { throw new \InvalidArgumentException('invalid length for $id when calling MappingsOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { - throw new \InvalidArgumentException("invalid value for \$id when calling MappingsOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling MappingsOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['id'] = $id; @@ -789,7 +823,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -805,6 +839,11 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling MappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -823,7 +862,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets urls * - * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр url. + * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр `url`. * * @return self */ @@ -839,6 +878,11 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($urls) && (count($urls) < 1)) { + throw new \InvalidArgumentException('invalid length for $urls when calling MappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['urls'] = $urls; return $this; @@ -857,7 +901,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets pictures * - * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. Обязательный параметр. Должен содержать хотя бы один вложенный параметр `picture`. + * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. * * @return self */ @@ -873,6 +917,13 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($pictures) && (count($pictures) > 30)) { + throw new \InvalidArgumentException('invalid value for $pictures when calling MappingsOfferDTO., number of items must be less than or equal to 30.'); + } + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling MappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -934,6 +985,13 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) > 5)) { + throw new \InvalidArgumentException('invalid value for $manufacturer_countries when calling MappingsOfferDTO., number of items must be less than or equal to 5.'); + } + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling MappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -997,6 +1055,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets quantum_of_supply * * @return int|null + * @deprecated */ public function getQuantumOfSupply() { @@ -1006,9 +1065,10 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets quantum_of_supply * - * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству minShipment. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. + * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству `minShipment`. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. * * @return self + * @deprecated */ public function setQuantumOfSupply($quantum_of_supply) { @@ -1103,6 +1163,11 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($customs_commodity_codes) && (count($customs_commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $customs_commodity_codes when calling MappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['customs_commodity_codes'] = $customs_commodity_codes; return $this; @@ -1164,6 +1229,11 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($supply_schedule_days) && (count($supply_schedule_days) < 1)) { + throw new \InvalidArgumentException('invalid length for $supply_schedule_days when calling MappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['supply_schedule_days'] = $supply_schedule_days; return $this; @@ -1173,6 +1243,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets shelf_life_days * * @return int|null + * @deprecated */ public function getShelfLifeDays() { @@ -1182,9 +1253,10 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets shelf_life_days * - * @param int|null $shelf_life_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. + * @param int|null $shelf_life_days {% note warning \"Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. * * @return self + * @deprecated */ public function setShelfLifeDays($shelf_life_days) { @@ -1200,6 +1272,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets life_time_days * * @return int|null + * @deprecated */ public function getLifeTimeDays() { @@ -1209,9 +1282,10 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets life_time_days * - * @param int|null $life_time_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. + * @param int|null $life_time_days {% note warning \"Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. * * @return self + * @deprecated */ public function setLifeTimeDays($life_time_days) { @@ -1425,7 +1499,7 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets price * - * @param float|null $price Цена на товар в рублях. + * @param float|null $price Цена товара. * * @return self */ @@ -1441,11 +1515,11 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1453,12 +1527,12 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1483,11 +1557,11 @@ class MappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/MappingsOfferInfoDTO.php b/erp24/lib/yandex_market_api/Model/MappingsOfferInfoDTO.php index e17e71c8..d4b4ee96 100644 --- a/erp24/lib/yandex_market_api/Model/MappingsOfferInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/MappingsOfferInfoDTO.php @@ -2,7 +2,7 @@ /** * MappingsOfferInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -414,10 +414,10 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('shop_sku', $data ?? [], null); @@ -490,8 +490,8 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { @@ -506,8 +506,40 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { - $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { + $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['urls']) && (count($this->container['urls']) < 1)) { + $invalidProperties[] = "invalid value for 'urls', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) > 30)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be less than or equal to 30."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) > 5)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be less than or equal to 5."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['customs_commodity_codes']) && (count($this->container['customs_commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'customs_commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['supply_schedule_days']) && (count($this->container['supply_schedule_days']) < 1)) { + $invalidProperties[] = "invalid value for 'supply_schedule_days', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -569,7 +601,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -584,8 +616,8 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling MappingsOfferInfoDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling MappingsOfferInfoDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling MappingsOfferInfoDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -597,6 +629,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -606,9 +639,10 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -687,7 +721,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                                                                          , \\

                                                                          и так далее — для заголовков; * \\
                                                                          и \\

                                                                          — для переноса строки; * \\

                                                                            — для нумерованного списка; * \\
                                                                              — для маркированного списка; * \\
                                                                            • — для создания элементов списка (должен находиться внутри \\
                                                                                или \\
                                                                                  ); * \\
                                                                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                                                  , \\

                                                                                  и так далее — для заголовков; * \\
                                                                                  и \\

                                                                                  — для переноса строки; * \\

                                                                                    — для нумерованного списка; * \\
                                                                                      — для маркированного списка; * \\
                                                                                    • — для создания элементов списка (должен находиться внутри \\
                                                                                        или \\
                                                                                          ); * \\
                                                                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -718,7 +752,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets id * - * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -733,8 +767,8 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ if ((mb_strlen($id) < 1)) { throw new \InvalidArgumentException('invalid length for $id when calling MappingsOfferInfoDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { - throw new \InvalidArgumentException("invalid value for \$id when calling MappingsOfferInfoDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling MappingsOfferInfoDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['id'] = $id; @@ -782,7 +816,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -798,6 +832,11 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling MappingsOfferInfoDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -816,7 +855,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets urls * - * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр url. + * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр `url`. * * @return self */ @@ -832,6 +871,11 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($urls) && (count($urls) < 1)) { + throw new \InvalidArgumentException('invalid length for $urls when calling MappingsOfferInfoDTO., number of items must be greater than or equal to 1.'); + } $this->container['urls'] = $urls; return $this; @@ -850,7 +894,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets pictures * - * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. Обязательный параметр. Должен содержать хотя бы один вложенный параметр `picture`. + * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. * * @return self */ @@ -866,6 +910,13 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($pictures) && (count($pictures) > 30)) { + throw new \InvalidArgumentException('invalid value for $pictures when calling MappingsOfferInfoDTO., number of items must be less than or equal to 30.'); + } + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling MappingsOfferInfoDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -927,6 +978,13 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) > 5)) { + throw new \InvalidArgumentException('invalid value for $manufacturer_countries when calling MappingsOfferInfoDTO., number of items must be less than or equal to 5.'); + } + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling MappingsOfferInfoDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -990,6 +1048,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ * Gets quantum_of_supply * * @return int|null + * @deprecated */ public function getQuantumOfSupply() { @@ -999,9 +1058,10 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets quantum_of_supply * - * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству minShipment. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. + * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству `minShipment`. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. * * @return self + * @deprecated */ public function setQuantumOfSupply($quantum_of_supply) { @@ -1096,6 +1156,11 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($customs_commodity_codes) && (count($customs_commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $customs_commodity_codes when calling MappingsOfferInfoDTO., number of items must be greater than or equal to 1.'); + } $this->container['customs_commodity_codes'] = $customs_commodity_codes; return $this; @@ -1157,6 +1222,11 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($supply_schedule_days) && (count($supply_schedule_days) < 1)) { + throw new \InvalidArgumentException('invalid length for $supply_schedule_days when calling MappingsOfferInfoDTO., number of items must be greater than or equal to 1.'); + } $this->container['supply_schedule_days'] = $supply_schedule_days; return $this; @@ -1166,6 +1236,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ * Gets shelf_life_days * * @return int|null + * @deprecated */ public function getShelfLifeDays() { @@ -1175,9 +1246,10 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets shelf_life_days * - * @param int|null $shelf_life_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. + * @param int|null $shelf_life_days {% note warning \"Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. * * @return self + * @deprecated */ public function setShelfLifeDays($shelf_life_days) { @@ -1193,6 +1265,7 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ * Gets life_time_days * * @return int|null + * @deprecated */ public function getLifeTimeDays() { @@ -1202,9 +1275,10 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets life_time_days * - * @param int|null $life_time_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. + * @param int|null $life_time_days {% note warning \"Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. * * @return self + * @deprecated */ public function setLifeTimeDays($life_time_days) { @@ -1407,11 +1481,11 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1419,12 +1493,12 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1449,11 +1523,11 @@ class MappingsOfferInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/MaxSaleQuantumDTO.php b/erp24/lib/yandex_market_api/Model/MaxSaleQuantumDTO.php index d7ba8297..3a1e506d 100644 --- a/erp24/lib/yandex_market_api/Model/MaxSaleQuantumDTO.php +++ b/erp24/lib/yandex_market_api/Model/MaxSaleQuantumDTO.php @@ -2,7 +2,7 @@ /** * MaxSaleQuantumDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class MaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -390,11 +390,11 @@ class MaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class MaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class MaxSaleQuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/MechanicsType.php b/erp24/lib/yandex_market_api/Model/MechanicsType.php index a9eab8e9..2d8ce58e 100644 --- a/erp24/lib/yandex_market_api/Model/MechanicsType.php +++ b/erp24/lib/yandex_market_api/Model/MechanicsType.php @@ -2,7 +2,7 @@ /** * MechanicsType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/MediaFileUploadStateType.php b/erp24/lib/yandex_market_api/Model/MediaFileUploadStateType.php new file mode 100644 index 00000000..51f66cd6 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/MediaFileUploadStateType.php @@ -0,0 +1,66 @@ + + */ +class MonthOfYearDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MonthOfYearDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'year' => 'int', + 'month' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'year' => 'int32', + 'month' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'year' => false, + 'month' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'year' => 'year', + 'month' => 'month' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'year' => 'setYear', + 'month' => 'setMonth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'year' => 'getYear', + 'month' => 'getMonth' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if (($this->container['month'] > 12)) { + $invalidProperties[] = "invalid value for 'month', must be smaller than or equal to 12."; + } + + if (($this->container['month'] < 1)) { + $invalidProperties[] = "invalid value for 'month', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year Год. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month Номер месяца. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + + if (($month > 12)) { + throw new \InvalidArgumentException('invalid value for $month when calling MonthOfYearDTO., must be smaller than or equal to 12.'); + } + if (($month < 1)) { + throw new \InvalidArgumentException('invalid value for $month when calling MonthOfYearDTO., must be bigger than or equal to 1.'); + } + + $this->container['month'] = $month; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OfferAvailabilityStatusType.php b/erp24/lib/yandex_market_api/Model/OfferAvailabilityStatusType.php index cc28272f..7f4305ba 100644 --- a/erp24/lib/yandex_market_api/Model/OfferAvailabilityStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OfferAvailabilityStatusType.php @@ -2,7 +2,7 @@ /** * OfferAvailabilityStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OfferCampaignStatusDTO.php b/erp24/lib/yandex_market_api/Model/OfferCampaignStatusDTO.php index ecd8cd1f..1516da45 100644 --- a/erp24/lib/yandex_market_api/Model/OfferCampaignStatusDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferCampaignStatusDTO.php @@ -2,7 +2,7 @@ /** * OfferCampaignStatusDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -285,6 +285,10 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -316,7 +320,7 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -325,6 +329,11 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling OfferCampaignStatusDTO., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -359,11 +368,11 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +380,12 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +410,11 @@ class OfferCampaignStatusDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferCampaignStatusType.php b/erp24/lib/yandex_market_api/Model/OfferCampaignStatusType.php index b8450fb4..77fb1443 100644 --- a/erp24/lib/yandex_market_api/Model/OfferCampaignStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OfferCampaignStatusType.php @@ -2,7 +2,7 @@ /** * OfferCampaignStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OfferCardContentStatusType.php b/erp24/lib/yandex_market_api/Model/OfferCardContentStatusType.php new file mode 100644 index 00000000..56fa5ca6 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OfferCardContentStatusType.php @@ -0,0 +1,63 @@ + '\OpenAPI\Client\Model\ParameterValueDTO[]', 'card_status' => '\OpenAPI\Client\Model\OfferCardStatusType', 'content_rating' => 'int', + 'average_content_rating' => 'int', + 'content_rating_status' => '\OpenAPI\Client\Model\OfferCardContentStatusType', 'recommendations' => '\OpenAPI\Client\Model\OfferCardRecommendationDTO[]', + 'group_id' => 'string', 'errors' => '\OpenAPI\Client\Model\OfferErrorDTO[]', 'warnings' => '\OpenAPI\Client\Model\OfferErrorDTO[]' ]; @@ -81,7 +84,10 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'parameter_values' => null, 'card_status' => null, 'content_rating' => 'int32', + 'average_content_rating' => 'int32', + 'content_rating_status' => null, 'recommendations' => null, + 'group_id' => null, 'errors' => null, 'warnings' => null ]; @@ -97,7 +103,10 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'parameter_values' => true, 'card_status' => false, 'content_rating' => false, + 'average_content_rating' => false, + 'content_rating_status' => false, 'recommendations' => true, + 'group_id' => false, 'errors' => true, 'warnings' => true ]; @@ -193,7 +202,10 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'parameter_values' => 'parameterValues', 'card_status' => 'cardStatus', 'content_rating' => 'contentRating', + 'average_content_rating' => 'averageContentRating', + 'content_rating_status' => 'contentRatingStatus', 'recommendations' => 'recommendations', + 'group_id' => 'groupId', 'errors' => 'errors', 'warnings' => 'warnings' ]; @@ -209,7 +221,10 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'parameter_values' => 'setParameterValues', 'card_status' => 'setCardStatus', 'content_rating' => 'setContentRating', + 'average_content_rating' => 'setAverageContentRating', + 'content_rating_status' => 'setContentRatingStatus', 'recommendations' => 'setRecommendations', + 'group_id' => 'setGroupId', 'errors' => 'setErrors', 'warnings' => 'setWarnings' ]; @@ -225,7 +240,10 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'parameter_values' => 'getParameterValues', 'card_status' => 'getCardStatus', 'content_rating' => 'getContentRating', + 'average_content_rating' => 'getAverageContentRating', + 'content_rating_status' => 'getContentRatingStatus', 'recommendations' => 'getRecommendations', + 'group_id' => 'getGroupId', 'errors' => 'getErrors', 'warnings' => 'getWarnings' ]; @@ -282,17 +300,20 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('mapping', $data ?? [], null); $this->setIfExists('parameter_values', $data ?? [], null); $this->setIfExists('card_status', $data ?? [], null); $this->setIfExists('content_rating', $data ?? [], null); + $this->setIfExists('average_content_rating', $data ?? [], null); + $this->setIfExists('content_rating_status', $data ?? [], null); $this->setIfExists('recommendations', $data ?? [], null); + $this->setIfExists('group_id', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); } @@ -335,8 +356,24 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['parameter_values']) && (count($this->container['parameter_values']) < 1)) { + $invalidProperties[] = "invalid value for 'parameter_values', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['recommendations']) && (count($this->container['recommendations']) < 1)) { + $invalidProperties[] = "invalid value for 'recommendations', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['warnings']) && (count($this->container['warnings']) < 1)) { + $invalidProperties[] = "invalid value for 'warnings', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -367,7 +404,7 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -382,8 +419,8 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferCardDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferCardDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferCardDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -447,6 +484,11 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($parameter_values) && (count($parameter_values) < 1)) { + throw new \InvalidArgumentException('invalid length for $parameter_values when calling OfferCardDTO., number of items must be greater than or equal to 1.'); + } $this->container['parameter_values'] = $parameter_values; return $this; @@ -492,7 +534,7 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets content_rating * - * @param int|null $content_rating Процент заполненности карточки. + * @param int|null $content_rating Рейтинг карточки. * * @return self */ @@ -506,6 +548,60 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets average_content_rating + * + * @return int|null + */ + public function getAverageContentRating() + { + return $this->container['average_content_rating']; + } + + /** + * Sets average_content_rating + * + * @param int|null $average_content_rating Средний рейтинг карточки у товаров той категории, которая указана в `marketCategoryId`. Возвращается, только если параметр `withRecommendations` имеет значение `true`. + * + * @return self + */ + public function setAverageContentRating($average_content_rating) + { + if (is_null($average_content_rating)) { + throw new \InvalidArgumentException('non-nullable average_content_rating cannot be null'); + } + $this->container['average_content_rating'] = $average_content_rating; + + return $this; + } + + /** + * Gets content_rating_status + * + * @return \OpenAPI\Client\Model\OfferCardContentStatusType|null + */ + public function getContentRatingStatus() + { + return $this->container['content_rating_status']; + } + + /** + * Sets content_rating_status + * + * @param \OpenAPI\Client\Model\OfferCardContentStatusType|null $content_rating_status content_rating_status + * + * @return self + */ + public function setContentRatingStatus($content_rating_status) + { + if (is_null($content_rating_status)) { + throw new \InvalidArgumentException('non-nullable content_rating_status cannot be null'); + } + $this->container['content_rating_status'] = $content_rating_status; + + return $this; + } + /** * Gets recommendations * @@ -519,7 +615,7 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets recommendations * - * @param \OpenAPI\Client\Model\OfferCardRecommendationDTO[]|null $recommendations Список рекомендаций к заполнению карточки. Рекомендации Маркета помогают заполнять карточку так, чтобы покупателям было проще найти ваш товар и решиться на покупку. + * @param \OpenAPI\Client\Model\OfferCardRecommendationDTO[]|null $recommendations Список рекомендаций к заполнению карточки. Возвращается, только если параметр `withRecommendations` имеет значение `true`. Рекомендации Маркета помогают заполнять карточку так, чтобы покупателям было проще найти ваш товар и решиться на покупку. * * @return self */ @@ -535,11 +631,43 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($recommendations) && (count($recommendations) < 1)) { + throw new \InvalidArgumentException('invalid length for $recommendations when calling OfferCardDTO., number of items must be greater than or equal to 1.'); + } $this->container['recommendations'] = $recommendations; return $this; } + /** + * Gets group_id + * + * @return string|null + */ + public function getGroupId() + { + return $this->container['group_id']; + } + + /** + * Sets group_id + * + * @param string|null $group_id Идентификатор группы товаров. У товаров, которые объединены в одну группу, будет одинаковый идентификатор. [Как объединить товары на карточке](../../step-by-step/assortment-add-goods.md#combine-variants) + * + * @return self + */ + public function setGroupId($group_id) + { + if (is_null($group_id)) { + throw new \InvalidArgumentException('non-nullable group_id cannot be null'); + } + $this->container['group_id'] = $group_id; + + return $this; + } + /** * Gets errors * @@ -569,6 +697,11 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling OfferCardDTO., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -603,6 +736,11 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warnings) && (count($warnings) < 1)) { + throw new \InvalidArgumentException('invalid length for $warnings when calling OfferCardDTO., number of items must be greater than or equal to 1.'); + } $this->container['warnings'] = $warnings; return $this; @@ -610,11 +748,11 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -622,12 +760,12 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -652,11 +790,11 @@ class OfferCardDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferCardRecommendationDTO.php b/erp24/lib/yandex_market_api/Model/OfferCardRecommendationDTO.php index 5095ca0e..e9ba8fbf 100644 --- a/erp24/lib/yandex_market_api/Model/OfferCardRecommendationDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferCardRecommendationDTO.php @@ -2,7 +2,7 @@ /** * OfferCardRecommendationDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,8 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'type' => '\OpenAPI\Client\Model\OfferCardRecommendationType', - 'percent' => 'int' + 'percent' => 'int', + 'remaining_rating_points' => 'int' ]; /** @@ -71,7 +72,8 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPIFormats = [ 'type' => null, - 'percent' => 'int32' + 'percent' => 'int32', + 'remaining_rating_points' => 'int32' ]; /** @@ -81,7 +83,8 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static array $openAPINullables = [ 'type' => false, - 'percent' => false + 'percent' => false, + 'remaining_rating_points' => false ]; /** @@ -171,7 +174,8 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $attributeMap = [ 'type' => 'type', - 'percent' => 'percent' + 'percent' => 'percent', + 'remaining_rating_points' => 'remainingRatingPoints' ]; /** @@ -181,7 +185,8 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $setters = [ 'type' => 'setType', - 'percent' => 'setPercent' + 'percent' => 'setPercent', + 'remaining_rating_points' => 'setRemainingRatingPoints' ]; /** @@ -191,7 +196,8 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $getters = [ 'type' => 'getType', - 'percent' => 'getPercent' + 'percent' => 'getPercent', + 'remaining_rating_points' => 'getRemainingRatingPoints' ]; /** @@ -246,13 +252,14 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('percent', $data ?? [], null); + $this->setIfExists('remaining_rating_points', $data ?? [], null); } /** @@ -293,6 +300,14 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe $invalidProperties[] = "invalid value for 'percent', must be bigger than or equal to 0."; } + if (!is_null($this->container['remaining_rating_points']) && ($this->container['remaining_rating_points'] > 100)) { + $invalidProperties[] = "invalid value for 'remaining_rating_points', must be smaller than or equal to 100."; + } + + if (!is_null($this->container['remaining_rating_points']) && ($this->container['remaining_rating_points'] < 1)) { + $invalidProperties[] = "invalid value for 'remaining_rating_points', must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -348,7 +363,7 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets percent * - * @param int|null $percent Процент выполнения рекомендации. Указывается для рекомендаций некоторых типов. + * @param int|null $percent Процент выполнения рекомендации. Указывается для рекомендаций некоторых типов: * `PICTURE_COUNT`. * `VIDEO_COUNT`. * `MAIN`. * `ADDITIONAL`. * `DISTINCTIVE`. * * @return self */ @@ -369,14 +384,49 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe return $this; } + + /** + * Gets remaining_rating_points + * + * @return int|null + */ + public function getRemainingRatingPoints() + { + return $this->container['remaining_rating_points']; + } + + /** + * Sets remaining_rating_points + * + * @param int|null $remaining_rating_points Максимальное количество баллов рейтинга карточки, которые можно получить за выполнение рекомендаций. + * + * @return self + */ + public function setRemainingRatingPoints($remaining_rating_points) + { + if (is_null($remaining_rating_points)) { + throw new \InvalidArgumentException('non-nullable remaining_rating_points cannot be null'); + } + + if (($remaining_rating_points > 100)) { + throw new \InvalidArgumentException('invalid value for $remaining_rating_points when calling OfferCardRecommendationDTO., must be smaller than or equal to 100.'); + } + if (($remaining_rating_points < 1)) { + throw new \InvalidArgumentException('invalid value for $remaining_rating_points when calling OfferCardRecommendationDTO., must be bigger than or equal to 1.'); + } + + $this->container['remaining_rating_points'] = $remaining_rating_points; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -384,12 +434,12 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -414,11 +464,11 @@ class OfferCardRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferCardRecommendationType.php b/erp24/lib/yandex_market_api/Model/OfferCardRecommendationType.php index 19e36bc3..9a6c9fe2 100644 --- a/erp24/lib/yandex_market_api/Model/OfferCardRecommendationType.php +++ b/erp24/lib/yandex_market_api/Model/OfferCardRecommendationType.php @@ -2,7 +2,7 @@ /** * OfferCardRecommendationType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferCardRecommendationType Class Doc Comment * * @category Class - * @description Рекомендация по дополнению или замене контента. Не возвращается для карточек, которые заполнены Маркетом или содержат бывшие в употреблении товары. Часть рекомендаций относятся к **основным параметрам**, которые есть у товаров любых категорий. Другие — к тем **характеристикам**, которые есть у товара потому, что он относится к определенной категории. **1. Рекомендации, относящиеся к основным параметрам** Каждая такая рекомендация относится к **единственному параметру**. Чтобы заполнить этот параметр, пользуйтесь запросом [POST businesses/{businessId}/offer-mappings/update](../../reference/business-assortment/updateOfferMappings.md). Рекомендации по заполнению параметров в `updateOfferMappings`: * `RECOGNIZED_VENDOR` — напишите название производителя так, как его пишет сам производитель (параметр `vendor`). * `PICTURE_COUNT` — добавьте изображения (параметр `pictures`). * `FIRST_PICTURE_SIZE` — замените первое изображение более крупным (параметр `pictures`). * `TITLE_LENGTH` — измените название (параметр `name`). Составьте название по схеме: тип + бренд или производитель + модель + особенности, если есть (размер, вес, цвет). * `DESCRIPTION_LENGTH` — добавьте описание рекомендуемого размера (параметр `description`). * `AVERAGE_PICTURE_SIZE` — замените все изображения на изображения высокого качества (параметр `pictures`). * `FIRST_VIDEO_LENGTH` — добавьте первое видео рекомендуемой длины (параметр `videos`). * `AVERAGE_VIDEO_SIZE` — замените все видео на видео высокого качества (параметр `videos`). * `VIDEO_COUNT` — добавьте больше видео (параметр `videos`). Рекомендуемые значения параметров описаны в [Справке Яндекс Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/add/). **2. Рекомендации, относящиеся к характеристикам по категориям** Каждая такая рекомендация предполагает заполнение **одной или нескольких характеристик**. Чтобы узнать, какие именно характеристики нужно заполнить, воспользуйтесь запросом [POST category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters.md). Например, если вы получили рекомендацию `MAIN`, нужно заполнить характеристики, имеющие `MAIN` в массиве `recommendationTypes`. Рекомендации: * `MAIN` — заполните ключевые характеристики товара, которые используются в поиске и фильтрах. * `ADDITIONAL` — заполните дополнительные характеристики товара. * `DISTINCTIVE` — заполните характеристики, которыми отличаются друг от друга варианты товара. **3. Устаревшие рекомендации** * `HAS_VIDEO`. * `FILTERABLE`. * `HAS_DESCRIPTION`. * `HAS_BARCODE`. + * @description Рекомендация по дополнению или замене контента. Не возвращается для карточек, которые заполнены Маркетом или содержат бывшие в употреблении товары. Часть рекомендаций относятся к **основным параметрам**, которые есть у товаров любых категорий. Другие — к тем **характеристикам**, которые есть у товара потому, что он относится к определенной категории. **1. Рекомендации, относящиеся к основным параметрам** Каждая такая рекомендация относится к **единственному параметру**. Чтобы заполнить этот параметр, пользуйтесь запросом [POST v2/businesses/{businessId}/offer-mappings/update](../../reference/business-assortment/updateOfferMappings.md). Рекомендации по заполнению параметров в `updateOfferMappings`: * `RECOGNIZED_VENDOR` — напишите название производителя так, как его пишет сам производитель (параметр `vendor`). * `PICTURE_COUNT` — добавьте изображения (параметр `pictures`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/images) Для рекомендации приходит процент ее выполнения. * `FIRST_PICTURE_SIZE`— замените первое изображение более крупным (параметр `pictures`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/images) * `TITLE_LENGTH` — измените название (параметр `name`). Составьте название по схеме: тип + бренд или производитель + модель + особенности, если есть (размер, вес, цвет). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/title) * `DESCRIPTION_LENGTH` — добавьте описание рекомендуемого размера (параметр `description`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/description) * `AVERAGE_PICTURE_SIZE` — замените все изображения на изображения высокого качества (параметр `pictures`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/images) * `FIRST_VIDEO_LENGTH` — добавьте первое видео рекомендуемой длины (параметр `videos`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/video) * `FIRST_VIDEO_SIZE` — замените первое видео на видео высокого качества (параметр `videos`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/video) * `AVERAGE_VIDEO_SIZE` — замените все видео на видео высокого качества (параметр `videos`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/video) * `VIDEO_COUNT` — добавьте хотя бы одно видео (параметр `videos`). [Требования](https://yandex.ru/support2/marketplace/ru/assortment/fields/video) Для рекомендации приходит процент ее выполнения. **2. Рекомендации, относящиеся к характеристикам по категориям** Каждая такая рекомендация предполагает заполнение **одной или нескольких характеристик**. Чтобы узнать, какие именно характеристики нужно заполнить, воспользуйтесь запросом [POST v2/category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters.md). Например, если вы получили рекомендацию `MAIN`, нужно заполнить характеристики, имеющие `MAIN` в массиве `recommendationTypes`. Рекомендации: * `MAIN` — заполните ключевые характеристики товара, которые используются в поиске и фильтрах. Для рекомендации приходит процент ее выполнения. * `ADDITIONAL` — заполните дополнительные характеристики товара. Для рекомендации приходит процент ее выполнения. * `DISTINCTIVE` — заполните характеристики, которыми отличаются друг от друга варианты товара. Для рекомендации приходит процент ее выполнения. **3. Устаревшие рекомендации** * `HAS_VIDEO`. * `FILTERABLE`. * `HAS_DESCRIPTION`. * `HAS_BARCODE`. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OfferCardStatusType.php b/erp24/lib/yandex_market_api/Model/OfferCardStatusType.php index e3ff1fc8..5aba2070 100644 --- a/erp24/lib/yandex_market_api/Model/OfferCardStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OfferCardStatusType.php @@ -2,7 +2,7 @@ /** * OfferCardStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferCardStatusType Class Doc Comment * * @category Class - * @description Статус карточки товара: * `HAS_CARD_CAN_NOT_UPDATE` — Карточка Маркета. * `HAS_CARD_CAN_UPDATE` — Можно дополнить. * `HAS_CARD_CAN_UPDATE_ERRORS` — Изменения не приняты. * `HAS_CARD_CAN_UPDATE_PROCESSING` — Изменения на проверке. * `NO_CARD_NEED_CONTENT` — Создайте карточку. * `NO_CARD_MARKET_WILL_CREATE` — Создаст Маркет. * `NO_CARD_ERRORS` — Не создана из-за ошибки. * `NO_CARD_PROCESSING` — Проверяем данные. * `NO_CARD_ADD_TO_CAMPAIGN` — Разместите товар в магазине. [Что обозначает каждый из статусов](https://yandex.ru/support/marketplace/assortment/content/statuses.html) + * @description Статус карточки товара: * `HAS_CARD_CAN_NOT_UPDATE` — Карточка Маркета. * `HAS_CARD_CAN_UPDATE` — Можно дополнить. * `HAS_CARD_CAN_UPDATE_ERRORS` — Изменения не приняты. * `HAS_CARD_CAN_UPDATE_PROCESSING` — Изменения на проверке. * `NO_CARD_NEED_CONTENT` — Создайте карточку. * `NO_CARD_MARKET_WILL_CREATE` — Создаст Маркет. * `NO_CARD_ERRORS` — Не создана из-за ошибки. * `NO_CARD_PROCESSING` — Проверяем данные. * `NO_CARD_ADD_TO_CAMPAIGN` — Разместите товар в магазине. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OfferCardsContentStatusDTO.php b/erp24/lib/yandex_market_api/Model/OfferCardsContentStatusDTO.php index 2754bc0d..5c934334 100644 --- a/erp24/lib/yandex_market_api/Model/OfferCardsContentStatusDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferCardsContentStatusDTO.php @@ -2,7 +2,7 @@ /** * OfferCardsContentStatusDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferCardsContentStatusDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_cards', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class OfferCardsContentStatusDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class OfferCardsContentStatusDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class OfferCardsContentStatusDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferConditionDTO.php b/erp24/lib/yandex_market_api/Model/OfferConditionDTO.php index 59d5ad21..c34c2e4d 100644 --- a/erp24/lib/yandex_market_api/Model/OfferConditionDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferConditionDTO.php @@ -2,7 +2,7 @@ /** * OfferConditionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OfferConditionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('quality', $data ?? [], null); @@ -387,11 +387,11 @@ class OfferConditionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class OfferConditionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class OfferConditionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferConditionQualityType.php b/erp24/lib/yandex_market_api/Model/OfferConditionQualityType.php index c321b387..dc675b32 100644 --- a/erp24/lib/yandex_market_api/Model/OfferConditionQualityType.php +++ b/erp24/lib/yandex_market_api/Model/OfferConditionQualityType.php @@ -2,7 +2,7 @@ /** * OfferConditionQualityType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OfferConditionType.php b/erp24/lib/yandex_market_api/Model/OfferConditionType.php index 55460031..dd0f1894 100644 --- a/erp24/lib/yandex_market_api/Model/OfferConditionType.php +++ b/erp24/lib/yandex_market_api/Model/OfferConditionType.php @@ -2,7 +2,7 @@ /** * OfferConditionType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OfferContentDTO.php b/erp24/lib/yandex_market_api/Model/OfferContentDTO.php index 58867028..3716016b 100644 --- a/erp24/lib/yandex_market_api/Model/OfferContentDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferContentDTO.php @@ -2,7 +2,7 @@ /** * OfferContentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('category_id', $data ?? [], null); @@ -300,15 +300,15 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['category_id'] === null) { $invalidProperties[] = "'category_id' can't be null"; } - if (($this->container['category_id'] < 1)) { - $invalidProperties[] = "invalid value for 'category_id', must be bigger than or equal to 1."; + if (($this->container['category_id'] <= 0)) { + $invalidProperties[] = "invalid value for 'category_id', must be bigger than 0."; } if ($this->container['parameter_values'] === null) { @@ -350,7 +350,7 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -365,8 +365,8 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferContentDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferContentDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferContentDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -387,7 +387,7 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets category_id * - * @param int $category_id Идентификатор категории на Маркете. Чтобы узнать идентификатор категории, к которой относится товар, воспользуйтесь запросом [POST categories/tree](../../reference/categories/getCategoriesTree.md). + * @param int $category_id Идентификатор категории на Маркете. При изменении категории убедитесь, что характеристики товара и их значения в параметре `parameterValues` вы передаете для новой категории. Список категорий Маркета можно получить с помощью запроса [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). * * @return self */ @@ -397,8 +397,8 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable throw new \InvalidArgumentException('non-nullable category_id cannot be null'); } - if (($category_id < 1)) { - throw new \InvalidArgumentException('invalid value for $category_id when calling OfferContentDTO., must be bigger than or equal to 1.'); + if (($category_id <= 0)) { + throw new \InvalidArgumentException('invalid value for $category_id when calling OfferContentDTO., must be bigger than 0.'); } $this->container['category_id'] = $category_id; @@ -419,7 +419,7 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets parameter_values * - * @param \OpenAPI\Client\Model\ParameterValueDTO[] $parameter_values Список характеристик с их значениями. С `parameterValues` обязательно передавайте `marketCategoryId` — идентификатор категории на Маркете, к которой относятся указанные характеристики товара. При **изменении** характеристик передавайте только те, значение которых нужно обновить. Чтобы **удалить** значение заданной характеристики, передайте ее `parameterId` с пустым `value`. + * @param \OpenAPI\Client\Model\ParameterValueDTO[] $parameter_values Список характеристик с их значениями. При **изменении** характеристик передавайте только те, значение которых нужно обновить. Если в `categoryId` вы меняете категорию, значения общих характеристик для старой и новой категории сохранятся, передавать их не нужно. Подробнее читайте в [«Передача значений характеристики»](../../step-by-step/parameter-values.md). * * @return self */ @@ -442,11 +442,11 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -454,12 +454,12 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -484,11 +484,11 @@ class OfferContentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferContentErrorDTO.php b/erp24/lib/yandex_market_api/Model/OfferContentErrorDTO.php index 7a24f50a..55a65319 100644 --- a/erp24/lib/yandex_market_api/Model/OfferContentErrorDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferContentErrorDTO.php @@ -2,7 +2,7 @@ /** * OfferContentErrorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferContentErrorDTO Class Doc Comment * * @category Class - * @description Текст ошибки. + * @description Текст ошибки или предупреждения. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -252,10 +252,10 @@ class OfferContentErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('parameter_id', $data ?? [], null); @@ -350,7 +350,7 @@ class OfferContentErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets parameter_id * - * @param int|null $parameter_id Идентификатор характеристики, с которой связана ошибка. + * @param int|null $parameter_id Идентификатор характеристики, с которой связана ошибка или предупреждение. * * @return self */ @@ -377,7 +377,7 @@ class OfferContentErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets message * - * @param string $message Текст ошибки. + * @param string $message Текст ошибки или предупреждения. * * @return self */ @@ -393,11 +393,11 @@ class OfferContentErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +405,12 @@ class OfferContentErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +435,11 @@ class OfferContentErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferContentErrorType.php b/erp24/lib/yandex_market_api/Model/OfferContentErrorType.php index 9ad42132..411061f6 100644 --- a/erp24/lib/yandex_market_api/Model/OfferContentErrorType.php +++ b/erp24/lib/yandex_market_api/Model/OfferContentErrorType.php @@ -2,7 +2,7 @@ /** * OfferContentErrorType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferContentErrorType Class Doc Comment * * @category Class - * @description Типы ошибок: * `OFFER_NOT_FOUND` — такого товара нет в каталоге. * `UNKNOWN_CATEGORY` — указана неизвестная категория. * `CATEGORY_MISMATCH` — указана категория, которая не совпадает с категорией товара. * `INVALID_CATEGORY` — указана нелистовая категория. Укажите ту, которая не имеет дочерних категорий. * `UNKNOWN_PARAMETER` — передана характеристика, которой нет среди характеристик категории. * `UNEXPECTED_BOOLEAN_VALUE` — вместо boolean-значения передано что-то другое. * `NUMBER_FORMAT` — передана строка, не обозначающая число, вместо числа. * `VALUE_BLANK` — передано пустое значение. * `INVALID_UNIT_ID` — передана единица измерения, недопустимая для характеристики. * `INVALID_GROUP_ID_LENGTH` — в названии превышено допустимое значение символов — 255. * `INVALID_GROUP_ID_CHARACTERS` — переданы [недопустимые символы](*ascii-code). + * @description Типы ошибок и предупреждений: * `OFFER_NOT_FOUND` — такого товара нет в каталоге. * `UNKNOWN_CATEGORY` — указана неизвестная категория. * `INVALID_CATEGORY` — указана нелистовая категория. Укажите ту, которая не имеет дочерних категорий. * `UNKNOWN_PARAMETER` — передана характеристика, которой нет среди характеристик категории. * `UNEXPECTED_BOOLEAN_VALUE` — вместо boolean-значения передано что-то другое. * `NUMBER_FORMAT` — передана строка, не обозначающая число, вместо числа. * `INVALID_UNIT_ID` — передана единица измерения, недопустимая для характеристики. * `INVALID_GROUP_ID_LENGTH` — в названии превышено допустимое значение символов — 255. * `INVALID_GROUP_ID_CHARACTERS` — переданы [недопустимые символы](*ascii-code). Проверить, какие категорийные характеристики доступны для заданной категории, и получить их настройки можно с помощью запроса [POST v2/category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters). * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -47,8 +47,6 @@ class OfferContentErrorType public const UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY'; - public const CATEGORY_MISMATCH = 'CATEGORY_MISMATCH'; - public const INVALID_CATEGORY = 'INVALID_CATEGORY'; public const UNKNOWN_PARAMETER = 'UNKNOWN_PARAMETER'; @@ -57,8 +55,6 @@ class OfferContentErrorType public const NUMBER_FORMAT = 'NUMBER_FORMAT'; - public const VALUE_BLANK = 'VALUE_BLANK'; - public const INVALID_UNIT_ID = 'INVALID_UNIT_ID'; public const INVALID_GROUP_ID_LENGTH = 'INVALID_GROUP_ID_LENGTH'; @@ -74,12 +70,10 @@ class OfferContentErrorType return [ self::OFFER_NOT_FOUND, self::UNKNOWN_CATEGORY, - self::CATEGORY_MISMATCH, self::INVALID_CATEGORY, self::UNKNOWN_PARAMETER, self::UNEXPECTED_BOOLEAN_VALUE, self::NUMBER_FORMAT, - self::VALUE_BLANK, self::INVALID_UNIT_ID, self::INVALID_GROUP_ID_LENGTH, self::INVALID_GROUP_ID_CHARACTERS diff --git a/erp24/lib/yandex_market_api/Model/OfferDefaultPriceDTO.php b/erp24/lib/yandex_market_api/Model/OfferDefaultPriceDTO.php new file mode 100644 index 00000000..46d630a7 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OfferDefaultPriceDTO.php @@ -0,0 +1,614 @@ + + */ +class OfferDefaultPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OfferDefaultPriceDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'minimum_for_bestseller' => 'float', + 'excluded_from_bestsellers' => 'bool', + 'value' => 'float', + 'currency_id' => '\OpenAPI\Client\Model\CurrencyType', + 'discount_base' => 'float', + 'updated_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'minimum_for_bestseller' => null, + 'excluded_from_bestsellers' => null, + 'value' => null, + 'currency_id' => null, + 'discount_base' => null, + 'updated_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'minimum_for_bestseller' => false, + 'excluded_from_bestsellers' => false, + 'value' => false, + 'currency_id' => false, + 'discount_base' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'minimum_for_bestseller' => 'minimumForBestseller', + 'excluded_from_bestsellers' => 'excludedFromBestsellers', + 'value' => 'value', + 'currency_id' => 'currencyId', + 'discount_base' => 'discountBase', + 'updated_at' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'minimum_for_bestseller' => 'setMinimumForBestseller', + 'excluded_from_bestsellers' => 'setExcludedFromBestsellers', + 'value' => 'setValue', + 'currency_id' => 'setCurrencyId', + 'discount_base' => 'setDiscountBase', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'minimum_for_bestseller' => 'getMinimumForBestseller', + 'excluded_from_bestsellers' => 'getExcludedFromBestsellers', + 'value' => 'getValue', + 'currency_id' => 'getCurrencyId', + 'discount_base' => 'getDiscountBase', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('minimum_for_bestseller', $data ?? [], null); + $this->setIfExists('excluded_from_bestsellers', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('currency_id', $data ?? [], null); + $this->setIfExists('discount_base', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['minimum_for_bestseller']) && ($this->container['minimum_for_bestseller'] > 100000000)) { + $invalidProperties[] = "invalid value for 'minimum_for_bestseller', must be smaller than or equal to 100000000."; + } + + if (!is_null($this->container['minimum_for_bestseller']) && ($this->container['minimum_for_bestseller'] <= 0)) { + $invalidProperties[] = "invalid value for 'minimum_for_bestseller', must be bigger than 0."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] <= 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than 0."; + } + + if (!is_null($this->container['discount_base']) && ($this->container['discount_base'] <= 0)) { + $invalidProperties[] = "invalid value for 'discount_base', must be bigger than 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets minimum_for_bestseller + * + * @return float|null + */ + public function getMinimumForBestseller() + { + return $this->container['minimum_for_bestseller']; + } + + /** + * Sets minimum_for_bestseller + * + * @param float|null $minimum_for_bestseller Минимальная цена товара для попадания в акцию «Бестселлеры Маркета». Подробнее об этом способе участия читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/marketing/promos/market/bestsellers#minimum). Передается в методе [POST v2/businesses/{businessId}/offer-prices/updates](../../reference/business-assortment/updateBusinessPrices.md). + * + * @return self + */ + public function setMinimumForBestseller($minimum_for_bestseller) + { + if (is_null($minimum_for_bestseller)) { + throw new \InvalidArgumentException('non-nullable minimum_for_bestseller cannot be null'); + } + + if (($minimum_for_bestseller > 100000000)) { + throw new \InvalidArgumentException('invalid value for $minimum_for_bestseller when calling OfferDefaultPriceDTO., must be smaller than or equal to 100000000.'); + } + if (($minimum_for_bestseller <= 0)) { + throw new \InvalidArgumentException('invalid value for $minimum_for_bestseller when calling OfferDefaultPriceDTO., must be bigger than 0.'); + } + + $this->container['minimum_for_bestseller'] = $minimum_for_bestseller; + + return $this; + } + + /** + * Gets excluded_from_bestsellers + * + * @return bool|null + */ + public function getExcludedFromBestsellers() + { + return $this->container['excluded_from_bestsellers']; + } + + /** + * Sets excluded_from_bestsellers + * + * @param bool|null $excluded_from_bestsellers Признак того, что товар не попадает в акцию «Бестселлеры Маркета». Подробнее об акции читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/marketing/promos/market/bestsellers). Если значение `true`, в методе [POST v2/businesses/{businessId}/offer-prices/updates](../../reference/business-assortment/updateBusinessPrices.md) параметр `minimumForBestseller` игнорируется. + * + * @return self + */ + public function setExcludedFromBestsellers($excluded_from_bestsellers) + { + if (is_null($excluded_from_bestsellers)) { + throw new \InvalidArgumentException('non-nullable excluded_from_bestsellers cannot be null'); + } + $this->container['excluded_from_bestsellers'] = $excluded_from_bestsellers; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Цена товара. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value <= 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling OfferDefaultPriceDTO., must be bigger than 0.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency_id + * + * @return \OpenAPI\Client\Model\CurrencyType|null + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param \OpenAPI\Client\Model\CurrencyType|null $currency_id currency_id + * + * @return self + */ + public function setCurrencyId($currency_id) + { + if (is_null($currency_id)) { + throw new \InvalidArgumentException('non-nullable currency_id cannot be null'); + } + $this->container['currency_id'] = $currency_id; + + return $this; + } + + /** + * Gets discount_base + * + * @return float|null + */ + public function getDiscountBase() + { + return $this->container['discount_base']; + } + + /** + * Sets discount_base + * + * @param float|null $discount_base Зачеркнутая цена. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. + * + * @return self + */ + public function setDiscountBase($discount_base) + { + if (is_null($discount_base)) { + throw new \InvalidArgumentException('non-nullable discount_base cannot be null'); + } + + if (($discount_base <= 0)) { + throw new \InvalidArgumentException('invalid value for $discount_base when calling OfferDefaultPriceDTO., must be bigger than 0.'); + } + + $this->container['discount_base'] = $discount_base; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime|null $updated_at Время последнего обновления. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OfferDefaultPriceListResponseDTO.php b/erp24/lib/yandex_market_api/Model/OfferDefaultPriceListResponseDTO.php new file mode 100644 index 00000000..9ff24cc8 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OfferDefaultPriceListResponseDTO.php @@ -0,0 +1,447 @@ + + */ +class OfferDefaultPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OfferDefaultPriceListResponseDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offers' => '\OpenAPI\Client\Model\OfferDefaultPriceResponseDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offers' => null, + 'paging' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offers' => false, + 'paging' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offers' => 'offers', + 'paging' => 'paging' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offers' => 'setOffers', + 'paging' => 'setPaging' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offers' => 'getOffers', + 'paging' => 'getPaging' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offers', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['offers'] === null) { + $invalidProperties[] = "'offers' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offers + * + * @return \OpenAPI\Client\Model\OfferDefaultPriceResponseDTO[] + */ + public function getOffers() + { + return $this->container['offers']; + } + + /** + * Sets offers + * + * @param \OpenAPI\Client\Model\OfferDefaultPriceResponseDTO[] $offers Список товаров. + * + * @return self + */ + public function setOffers($offers) + { + if (is_null($offers)) { + throw new \InvalidArgumentException('non-nullable offers cannot be null'); + } + $this->container['offers'] = $offers; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OfferDefaultPriceResponseDTO.php b/erp24/lib/yandex_market_api/Model/OfferDefaultPriceResponseDTO.php new file mode 100644 index 00000000..6eb109f6 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OfferDefaultPriceResponseDTO.php @@ -0,0 +1,469 @@ + + */ +class OfferDefaultPriceResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OfferDefaultPriceResponseDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offer_id' => 'string', + 'price' => '\OpenAPI\Client\Model\OfferDefaultPriceDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offer_id' => null, + 'price' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_id' => false, + 'price' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offer_id' => 'offerId', + 'price' => 'price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offer_id' => 'setOfferId', + 'price' => 'setPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offer_id' => 'getOfferId', + 'price' => 'getPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offer_id', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offer_id + * + * @return string + */ + public function getOfferId() + { + return $this->container['offer_id']; + } + + /** + * Sets offer_id + * + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * + * @return self + */ + public function setOfferId($offer_id) + { + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); + } + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferDefaultPriceResponseDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferDefaultPriceResponseDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferDefaultPriceResponseDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; + + return $this; + } + + /** + * Gets price + * + * @return \OpenAPI\Client\Model\OfferDefaultPriceDTO|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param \OpenAPI\Client\Model\OfferDefaultPriceDTO|null $price price + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OfferErrorDTO.php b/erp24/lib/yandex_market_api/Model/OfferErrorDTO.php index 769444ef..39455d2f 100644 --- a/erp24/lib/yandex_market_api/Model/OfferErrorDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferErrorDTO.php @@ -2,7 +2,7 @@ /** * OfferErrorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('message', $data ?? [], null); $this->setIfExists('comment', $data ?? [], null); @@ -353,11 +353,11 @@ class OfferErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OfferErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OfferErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferForRecommendationDTO.php b/erp24/lib/yandex_market_api/Model/OfferForRecommendationDTO.php index ee1e529b..f751d141 100644 --- a/erp24/lib/yandex_market_api/Model/OfferForRecommendationDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferForRecommendationDTO.php @@ -2,7 +2,7 @@ /** * OfferForRecommendationDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -60,7 +60,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPITypes = [ 'offer_id' => 'string', 'price' => '\OpenAPI\Client\Model\BasePriceDTO', - 'cofinance_price' => '\OpenAPI\Client\Model\GetPriceDTO', 'competitiveness' => '\OpenAPI\Client\Model\PriceCompetitivenessType', 'shows' => 'int' ]; @@ -75,7 +74,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPIFormats = [ 'offer_id' => null, 'price' => null, - 'cofinance_price' => null, 'competitiveness' => null, 'shows' => 'int64' ]; @@ -88,7 +86,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer protected static array $openAPINullables = [ 'offer_id' => false, 'price' => false, - 'cofinance_price' => false, 'competitiveness' => false, 'shows' => false ]; @@ -181,7 +178,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer protected static $attributeMap = [ 'offer_id' => 'offerId', 'price' => 'price', - 'cofinance_price' => 'cofinancePrice', 'competitiveness' => 'competitiveness', 'shows' => 'shows' ]; @@ -194,7 +190,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer protected static $setters = [ 'offer_id' => 'setOfferId', 'price' => 'setPrice', - 'cofinance_price' => 'setCofinancePrice', 'competitiveness' => 'setCompetitiveness', 'shows' => 'setShows' ]; @@ -207,7 +202,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer protected static $getters = [ 'offer_id' => 'getOfferId', 'price' => 'getPrice', - 'cofinance_price' => 'getCofinancePrice', 'competitiveness' => 'getCompetitiveness', 'shows' => 'getShows' ]; @@ -264,14 +258,13 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); - $this->setIfExists('cofinance_price', $data ?? [], null); $this->setIfExists('competitiveness', $data ?? [], null); $this->setIfExists('shows', $data ?? [], null); } @@ -311,8 +304,8 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -343,7 +336,7 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -358,8 +351,8 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferForRecommendationDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferForRecommendationDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferForRecommendationDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -394,33 +387,6 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer return $this; } - /** - * Gets cofinance_price - * - * @return \OpenAPI\Client\Model\GetPriceDTO|null - */ - public function getCofinancePrice() - { - return $this->container['cofinance_price']; - } - - /** - * Sets cofinance_price - * - * @param \OpenAPI\Client\Model\GetPriceDTO|null $cofinance_price cofinance_price - * - * @return self - */ - public function setCofinancePrice($cofinance_price) - { - if (is_null($cofinance_price)) { - throw new \InvalidArgumentException('non-nullable cofinance_price cannot be null'); - } - $this->container['cofinance_price'] = $cofinance_price; - - return $this; - } - /** * Gets competitiveness * @@ -477,11 +443,11 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -489,12 +455,12 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -519,11 +485,11 @@ class OfferForRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferManualDTO.php b/erp24/lib/yandex_market_api/Model/OfferManualDTO.php index 71d9c94e..b9d473fc 100644 --- a/erp24/lib/yandex_market_api/Model/OfferManualDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferManualDTO.php @@ -2,7 +2,7 @@ /** * OfferManualDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('url', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); @@ -285,6 +285,18 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['url'] === null) { $invalidProperties[] = "'url' can't be null"; } + if ((mb_strlen($this->container['url']) > 2000)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2000."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 500)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 500."; + } + return $invalidProperties; } @@ -313,7 +325,7 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets url * - * @param string $url Ссылка на инструкцию. + * @param string $url url * * @return self */ @@ -322,6 +334,13 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($url)) { throw new \InvalidArgumentException('non-nullable url cannot be null'); } + if ((mb_strlen($url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $url when calling OfferManualDTO., must be smaller than or equal to 2000.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling OfferManualDTO., must be bigger than or equal to 1.'); + } + $this->container['url'] = $url; return $this; @@ -349,6 +368,10 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($title)) { throw new \InvalidArgumentException('non-nullable title cannot be null'); } + if ((mb_strlen($title) > 500)) { + throw new \InvalidArgumentException('invalid length for $title when calling OfferManualDTO., must be smaller than or equal to 500.'); + } + $this->container['title'] = $title; return $this; @@ -356,11 +379,11 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +391,12 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +421,11 @@ class OfferManualDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingDTO.php b/erp24/lib/yandex_market_api/Model/OfferMappingDTO.php index c3fa413d..43d4e174 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingDTO.php @@ -2,7 +2,7 @@ /** * OfferMappingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'market_sku' => 'int', - 'model_id' => 'int', 'category_id' => 'int' ]; @@ -72,7 +71,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'market_sku' => 'int64', - 'model_id' => 'int64', 'category_id' => 'int64' ]; @@ -83,7 +81,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'market_sku' => false, - 'model_id' => false, 'category_id' => false ]; @@ -174,7 +171,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $attributeMap = [ 'market_sku' => 'marketSku', - 'model_id' => 'modelId', 'category_id' => 'categoryId' ]; @@ -185,7 +181,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $setters = [ 'market_sku' => 'setMarketSku', - 'model_id' => 'setModelId', 'category_id' => 'setCategoryId' ]; @@ -196,7 +191,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $getters = [ 'market_sku' => 'getMarketSku', - 'model_id' => 'getModelId', 'category_id' => 'getCategoryId' ]; @@ -252,13 +246,12 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('market_sku', $data ?? [], null); - $this->setIfExists('model_id', $data ?? [], null); $this->setIfExists('category_id', $data ?? [], null); } @@ -321,7 +314,7 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -340,33 +333,6 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } - /** - * Gets model_id - * - * @return int|null - */ - public function getModelId() - { - return $this->container['model_id']; - } - - /** - * Sets model_id - * - * @param int|null $model_id Идентификатор модели для текущей карточки товара на Маркете. Например, две лопатки разных цветов имеют разные SKU на Маркете (параметр `marketSku`), но одинаковый идентификатор модели товара. - * - * @return self - */ - public function setModelId($model_id) - { - if (is_null($model_id)) { - throw new \InvalidArgumentException('non-nullable model_id cannot be null'); - } - $this->container['model_id'] = $model_id; - - return $this; - } - /** * Gets category_id * @@ -396,11 +362,11 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +374,12 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +404,11 @@ class OfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingEntriesDTO.php b/erp24/lib/yandex_market_api/Model/OfferMappingEntriesDTO.php index b5282fb4..68d9be57 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingEntriesDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingEntriesDTO.php @@ -2,7 +2,7 @@ /** * OfferMappingEntriesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferMappingEntriesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('offer_mapping_entries', $data ?? [], null); @@ -356,11 +356,11 @@ class OfferMappingEntriesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class OfferMappingEntriesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class OfferMappingEntriesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingEntryDTO.php b/erp24/lib/yandex_market_api/Model/OfferMappingEntryDTO.php index feef8f4d..602d6afe 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingEntryDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingEntryDTO.php @@ -2,7 +2,7 @@ /** * OfferMappingEntryDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('mapping', $data ?? [], null); $this->setIfExists('awaiting_moderation_mapping', $data ?? [], null); @@ -421,11 +421,11 @@ class OfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ class OfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ class OfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingErrorDTO.php b/erp24/lib/yandex_market_api/Model/OfferMappingErrorDTO.php index e25689fa..a803f952 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingErrorDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingErrorDTO.php @@ -2,7 +2,7 @@ /** * OfferMappingErrorDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferMappingErrorDTO Class Doc Comment * * @category Class - * @description Текст ошибки. + * @description Текст ошибки или предупреждения. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -252,10 +252,10 @@ class OfferMappingErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('parameter_id', $data ?? [], null); @@ -350,7 +350,7 @@ class OfferMappingErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets parameter_id * - * @param int|null $parameter_id Идентификатор характеристики, с которой связана ошибка. + * @param int|null $parameter_id Идентификатор характеристики, с которой связана ошибка или предупреждение. * * @return self */ @@ -377,7 +377,7 @@ class OfferMappingErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets message * - * @param string $message Текст ошибки. + * @param string $message Текст ошибки или предупреждения. * * @return self */ @@ -393,11 +393,11 @@ class OfferMappingErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +405,12 @@ class OfferMappingErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +435,11 @@ class OfferMappingErrorDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingErrorType.php b/erp24/lib/yandex_market_api/Model/OfferMappingErrorType.php index 9862ca21..2fbf9350 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingErrorType.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingErrorType.php @@ -2,7 +2,7 @@ /** * OfferMappingErrorType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferMappingErrorType Class Doc Comment * * @category Class - * @description Типы ошибок: * `UNKNOWN_CATEGORY` — указана неизвестная категория. * `CATEGORY_MISMATCH` — указана категория, которая не совпадает с категорией товара. * `INVALID_CATEGORY` — указана нелистовая категория. Укажите ту, которая не имеет дочерних категорий. * `EMPTY_MARKET_CATEGORY` — не указана категория Маркета при передаче характеристик категории. * `UNKNOWN_PARAMETER` — передана характеристика, которой нет среди характеристик категории. * `UNEXPECTED_BOOLEAN_VALUE` — вместо boolean-значения передано что-то другое. * `NUMBER_FORMAT` — передана строка, не обозначающая число, вместо числа. * `VALUE_BLANK` — передано пустое значение. * `INVALID_UNIT_ID` — передана единица измерения, недопустимая для характеристики. * `INVALID_GROUP_ID_LENGTH` — в названии превышено допустимое значение символов — 255. * `INVALID_GROUP_ID_CHARACTERS` — переданы [недопустимые символы](*ascii-code). * `INVALID_PICKER_URL` — передана ссылка на изображение для миниатюры, которой нет в переданных ссылках на изображение товара. * `LOCKED_DIMENSIONS` — переданы габариты упаковки, которые нельзя изменить. + * @description Типы ошибок и предупреждений: * `UNKNOWN_CATEGORY` — указана неизвестная категория. * `INVALID_CATEGORY` — указана нелистовая категория. Укажите ту, которая не имеет дочерних категорий. * `EMPTY_MARKET_CATEGORY` — не указана категория Маркета при передаче характеристик категории. * `UNKNOWN_PARAMETER` — передана характеристика, которой нет среди характеристик категории. * `UNEXPECTED_BOOLEAN_VALUE` — вместо boolean-значения передано что-то другое. * `NUMBER_FORMAT` — передана строка, не обозначающая число, вместо числа. * `INVALID_UNIT_ID` — передана единица измерения, недопустимая для характеристики. * `INVALID_GROUP_ID_LENGTH` — в названии превышено допустимое значение символов — 255. * `INVALID_GROUP_ID_CHARACTERS` — переданы [недопустимые символы](*ascii-code). * `INVALID_PICKER_URL` — передана ссылка на изображение для миниатюры, которой нет в переданных ссылках на изображение товара. * `LOCKED_DIMENSIONS` — переданы габариты упаковки, которые нельзя изменить. * `INVALID_COMMODITY_CODE` — передан некорректный товарный код. Проверить, какие категорийные характеристики доступны для заданной категории, и получить их настройки можно с помощью запроса [POST v2/category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters). * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -45,8 +45,6 @@ class OfferMappingErrorType */ public const UNKNOWN_CATEGORY = 'UNKNOWN_CATEGORY'; - public const CATEGORY_MISMATCH = 'CATEGORY_MISMATCH'; - public const INVALID_CATEGORY = 'INVALID_CATEGORY'; public const EMPTY_MARKET_CATEGORY = 'EMPTY_MARKET_CATEGORY'; @@ -57,8 +55,6 @@ class OfferMappingErrorType public const NUMBER_FORMAT = 'NUMBER_FORMAT'; - public const VALUE_BLANK = 'VALUE_BLANK'; - public const INVALID_UNIT_ID = 'INVALID_UNIT_ID'; public const INVALID_GROUP_ID_LENGTH = 'INVALID_GROUP_ID_LENGTH'; @@ -69,6 +65,8 @@ class OfferMappingErrorType public const LOCKED_DIMENSIONS = 'LOCKED_DIMENSIONS'; + public const INVALID_COMMODITY_CODE = 'INVALID_COMMODITY_CODE'; + /** * Gets allowable values of the enum * @return string[] @@ -77,18 +75,17 @@ class OfferMappingErrorType { return [ self::UNKNOWN_CATEGORY, - self::CATEGORY_MISMATCH, self::INVALID_CATEGORY, self::EMPTY_MARKET_CATEGORY, self::UNKNOWN_PARAMETER, self::UNEXPECTED_BOOLEAN_VALUE, self::NUMBER_FORMAT, - self::VALUE_BLANK, self::INVALID_UNIT_ID, self::INVALID_GROUP_ID_LENGTH, self::INVALID_GROUP_ID_CHARACTERS, self::INVALID_PICKER_URL, - self::LOCKED_DIMENSIONS + self::LOCKED_DIMENSIONS, + self::INVALID_COMMODITY_CODE ]; } } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingInfoDTO.php b/erp24/lib/yandex_market_api/Model/OfferMappingInfoDTO.php index 909a93c8..a65c29cd 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingInfoDTO.php @@ -2,7 +2,7 @@ /** * OfferMappingInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OfferMappingInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('mapping', $data ?? [], null); $this->setIfExists('awaiting_moderation_mapping', $data ?? [], null); @@ -387,11 +387,11 @@ class OfferMappingInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class OfferMappingInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class OfferMappingInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingKindType.php b/erp24/lib/yandex_market_api/Model/OfferMappingKindType.php index 717354ab..e9cf0dd5 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingKindType.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingKindType.php @@ -2,7 +2,7 @@ /** * OfferMappingKindType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferMappingKindType Class Doc Comment * * @category Class - * @description Вид маппинга. + * @description Вид маппинга: * `ALL` — все товары. * `ACTIVE` — готовые к продаже товары. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OfferMappingSuggestionsListDTO.php b/erp24/lib/yandex_market_api/Model/OfferMappingSuggestionsListDTO.php index 0a989fc9..cab8ae25 100644 --- a/erp24/lib/yandex_market_api/Model/OfferMappingSuggestionsListDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferMappingSuggestionsListDTO.php @@ -2,7 +2,7 @@ /** * OfferMappingSuggestionsListDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OfferMappingSuggestionsListDTO implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -322,11 +322,11 @@ class OfferMappingSuggestionsListDTO implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class OfferMappingSuggestionsListDTO implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class OfferMappingSuggestionsListDTO implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferMediaFileDTO.php b/erp24/lib/yandex_market_api/Model/OfferMediaFileDTO.php new file mode 100644 index 00000000..ca13f8c0 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OfferMediaFileDTO.php @@ -0,0 +1,493 @@ + + */ +class OfferMediaFileDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OfferMediaFileDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'url' => 'string', + 'title' => 'string', + 'upload_state' => '\OpenAPI\Client\Model\MediaFileUploadStateType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'url' => null, + 'title' => null, + 'upload_state' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'url' => false, + 'title' => false, + 'upload_state' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + 'title' => 'title', + 'upload_state' => 'uploadState' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + 'title' => 'setTitle', + 'upload_state' => 'setUploadState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + 'title' => 'getTitle', + 'upload_state' => 'getUploadState' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('upload_state', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['url']) && (mb_strlen($this->container['url']) > 2000)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2000."; + } + + if (!is_null($this->container['url']) && (mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + if ((mb_strlen($url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $url when calling OfferMediaFileDTO., must be smaller than or equal to 2000.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling OfferMediaFileDTO., must be bigger than or equal to 1.'); + } + + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Название медиафайла. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets upload_state + * + * @return \OpenAPI\Client\Model\MediaFileUploadStateType|null + */ + public function getUploadState() + { + return $this->container['upload_state']; + } + + /** + * Sets upload_state + * + * @param \OpenAPI\Client\Model\MediaFileUploadStateType|null $upload_state upload_state + * + * @return self + */ + public function setUploadState($upload_state) + { + if (is_null($upload_state)) { + throw new \InvalidArgumentException('non-nullable upload_state cannot be null'); + } + $this->container['upload_state'] = $upload_state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OfferMediaFilesDTO.php b/erp24/lib/yandex_market_api/Model/OfferMediaFilesDTO.php new file mode 100644 index 00000000..384fb90c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OfferMediaFilesDTO.php @@ -0,0 +1,562 @@ + + */ +class OfferMediaFilesDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OfferMediaFilesDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_video_as_cover' => 'bool', + 'videos' => '\OpenAPI\Client\Model\OfferMediaFileDTO[]', + 'pictures' => '\OpenAPI\Client\Model\OfferMediaFileDTO[]', + 'manuals' => '\OpenAPI\Client\Model\OfferMediaFileDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first_video_as_cover' => null, + 'videos' => null, + 'pictures' => null, + 'manuals' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_video_as_cover' => false, + 'videos' => true, + 'pictures' => true, + 'manuals' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_video_as_cover' => 'firstVideoAsCover', + 'videos' => 'videos', + 'pictures' => 'pictures', + 'manuals' => 'manuals' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_video_as_cover' => 'setFirstVideoAsCover', + 'videos' => 'setVideos', + 'pictures' => 'setPictures', + 'manuals' => 'setManuals' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_video_as_cover' => 'getFirstVideoAsCover', + 'videos' => 'getVideos', + 'pictures' => 'getPictures', + 'manuals' => 'getManuals' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('first_video_as_cover', $data ?? [], null); + $this->setIfExists('videos', $data ?? [], null); + $this->setIfExists('pictures', $data ?? [], null); + $this->setIfExists('manuals', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['videos']) && (count($this->container['videos']) < 1)) { + $invalidProperties[] = "invalid value for 'videos', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) < 1)) { + $invalidProperties[] = "invalid value for 'manuals', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets first_video_as_cover + * + * @return bool|null + * @deprecated + */ + public function getFirstVideoAsCover() + { + return $this->container['first_video_as_cover']; + } + + /** + * Sets first_video_as_cover + * + * @param bool|null $first_video_as_cover Использовать первое видео в карточке как видеообложку. Передайте `true`, чтобы первое видео использовалось как видеообложка, или `false`, чтобы видеообложка не отображалась в карточке товара. + * + * @return self + * @deprecated + */ + public function setFirstVideoAsCover($first_video_as_cover) + { + if (is_null($first_video_as_cover)) { + throw new \InvalidArgumentException('non-nullable first_video_as_cover cannot be null'); + } + $this->container['first_video_as_cover'] = $first_video_as_cover; + + return $this; + } + + /** + * Gets videos + * + * @return \OpenAPI\Client\Model\OfferMediaFileDTO[]|null + */ + public function getVideos() + { + return $this->container['videos']; + } + + /** + * Sets videos + * + * @param \OpenAPI\Client\Model\OfferMediaFileDTO[]|null $videos Видеофайлы товара. + * + * @return self + */ + public function setVideos($videos) + { + if (is_null($videos)) { + array_push($this->openAPINullablesSetToNull, 'videos'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('videos', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($videos) && (count($videos) < 1)) { + throw new \InvalidArgumentException('invalid length for $videos when calling OfferMediaFilesDTO., number of items must be greater than or equal to 1.'); + } + $this->container['videos'] = $videos; + + return $this; + } + + /** + * Gets pictures + * + * @return \OpenAPI\Client\Model\OfferMediaFileDTO[]|null + */ + public function getPictures() + { + return $this->container['pictures']; + } + + /** + * Sets pictures + * + * @param \OpenAPI\Client\Model\OfferMediaFileDTO[]|null $pictures Изображения товара. + * + * @return self + */ + public function setPictures($pictures) + { + if (is_null($pictures)) { + array_push($this->openAPINullablesSetToNull, 'pictures'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pictures', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling OfferMediaFilesDTO., number of items must be greater than or equal to 1.'); + } + $this->container['pictures'] = $pictures; + + return $this; + } + + /** + * Gets manuals + * + * @return \OpenAPI\Client\Model\OfferMediaFileDTO[]|null + */ + public function getManuals() + { + return $this->container['manuals']; + } + + /** + * Sets manuals + * + * @param \OpenAPI\Client\Model\OfferMediaFileDTO[]|null $manuals Руководства по использованию товара. + * + * @return self + */ + public function setManuals($manuals) + { + if (is_null($manuals)) { + array_push($this->openAPINullablesSetToNull, 'manuals'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('manuals', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($manuals) && (count($manuals) < 1)) { + throw new \InvalidArgumentException('invalid length for $manuals when calling OfferMediaFilesDTO., number of items must be greater than or equal to 1.'); + } + $this->container['manuals'] = $manuals; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OfferParamDTO.php b/erp24/lib/yandex_market_api/Model/OfferParamDTO.php index 2af96770..a457db03 100644 --- a/erp24/lib/yandex_market_api/Model/OfferParamDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferParamDTO.php @@ -2,7 +2,7 @@ /** * OfferParamDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferParamDTO Class Doc Comment * * @category Class - * @description Параметры товара. Если у товара несколько значений одного параметра, передайте их с одним и тем же `name`, но разными `value`. {% cut \"Пример\" %} ```json \"params\": [ { \"name\": \"Цвет\", \"value\": \"Зеленый\" }, { \"name\": \"Цвет\", \"value\": \"Желтый\" } ] ``` {% endcut %} + * @description Параметры товара. Если у товара несколько значений одного параметра, передайте их с одним и тем же `name`, но разными `value`. {% cut \"Пример\" %} ```json translate=no \"params\": [ { \"name\": \"Цвет для фильтра\", \"value\": \"Зеленый\" }, { \"name\": \"Цвет для фильтра\", \"value\": \"Желтый\" } ] ``` {% endcut %} * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); @@ -285,6 +285,10 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + if ((mb_strlen($this->container['name']) > 200)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 200."; + } + if ($this->container['value'] === null) { $invalidProperties[] = "'value' can't be null"; } @@ -316,7 +320,7 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets name * - * @param string $name Название. Должно совпадать с названием характеристики на Маркете. Узнать его можно из Excel-шаблона категории или через запрос [POST category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters.md). + * @param string $name Название характеристики. Должно совпадать с названием характеристики на Маркете. Узнать его можно из Excel-шаблона категории или через запрос [POST v2/category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters.md). * * @return self */ @@ -325,6 +329,10 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($name)) { throw new \InvalidArgumentException('non-nullable name cannot be null'); } + if ((mb_strlen($name) > 200)) { + throw new \InvalidArgumentException('invalid length for $name when calling OfferParamDTO., must be smaller than or equal to 200.'); + } + $this->container['name'] = $name; return $this; @@ -359,11 +367,11 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +379,12 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +409,11 @@ class OfferParamDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsListResponseDTO.php b/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsListResponseDTO.php index e39f7d8b..16b1a7a3 100644 --- a/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsListResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsListResponseDTO.php @@ -2,7 +2,7 @@ /** * OfferPriceByOfferIdsListResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,7 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'offers' => '\OpenAPI\Client\Model\OfferPriceByOfferIdsResponseDTO[]', - 'paging' => '\OpenAPI\Client\Model\ScrollingPagerDTO' + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' ]; /** @@ -246,10 +246,10 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -330,7 +330,7 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess /** * Gets paging * - * @return \OpenAPI\Client\Model\ScrollingPagerDTO|null + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null */ public function getPaging() { @@ -340,7 +340,7 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess /** * Sets paging * - * @param \OpenAPI\Client\Model\ScrollingPagerDTO|null $paging paging + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging * * @return self */ @@ -356,11 +356,11 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class OfferPriceByOfferIdsListResponseDTO implements ModelInterface, ArrayAccess /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsResponseDTO.php b/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsResponseDTO.php index e7513429..2d4595fe 100644 --- a/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferPriceByOfferIdsResponseDTO.php @@ -2,7 +2,7 @@ /** * OfferPriceByOfferIdsResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -297,8 +297,8 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -329,7 +329,7 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -344,8 +344,8 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferPriceByOfferIdsResponseDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferPriceByOfferIdsResponseDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferPriceByOfferIdsResponseDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -409,11 +409,11 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -421,12 +421,12 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -451,11 +451,11 @@ class OfferPriceByOfferIdsResponseDTO implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferPriceDTO.php b/erp24/lib/yandex_market_api/Model/OfferPriceDTO.php index 6c95041c..22ad1936 100644 --- a/erp24/lib/yandex_market_api/Model/OfferPriceDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferPriceDTO.php @@ -2,7 +2,7 @@ /** * OfferPriceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -290,8 +290,8 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -322,7 +322,7 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -337,8 +337,8 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferPriceDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferPriceDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferPriceDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -375,11 +375,11 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -387,12 +387,12 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -417,11 +417,11 @@ class OfferPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferPriceListResponseDTO.php b/erp24/lib/yandex_market_api/Model/OfferPriceListResponseDTO.php index 183a4bd3..f8356ee8 100644 --- a/erp24/lib/yandex_market_api/Model/OfferPriceListResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferPriceListResponseDTO.php @@ -2,7 +2,7 @@ /** * OfferPriceListResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,7 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPITypes = [ 'offers' => '\OpenAPI\Client\Model\OfferPriceResponseDTO[]', - 'paging' => '\OpenAPI\Client\Model\ScrollingPagerDTO', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO', 'total' => 'int' ]; @@ -252,10 +252,10 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -337,7 +337,7 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets paging * - * @return \OpenAPI\Client\Model\ScrollingPagerDTO|null + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null */ public function getPaging() { @@ -347,7 +347,7 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Sets paging * - * @param \OpenAPI\Client\Model\ScrollingPagerDTO|null $paging paging + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging * * @return self */ @@ -390,11 +390,11 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class OfferPriceListResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferPriceResponseDTO.php b/erp24/lib/yandex_market_api/Model/OfferPriceResponseDTO.php index be444778..459d02d9 100644 --- a/erp24/lib/yandex_market_api/Model/OfferPriceResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferPriceResponseDTO.php @@ -2,7 +2,7 @@ /** * OfferPriceResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OfferPriceResponseDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -382,7 +382,7 @@ class OfferPriceResponseDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -430,11 +430,11 @@ class OfferPriceResponseDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -442,12 +442,12 @@ class OfferPriceResponseDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -472,11 +472,11 @@ class OfferPriceResponseDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferProcessingNoteDTO.php b/erp24/lib/yandex_market_api/Model/OfferProcessingNoteDTO.php index e421dea6..0b0d6875 100644 --- a/erp24/lib/yandex_market_api/Model/OfferProcessingNoteDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferProcessingNoteDTO.php @@ -2,7 +2,7 @@ /** * OfferProcessingNoteDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferProcessingNoteDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('payload', $data ?? [], null); @@ -353,11 +353,11 @@ class OfferProcessingNoteDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OfferProcessingNoteDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OfferProcessingNoteDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferProcessingNoteType.php b/erp24/lib/yandex_market_api/Model/OfferProcessingNoteType.php index d1664de0..9dab4a1b 100644 --- a/erp24/lib/yandex_market_api/Model/OfferProcessingNoteType.php +++ b/erp24/lib/yandex_market_api/Model/OfferProcessingNoteType.php @@ -2,7 +2,7 @@ /** * OfferProcessingNoteType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferProcessingNoteType Class Doc Comment * * @category Class - * @description Тип причины, по которой товар не прошел модерацию: * `ASSORTMENT` — товар производится в разных вариантах. Каждый из них нужно описать как отдельный товар (входной параметр `offer-mapping-entry` запроса [POST campaigns/{campaignId}/offer-mapping-entries/updates](../../reference/offer-mappings/updateOfferMappingEntries.md) или строка в каталоге, если вы загружаете товары через кабинет продавца на Маркете). * `CANCELLED` — товар отозван с модерации по вашей инициативе. * `CONFLICTING_INFORMATION` _(ранее ошибочно `CONFLICTING`)_ — вы предоставили противоречивую информацию о товаре. Параметры, которые нужно исправить, указаны в параметре `payload`. * `DEPARTMENT_FROZEN` — правила размещения товаров в данной категории перерабатываются, поэтому товар пока не может пройти модерацию. * `INCORRECT_INFORMATION` — информация о товаре, которую вы предоставили, противоречит описанию от производителя. Параметры, которые нужно исправить, указаны в параметре `payload`. * `LEGAL_CONFLICT` — товар не прошел модерацию по юридическим причинам. Например, он официально не продается в России или у вас нет разрешения на его продажу. * `NEED_CLASSIFICATION_INFORMATION` — информации о товаре, которую вы предоставили, не хватает, чтобы отнести его к категории. Проверьте, что правильно указали название, категорию, производителя и страны производства товара, а также URL изображений или страниц с описанием, по которым можно идентифицировать товар. * `NEED_INFORMATION` — товар раньше не продавался в России и пока не размещается на Маркете. Для него можно создать карточку. Подробнее см. в разделе [Работа с карточкой товара](https://yandex.ru/support/marketplace/assortment/content/index.html) Справки Маркета для продавцов. * `NEED_PICTURES` — для идентификации товара нужны его изображения. Отправьте URL изображений товара в запросе [POST campaigns/{campaignId}/offer-mapping-entries/updates](../../reference/offer-mappings/updateOfferMappingEntries.md) или загрузите обновленный каталог через кабинет продавца на Маркете. * `NEED_VENDOR` — неверно указан производитель товара. * `NO_CATEGORY`, `NO_KNOWLEDGE` — товары из указанной категории пока не размещаются на Маркете. Если категория появится, товар будет снова отправлен на модерацию. * `NO_PARAMETERS_IN_SHOP_TITLE` — товар производится в разных вариантах, и из указанного названия непонятно, о каком идет речь. Параметры, которые нужно добавить в название товара, указаны в параметре `payload`. * `NO_SIZE_MEASURE` — для этого товара нужна размерная сетка. Отправьте ее в службу поддержки или вашему менеджеру. Требования к размерной сетке указаны в параметре `payload`. * `UNKNOWN` — товар не прошел модерацию по другой причине. Обратитесь в службу поддержки или к вашему менеджеру. + * @description Тип причины, по которой товар не прошел модерацию: * `ASSORTMENT` — товар производится в разных вариантах. Каждый из них нужно описать как отдельный товар (параметр `offerMappings` в запросе [POST v2/businesses/{businessId}/offer-mappings/update](../../reference/business-assortment/updateOfferMappings.md) или строка в каталоге, если вы загружаете товары через кабинет продавца на Маркете). * `CANCELLED` — товар отозван с модерации по вашей инициативе. * `CONFLICTING_INFORMATION` _(ранее ошибочно `CONFLICTING`)_ — вы предоставили противоречивую информацию о товаре. Параметры, которые нужно исправить, указаны в параметре `payload`. * `OTHER` — товар не прошел модерацию по другой причине. Обратитесь в службу поддержки или к вашему менеджеру. * `DEPARTMENT_FROZEN` — правила размещения товаров в данной категории перерабатываются, поэтому товар пока не может пройти модерацию. * `INCORRECT_INFORMATION` — информация о товаре, которую вы предоставили, противоречит описанию от производителя. Параметры, которые нужно исправить, указаны в параметре `payload`. * `LEGAL_CONFLICT` — товар не прошел модерацию по юридическим причинам. Например, он официально не продается в России или у вас нет разрешения на его продажу. * `NEED_CLASSIFICATION_INFORMATION` — информации о товаре, которую вы предоставили, не хватает, чтобы отнести его к категории. Проверьте, что правильно указали название, категорию, производителя и страны производства товара, а также URL изображений или страниц с описанием, по которым можно идентифицировать товар. * `NEED_INFORMATION` — товар раньше не продавался в России и пока не размещается на Маркете. Для него можно создать карточку. Подробнее см. в разделе [Работа с карточкой товара](https://yandex.ru/support/marketplace/assortment/content/index.html) Справки Маркета для продавцов. * `NEED_PICTURES` — для идентификации товара нужны его изображения. Отправьте URL изображений товара в запросе [POST v2/businesses/{businessId}/offer-mappings/update](../../reference/business-assortment/updateOfferMappings.md) или загрузите обновленный каталог через кабинет продавца на Маркете. * `NEED_VENDOR` — неверно указан производитель товара. * `NO_CATEGORY`, `NO_KNOWLEDGE` — товары из указанной категории пока не размещаются на Маркете. Если категория появится, товар будет снова отправлен на модерацию. * `NO_PARAMETERS_IN_SHOP_TITLE` — товар производится в разных вариантах, и из указанного названия непонятно, о каком идет речь. Параметры, которые нужно добавить в название товара, указаны в параметре `payload`. * `NO_SIZE_MEASURE` — для этого товара нужна размерная сетка. Отправьте ее в службу поддержки или вашему менеджеру. Требования к размерной сетке указаны в параметре `payload`. * `SAMPLE_LINE` — товар не прошел модерацию из-за лишней строки. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OfferProcessingStateDTO.php b/erp24/lib/yandex_market_api/Model/OfferProcessingStateDTO.php index 1840196e..e092ddc5 100644 --- a/erp24/lib/yandex_market_api/Model/OfferProcessingStateDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferProcessingStateDTO.php @@ -2,7 +2,7 @@ /** * OfferProcessingStateDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferProcessingStateDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('notes', $data ?? [], null); @@ -282,6 +282,10 @@ class OfferProcessingStateDTO implements ModelInterface, ArrayAccess, \JsonSeria { $invalidProperties = []; + if (!is_null($this->container['notes']) && (count($this->container['notes']) < 1)) { + $invalidProperties[] = "invalid value for 'notes', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -353,6 +357,11 @@ class OfferProcessingStateDTO implements ModelInterface, ArrayAccess, \JsonSeria $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($notes) && (count($notes) < 1)) { + throw new \InvalidArgumentException('invalid length for $notes when calling OfferProcessingStateDTO., number of items must be greater than or equal to 1.'); + } $this->container['notes'] = $notes; return $this; @@ -360,11 +369,11 @@ class OfferProcessingStateDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +381,12 @@ class OfferProcessingStateDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +411,11 @@ class OfferProcessingStateDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferProcessingStatusType.php b/erp24/lib/yandex_market_api/Model/OfferProcessingStatusType.php index 9ae995b6..00848890 100644 --- a/erp24/lib/yandex_market_api/Model/OfferProcessingStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OfferProcessingStatusType.php @@ -2,7 +2,7 @@ /** * OfferProcessingStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferProcessingStatusType Class Doc Comment * * @category Class - * @description Статус публикации товара: * `READY` — товар прошел модерацию. Чтобы разместить его на Маркете, установите для него цену. * `IN_WORK` — товар проходит модерацию. Это занимает несколько дней. * `NEED_CONTENT` — для товара без SKU на Маркете `marketSku` нужно найти карточку самостоятельно (через API или кабинет продавца на Маркете) или создать ее, если товар еще не продается на Маркете. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. Информация о причинах отклонения возвращается в параметре `notes`. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. + * @description Статус публикации товара: * `UNKNOWN` — неизвестный статус. * `READY` — товар прошел модерацию. Чтобы разместить его на Маркете, установите для него цену. * `IN_WORK` — товар проходит модерацию. Это занимает несколько дней. * `NEED_INFO` — товар не прошел модерацию из-за ошибок или недостающих сведений в описании товара. Информация о причинах отклонения возвращается в параметре `notes`. * `NEED_MAPPING` — у товара нельзя создать карточку. * `NEED_CONTENT` — для товара без SKU на Маркете (`marketSku`) нужно найти карточку самостоятельно (через API или кабинет продавца на Маркете) или создать ее, если товар еще не продается на Маркете. * `CONTENT_PROCESSING` — товар находится на модерации. * `SUSPENDED` — товар не прошел модерацию, так как Маркет пока не размещает подобные товары. * `REJECTED` — товар не прошел модерацию, так как Маркет не планирует размещать подобные товары. * `REVIEW` — принимается решение о размещении товара. * `CREATE_ERROR` — не удалось создать карточку товара. * `UPDATE_ERROR` — у карточки товара есть непримененные изменения. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OfferRecommendationDTO.php b/erp24/lib/yandex_market_api/Model/OfferRecommendationDTO.php index 1f021131..71e88380 100644 --- a/erp24/lib/yandex_market_api/Model/OfferRecommendationDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferRecommendationDTO.php @@ -2,7 +2,7 @@ /** * OfferRecommendationDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer', $data ?? [], null); $this->setIfExists('recommendation', $data ?? [], null); @@ -353,11 +353,11 @@ class OfferRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OfferRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OfferRecommendationDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferRecommendationInfoDTO.php b/erp24/lib/yandex_market_api/Model/OfferRecommendationInfoDTO.php index d2cd508b..cc60e9b9 100644 --- a/erp24/lib/yandex_market_api/Model/OfferRecommendationInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferRecommendationInfoDTO.php @@ -2,7 +2,7 @@ /** * OfferRecommendationInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'offer_id' => 'string', - 'recommended_cofinance_price' => '\OpenAPI\Client\Model\BasePriceDTO', 'competitiveness_thresholds' => '\OpenAPI\Client\Model\PriceCompetitivenessThresholdsDTO' ]; @@ -72,7 +71,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPIFormats = [ 'offer_id' => null, - 'recommended_cofinance_price' => null, 'competitiveness_thresholds' => null ]; @@ -83,7 +81,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static array $openAPINullables = [ 'offer_id' => false, - 'recommended_cofinance_price' => false, 'competitiveness_thresholds' => false ]; @@ -174,7 +171,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $attributeMap = [ 'offer_id' => 'offerId', - 'recommended_cofinance_price' => 'recommendedCofinancePrice', 'competitiveness_thresholds' => 'competitivenessThresholds' ]; @@ -185,7 +181,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $setters = [ 'offer_id' => 'setOfferId', - 'recommended_cofinance_price' => 'setRecommendedCofinancePrice', 'competitiveness_thresholds' => 'setCompetitivenessThresholds' ]; @@ -196,7 +191,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $getters = [ 'offer_id' => 'getOfferId', - 'recommended_cofinance_price' => 'getRecommendedCofinancePrice', 'competitiveness_thresholds' => 'getCompetitivenessThresholds' ]; @@ -252,13 +246,12 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); - $this->setIfExists('recommended_cofinance_price', $data ?? [], null); $this->setIfExists('competitiveness_thresholds', $data ?? [], null); } @@ -297,8 +290,8 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -329,7 +322,7 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -344,8 +337,8 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OfferRecommendationInfoDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferRecommendationInfoDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OfferRecommendationInfoDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -353,33 +346,6 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe return $this; } - /** - * Gets recommended_cofinance_price - * - * @return \OpenAPI\Client\Model\BasePriceDTO|null - */ - public function getRecommendedCofinancePrice() - { - return $this->container['recommended_cofinance_price']; - } - - /** - * Sets recommended_cofinance_price - * - * @param \OpenAPI\Client\Model\BasePriceDTO|null $recommended_cofinance_price recommended_cofinance_price - * - * @return self - */ - public function setRecommendedCofinancePrice($recommended_cofinance_price) - { - if (is_null($recommended_cofinance_price)) { - throw new \InvalidArgumentException('non-nullable recommended_cofinance_price cannot be null'); - } - $this->container['recommended_cofinance_price'] = $recommended_cofinance_price; - - return $this; - } - /** * Gets competitiveness_thresholds * @@ -409,11 +375,11 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -421,12 +387,12 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -451,11 +417,11 @@ class OfferRecommendationInfoDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferRecommendationsResultDTO.php b/erp24/lib/yandex_market_api/Model/OfferRecommendationsResultDTO.php index 184215f8..0a34d4f7 100644 --- a/erp24/lib/yandex_market_api/Model/OfferRecommendationsResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferRecommendationsResultDTO.php @@ -2,7 +2,7 @@ /** * OfferRecommendationsResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferRecommendationsResultDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('offer_recommendations', $data ?? [], null); @@ -356,11 +356,11 @@ class OfferRecommendationsResultDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class OfferRecommendationsResultDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class OfferRecommendationsResultDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferSellingProgramDTO.php b/erp24/lib/yandex_market_api/Model/OfferSellingProgramDTO.php index dfe85a6f..a4ae7e0b 100644 --- a/erp24/lib/yandex_market_api/Model/OfferSellingProgramDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferSellingProgramDTO.php @@ -2,7 +2,7 @@ /** * OfferSellingProgramDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OfferSellingProgramDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('selling_program', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -359,11 +359,11 @@ class OfferSellingProgramDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class OfferSellingProgramDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class OfferSellingProgramDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OfferSellingProgramStatusType.php b/erp24/lib/yandex_market_api/Model/OfferSellingProgramStatusType.php index 60752389..85abbf5b 100644 --- a/erp24/lib/yandex_market_api/Model/OfferSellingProgramStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OfferSellingProgramStatusType.php @@ -2,7 +2,7 @@ /** * OfferSellingProgramStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OfferType.php b/erp24/lib/yandex_market_api/Model/OfferType.php index 12f5c542..3f7a2aa4 100644 --- a/erp24/lib/yandex_market_api/Model/OfferType.php +++ b/erp24/lib/yandex_market_api/Model/OfferType.php @@ -2,7 +2,7 @@ /** * OfferType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OfferType Class Doc Comment * * @category Class - * @description Особый тип товара: * `MEDICINE` — лекарства. * `BOOK` — бумажные и электронные книги. * `AUDIOBOOK` — аудиокниги. * `ARTIST_TITLE` — музыкальная и видеопродукция. * `ON_DEMAND` — товары на заказ. * `ALCOHOL` — алкоголь. {% note info \"Если ваш товар — книга\" %} Укажите год издания в характеристиках товара. [Подробнее о параметре](../../reference/business-assortment/updateOfferMappings.md#offerparamdto) {% endnote %} + * @description Особый тип товара: * `DEFAULT` — товары, для которых вы передавали особый тип ранее и хотите убрать его. * `MEDICINE` — лекарства. * `BOOK` — бумажные и электронные книги. * `AUDIOBOOK` — аудиокниги. * `ARTIST_TITLE` — музыкальная и видеопродукция. * `ON_DEMAND` — товары на заказ. * `ALCOHOL` — алкоголь. {% note info \"Если ваш товар — книга\" %} Укажите год издания в характеристиках товара. [Подробнее о параметре](../../reference/business-assortment/updateOfferMappings.md#offerparamdto) {% endnote %} * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OfferWeightDimensionsDTO.php b/erp24/lib/yandex_market_api/Model/OfferWeightDimensionsDTO.php index 03886528..ce433f76 100644 --- a/erp24/lib/yandex_market_api/Model/OfferWeightDimensionsDTO.php +++ b/erp24/lib/yandex_market_api/Model/OfferWeightDimensionsDTO.php @@ -2,7 +2,7 @@ /** * OfferWeightDimensionsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('length', $data ?? [], null); $this->setIfExists('width', $data ?? [], null); @@ -299,15 +299,31 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri if ($this->container['length'] === null) { $invalidProperties[] = "'length' can't be null"; } + if (($this->container['length'] < 0)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 0."; + } + if ($this->container['width'] === null) { $invalidProperties[] = "'width' can't be null"; } + if (($this->container['width'] < 0)) { + $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0."; + } + if ($this->container['height'] === null) { $invalidProperties[] = "'height' can't be null"; } + if (($this->container['height'] < 0)) { + $invalidProperties[] = "invalid value for 'height', must be bigger than or equal to 0."; + } + if ($this->container['weight'] === null) { $invalidProperties[] = "'weight' can't be null"; } + if (($this->container['weight'] < 0)) { + $invalidProperties[] = "invalid value for 'weight', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -345,6 +361,11 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri if (is_null($length)) { throw new \InvalidArgumentException('non-nullable length cannot be null'); } + + if (($length < 0)) { + throw new \InvalidArgumentException('invalid value for $length when calling OfferWeightDimensionsDTO., must be bigger than or equal to 0.'); + } + $this->container['length'] = $length; return $this; @@ -372,6 +393,11 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri if (is_null($width)) { throw new \InvalidArgumentException('non-nullable width cannot be null'); } + + if (($width < 0)) { + throw new \InvalidArgumentException('invalid value for $width when calling OfferWeightDimensionsDTO., must be bigger than or equal to 0.'); + } + $this->container['width'] = $width; return $this; @@ -399,6 +425,11 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri if (is_null($height)) { throw new \InvalidArgumentException('non-nullable height cannot be null'); } + + if (($height < 0)) { + throw new \InvalidArgumentException('invalid value for $height when calling OfferWeightDimensionsDTO., must be bigger than or equal to 0.'); + } + $this->container['height'] = $height; return $this; @@ -426,6 +457,11 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri if (is_null($weight)) { throw new \InvalidArgumentException('non-nullable weight cannot be null'); } + + if (($weight < 0)) { + throw new \InvalidArgumentException('invalid value for $weight when calling OfferWeightDimensionsDTO., must be bigger than or equal to 0.'); + } + $this->container['weight'] = $weight; return $this; @@ -433,11 +469,11 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +481,12 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +511,11 @@ class OfferWeightDimensionsDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OptionValuesLimitedDTO.php b/erp24/lib/yandex_market_api/Model/OptionValuesLimitedDTO.php index 57df1eb6..55c8f202 100644 --- a/erp24/lib/yandex_market_api/Model/OptionValuesLimitedDTO.php +++ b/erp24/lib/yandex_market_api/Model/OptionValuesLimitedDTO.php @@ -2,7 +2,7 @@ /** * OptionValuesLimitedDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OptionValuesLimitedDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('limiting_option_value_id', $data ?? [], null); $this->setIfExists('option_value_ids', $data ?? [], null); @@ -352,6 +352,8 @@ class OptionValuesLimitedDTO implements ModelInterface, ArrayAccess, \JsonSerial if (is_null($option_value_ids)) { throw new \InvalidArgumentException('non-nullable option_value_ids cannot be null'); } + + $this->container['option_value_ids'] = $option_value_ids; return $this; @@ -359,11 +361,11 @@ class OptionValuesLimitedDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +373,12 @@ class OptionValuesLimitedDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +403,11 @@ class OptionValuesLimitedDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBoxLayoutDTO.php b/erp24/lib/yandex_market_api/Model/OrderBoxLayoutDTO.php index c5cab69b..f2a40f46 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBoxLayoutDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBoxLayoutDTO.php @@ -2,7 +2,7 @@ /** * OrderBoxLayoutDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('items', $data ?? [], null); } @@ -331,11 +331,11 @@ class OrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -343,12 +343,12 @@ class OrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -373,11 +373,11 @@ class OrderBoxLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBoxLayoutItemDTO.php b/erp24/lib/yandex_market_api/Model/OrderBoxLayoutItemDTO.php index 0932ab65..32151557 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBoxLayoutItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBoxLayoutItemDTO.php @@ -2,7 +2,7 @@ /** * OrderBoxLayoutItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('full_count', $data ?? [], null); @@ -303,6 +303,10 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali $invalidProperties[] = "invalid value for 'full_count', must be bigger than or equal to 1."; } + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -331,7 +335,7 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets id * - * @param int $id Идентификатор товара в заказе. {% cut \"Где его взять\" %} Идентификатор приходит в ответе на запрос [GET campaigns/{campaignId}/orders/{orderId}](../../reference/orders/getOrder.md) и в запросе Маркета [POST order/accept](../../pushapi/reference/orderAccept.md) — параметр `id` в `items`. {% endcut %}   + * @param int $id Идентификатор товара в заказе. Он приходит в ответе метода [POST v1/businesses/{businessId}/orders](../../reference/orders/getBusinessOrders.md) — параметр `id` в `items`. * * @return self */ @@ -417,7 +421,7 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets instances * - * @param \OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]|null $instances Переданные вами коды маркировки. + * @param \OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]|null $instances Переданные коды маркировки. * * @return self */ @@ -433,6 +437,11 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling OrderBoxLayoutItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['instances'] = $instances; return $this; @@ -440,11 +449,11 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -452,12 +461,12 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -482,11 +491,11 @@ class OrderBoxLayoutItemDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBoxLayoutPartialCountDTO.php b/erp24/lib/yandex_market_api/Model/OrderBoxLayoutPartialCountDTO.php index fe78e212..5fe5c682 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBoxLayoutPartialCountDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBoxLayoutPartialCountDTO.php @@ -2,7 +2,7 @@ /** * OrderBoxLayoutPartialCountDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrderBoxLayoutPartialCountDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('current', $data ?? [], null); $this->setIfExists('total', $data ?? [], null); @@ -377,11 +377,11 @@ class OrderBoxLayoutPartialCountDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -389,12 +389,12 @@ class OrderBoxLayoutPartialCountDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -419,11 +419,11 @@ class OrderBoxLayoutPartialCountDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBoxesLayoutDTO.php b/erp24/lib/yandex_market_api/Model/OrderBoxesLayoutDTO.php index 7e780935..c1be87ee 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBoxesLayoutDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBoxesLayoutDTO.php @@ -2,7 +2,7 @@ /** * OrderBoxesLayoutDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OrderBoxesLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('boxes', $data ?? [], null); } @@ -322,11 +322,11 @@ class OrderBoxesLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class OrderBoxesLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class OrderBoxesLayoutDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBusinessBuyerDTO.php b/erp24/lib/yandex_market_api/Model/OrderBusinessBuyerDTO.php index 7edbc87e..61c4ddbd 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBusinessBuyerDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBusinessBuyerDTO.php @@ -2,7 +2,7 @@ /** * OrderBusinessBuyerDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OrderBusinessBuyerDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('inn', $data ?? [], null); $this->setIfExists('kpp', $data ?? [], null); @@ -421,11 +421,11 @@ class OrderBusinessBuyerDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ class OrderBusinessBuyerDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ class OrderBusinessBuyerDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBusinessDocumentsDTO.php b/erp24/lib/yandex_market_api/Model/OrderBusinessDocumentsDTO.php index b16e8ea6..217277b2 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBusinessDocumentsDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBusinessDocumentsDTO.php @@ -2,7 +2,7 @@ /** * OrderBusinessDocumentsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class OrderBusinessDocumentsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('upd', $data ?? [], null); $this->setIfExists('ukd', $data ?? [], null); @@ -455,11 +455,11 @@ class OrderBusinessDocumentsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +467,12 @@ class OrderBusinessDocumentsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +497,11 @@ class OrderBusinessDocumentsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBuyerBasicInfoDTO.php b/erp24/lib/yandex_market_api/Model/OrderBuyerBasicInfoDTO.php index 2c08ab36..677a7fdb 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBuyerBasicInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBuyerBasicInfoDTO.php @@ -2,7 +2,7 @@ /** * OrderBuyerBasicInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); @@ -303,6 +303,9 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } return $invalidProperties; } @@ -358,7 +361,7 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets last_name * - * @param string|null $last_name Фамилия покупателя. + * @param string|null $last_name Фамилия. * * @return self */ @@ -385,7 +388,7 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets first_name * - * @param string|null $first_name Имя покупателя. + * @param string|null $first_name Имя. * * @return self */ @@ -412,7 +415,7 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets middle_name * - * @param string|null $middle_name Отчество покупателя. + * @param string|null $middle_name Отчество. * * @return self */ @@ -429,7 +432,7 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets type * - * @return \OpenAPI\Client\Model\OrderBuyerType|null + * @return \OpenAPI\Client\Model\OrderBuyerType */ public function getType() { @@ -439,7 +442,7 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets type * - * @param \OpenAPI\Client\Model\OrderBuyerType|null $type type + * @param \OpenAPI\Client\Model\OrderBuyerType $type type * * @return self */ @@ -455,11 +458,11 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +470,12 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +500,11 @@ class OrderBuyerBasicInfoDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBuyerDTO.php b/erp24/lib/yandex_market_api/Model/OrderBuyerDTO.php index 63bb5b21..6de03028 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBuyerDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBuyerDTO.php @@ -2,7 +2,7 @@ /** * OrderBuyerDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); @@ -303,6 +303,9 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } return $invalidProperties; } @@ -358,7 +361,7 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets last_name * - * @param string|null $last_name Фамилия покупателя. + * @param string|null $last_name Фамилия. * * @return self */ @@ -385,7 +388,7 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets first_name * - * @param string|null $first_name Имя покупателя. + * @param string|null $first_name Имя. * * @return self */ @@ -412,7 +415,7 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets middle_name * - * @param string|null $middle_name Отчество покупателя. + * @param string|null $middle_name Отчество. * * @return self */ @@ -429,7 +432,7 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets type * - * @return \OpenAPI\Client\Model\OrderBuyerType|null + * @return \OpenAPI\Client\Model\OrderBuyerType */ public function getType() { @@ -439,7 +442,7 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets type * - * @param \OpenAPI\Client\Model\OrderBuyerType|null $type type + * @param \OpenAPI\Client\Model\OrderBuyerType $type type * * @return self */ @@ -455,11 +458,11 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +470,12 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +500,11 @@ class OrderBuyerDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBuyerInfoDTO.php b/erp24/lib/yandex_market_api/Model/OrderBuyerInfoDTO.php index b6e3a868..49ffe354 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBuyerInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderBuyerInfoDTO.php @@ -2,7 +2,7 @@ /** * OrderBuyerInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -63,7 +63,8 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'first_name' => 'string', 'middle_name' => 'string', 'type' => '\OpenAPI\Client\Model\OrderBuyerType', - 'phone' => 'string' + 'phone' => 'string', + 'trusted' => 'bool' ]; /** @@ -79,7 +80,8 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'first_name' => null, 'middle_name' => null, 'type' => null, - 'phone' => null + 'phone' => null, + 'trusted' => null ]; /** @@ -93,7 +95,8 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'first_name' => false, 'middle_name' => false, 'type' => false, - 'phone' => false + 'phone' => false, + 'trusted' => false ]; /** @@ -187,7 +190,8 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'first_name' => 'firstName', 'middle_name' => 'middleName', 'type' => 'type', - 'phone' => 'phone' + 'phone' => 'phone', + 'trusted' => 'trusted' ]; /** @@ -201,7 +205,8 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'first_name' => 'setFirstName', 'middle_name' => 'setMiddleName', 'type' => 'setType', - 'phone' => 'setPhone' + 'phone' => 'setPhone', + 'trusted' => 'setTrusted' ]; /** @@ -215,7 +220,8 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'first_name' => 'getFirstName', 'middle_name' => 'getMiddleName', 'type' => 'getType', - 'phone' => 'getPhone' + 'phone' => 'getPhone', + 'trusted' => 'getTrusted' ]; /** @@ -270,10 +276,10 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('last_name', $data ?? [], null); @@ -281,6 +287,7 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $this->setIfExists('middle_name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('trusted', $data ?? [], null); } /** @@ -310,6 +317,9 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } return $invalidProperties; } @@ -365,7 +375,7 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets last_name * - * @param string|null $last_name Фамилия покупателя. + * @param string|null $last_name Фамилия. * * @return self */ @@ -392,7 +402,7 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets first_name * - * @param string|null $first_name Имя покупателя. + * @param string|null $first_name Имя. * * @return self */ @@ -419,7 +429,7 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets middle_name * - * @param string|null $middle_name Отчество покупателя. + * @param string|null $middle_name Отчество. * * @return self */ @@ -436,7 +446,7 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets type * - * @return \OpenAPI\Client\Model\OrderBuyerType|null + * @return \OpenAPI\Client\Model\OrderBuyerType */ public function getType() { @@ -446,7 +456,7 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets type * - * @param \OpenAPI\Client\Model\OrderBuyerType|null $type type + * @param \OpenAPI\Client\Model\OrderBuyerType $type type * * @return self */ @@ -486,14 +496,41 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl return $this; } + + /** + * Gets trusted + * + * @return bool|null + */ + public function getTrusted() + { + return $this->container['trusted']; + } + + /** + * Sets trusted + * + * @param bool|null $trusted Проверенный покупатель. Если параметр `trusted` вернулся со значением `true`, Маркет уже проверил покупателя — не звоните ему. Обработайте заказ как обычно и передайте его курьеру или отвезите в ПВЗ. При необходимости свяжитесь с покупателем в чате. [Как это сделать](../../step-by-step/chats.md) Подробнее о звонках покупателю читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/orders/dbs/call). + * + * @return self + */ + public function setTrusted($trusted) + { + if (is_null($trusted)) { + throw new \InvalidArgumentException('non-nullable trusted cannot be null'); + } + $this->container['trusted'] = $trusted; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -501,12 +538,12 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -531,11 +568,11 @@ class OrderBuyerInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderBuyerType.php b/erp24/lib/yandex_market_api/Model/OrderBuyerType.php index ee799094..8e15f211 100644 --- a/erp24/lib/yandex_market_api/Model/OrderBuyerType.php +++ b/erp24/lib/yandex_market_api/Model/OrderBuyerType.php @@ -2,7 +2,7 @@ /** * OrderBuyerType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderCancellationReasonType.php b/erp24/lib/yandex_market_api/Model/OrderCancellationReasonType.php index 8337e674..0d45d923 100644 --- a/erp24/lib/yandex_market_api/Model/OrderCancellationReasonType.php +++ b/erp24/lib/yandex_market_api/Model/OrderCancellationReasonType.php @@ -2,7 +2,7 @@ /** * OrderCancellationReasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -43,9 +43,9 @@ class OrderCancellationReasonType /** * Possible values of this enum */ - public const DELIVERED = 'ORDER_DELIVERED'; + public const ORDER_DELIVERED = 'ORDER_DELIVERED'; - public const IN_DELIVERY = 'ORDER_IN_DELIVERY'; + public const ORDER_IN_DELIVERY = 'ORDER_IN_DELIVERY'; /** * Gets allowable values of the enum @@ -54,8 +54,8 @@ class OrderCancellationReasonType public static function getAllowableEnumValues() { return [ - self::DELIVERED, - self::IN_DELIVERY + self::ORDER_DELIVERED, + self::ORDER_IN_DELIVERY ]; } } diff --git a/erp24/lib/yandex_market_api/Model/OrderCourierDTO.php b/erp24/lib/yandex_market_api/Model/OrderCourierDTO.php index 0f15e8aa..13efb0f2 100644 --- a/erp24/lib/yandex_market_api/Model/OrderCourierDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderCourierDTO.php @@ -2,7 +2,7 @@ /** * OrderCourierDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('full_name', $data ?? [], null); $this->setIfExists('phone', $data ?? [], null); @@ -331,7 +331,7 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets full_name * - * @param string|null $full_name Полное имя курьера. + * @param string|null $full_name Полное имя. * * @return self */ @@ -358,7 +358,7 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets phone * - * @param string|null $phone Номер телефона курьера. + * @param string|null $phone Номер телефона. * * @return self */ @@ -439,7 +439,7 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets vehicle_description * - * @param string|null $vehicle_description Описание машины. Например, модель и цвет. + * @param string|null $vehicle_description Описание транспортного средства. Например, модель и цвет. * * @return self */ @@ -455,11 +455,11 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +467,12 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +497,11 @@ class OrderCourierDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDTO.php b/erp24/lib/yandex_market_api/Model/OrderDTO.php index 408e6181..6a3cd75b 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderDTO.php @@ -2,7 +2,7 @@ /** * OrderDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,6 +59,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'id' => 'int', + 'external_order_id' => 'string', 'status' => '\OpenAPI\Client\Model\OrderStatusType', 'substatus' => '\OpenAPI\Client\Model\OrderSubstatusType', 'creation_date' => 'string', @@ -92,17 +93,18 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'id' => 'int64', + 'external_order_id' => null, 'status' => null, 'substatus' => null, 'creation_date' => 'date-dd-MM-yyyy-HH-mm-ss', 'updated_at' => 'date-dd-MM-yyyy-HH-mm-ss', 'currency' => null, - 'items_total' => 'decimal', - 'delivery_total' => 'decimal', - 'buyer_items_total' => 'decimal', - 'buyer_total' => 'decimal', - 'buyer_items_total_before_discount' => 'decimal', - 'buyer_total_before_discount' => 'decimal', + 'items_total' => null, + 'delivery_total' => null, + 'buyer_items_total' => null, + 'buyer_total' => null, + 'buyer_items_total_before_discount' => null, + 'buyer_total_before_discount' => null, 'payment_type' => null, 'payment_method' => null, 'fake' => null, @@ -123,6 +125,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, + 'external_order_id' => false, 'status' => false, 'substatus' => false, 'creation_date' => false, @@ -234,6 +237,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $attributeMap = [ 'id' => 'id', + 'external_order_id' => 'externalOrderId', 'status' => 'status', 'substatus' => 'substatus', 'creation_date' => 'creationDate', @@ -265,6 +269,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $setters = [ 'id' => 'setId', + 'external_order_id' => 'setExternalOrderId', 'status' => 'setStatus', 'substatus' => 'setSubstatus', 'creation_date' => 'setCreationDate', @@ -296,6 +301,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $getters = [ 'id' => 'getId', + 'external_order_id' => 'getExternalOrderId', 'status' => 'getStatus', 'substatus' => 'getSubstatus', 'creation_date' => 'getCreationDate', @@ -372,12 +378,13 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('external_order_id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('substatus', $data ?? [], null); $this->setIfExists('creation_date', $data ?? [], null); @@ -429,9 +436,59 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (!is_null($this->container['external_order_id']) && (mb_strlen($this->container['external_order_id']) < 1)) { + $invalidProperties[] = "invalid value for 'external_order_id', the character length must be bigger than or equal to 1."; + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['substatus'] === null) { + $invalidProperties[] = "'substatus' can't be null"; + } + if ($this->container['creation_date'] === null) { + $invalidProperties[] = "'creation_date' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['delivery_total'] === null) { + $invalidProperties[] = "'delivery_total' can't be null"; + } + if ($this->container['buyer_items_total_before_discount'] === null) { + $invalidProperties[] = "'buyer_items_total_before_discount' can't be null"; + } + if ($this->container['payment_type'] === null) { + $invalidProperties[] = "'payment_type' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + if ($this->container['fake'] === null) { + $invalidProperties[] = "'fake' can't be null"; + } if ($this->container['items'] === null) { $invalidProperties[] = "'items' can't be null"; } + if (!is_null($this->container['subsidies']) && (count($this->container['subsidies']) < 1)) { + $invalidProperties[] = "invalid value for 'subsidies', number of items must be greater than or equal to 1."; + } + + if ($this->container['delivery'] === null) { + $invalidProperties[] = "'delivery' can't be null"; + } + if ($this->container['buyer'] === null) { + $invalidProperties[] = "'buyer' can't be null"; + } + if ($this->container['tax_system'] === null) { + $invalidProperties[] = "'tax_system' can't be null"; + } return $invalidProperties; } @@ -450,7 +507,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets id * - * @return int|null + * @return int */ public function getId() { @@ -460,7 +517,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id Идентификатор заказа. + * @param int $id Идентификатор заказа. * * @return self */ @@ -474,10 +531,42 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets external_order_id + * + * @return string|null + */ + public function getExternalOrderId() + { + return $this->container['external_order_id']; + } + + /** + * Sets external_order_id + * + * @param string|null $external_order_id Внешний идентификатор заказа, который вы передали в [POST v2/campaigns/{campaignId}/orders/{orderId}/external-id](../../reference/orders/updateExternalOrderId.md). + * + * @return self + */ + public function setExternalOrderId($external_order_id) + { + if (is_null($external_order_id)) { + throw new \InvalidArgumentException('non-nullable external_order_id cannot be null'); + } + + if ((mb_strlen($external_order_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_order_id when calling OrderDTO., must be bigger than or equal to 1.'); + } + + $this->container['external_order_id'] = $external_order_id; + + return $this; + } + /** * Gets status * - * @return \OpenAPI\Client\Model\OrderStatusType|null + * @return \OpenAPI\Client\Model\OrderStatusType */ public function getStatus() { @@ -487,7 +576,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets status * - * @param \OpenAPI\Client\Model\OrderStatusType|null $status status + * @param \OpenAPI\Client\Model\OrderStatusType $status status * * @return self */ @@ -504,7 +593,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets substatus * - * @return \OpenAPI\Client\Model\OrderSubstatusType|null + * @return \OpenAPI\Client\Model\OrderSubstatusType */ public function getSubstatus() { @@ -514,7 +603,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets substatus * - * @param \OpenAPI\Client\Model\OrderSubstatusType|null $substatus substatus + * @param \OpenAPI\Client\Model\OrderSubstatusType $substatus substatus * * @return self */ @@ -531,7 +620,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets creation_date * - * @return string|null + * @return string */ public function getCreationDate() { @@ -541,7 +630,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets creation_date * - * @param string|null $creation_date creation_date + * @param string $creation_date creation_date * * @return self */ @@ -585,7 +674,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets currency * - * @return \OpenAPI\Client\Model\CurrencyType|null + * @return \OpenAPI\Client\Model\CurrencyType */ public function getCurrency() { @@ -595,7 +684,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets currency * - * @param \OpenAPI\Client\Model\CurrencyType|null $currency currency + * @param \OpenAPI\Client\Model\CurrencyType $currency currency * * @return self */ @@ -612,7 +701,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets items_total * - * @return float|null + * @return float */ public function getItemsTotal() { @@ -622,7 +711,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets items_total * - * @param float|null $items_total Платеж покупателя. + * @param float $items_total Платеж покупателя. * * @return self */ @@ -639,7 +728,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets delivery_total * - * @return float|null + * @return float */ public function getDeliveryTotal() { @@ -649,7 +738,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets delivery_total * - * @param float|null $delivery_total Стоимость доставки. + * @param float $delivery_total Стоимость доставки. * * @return self */ @@ -677,7 +766,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer_items_total * - * @param float|null $buyer_items_total {% note warning \"\" %} Этот параметр устарел. {% endnote %} Стоимость всех товаров в заказе в валюте покупателя после применения скидок и без учета стоимости доставки. + * @param float|null $buyer_items_total Стоимость всех товаров в заказе в валюте покупателя после применения скидок и без учета стоимости доставки. * * @return self * @deprecated @@ -706,7 +795,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer_total * - * @param float|null $buyer_total {% note warning \"\" %} Этот параметр устарел. {% endnote %} Стоимость всех товаров в заказе в валюте покупателя после применения скидок и с учетом стоимости доставки. + * @param float|null $buyer_total Стоимость всех товаров в заказе в валюте покупателя после применения скидок и с учетом стоимости доставки. * * @return self * @deprecated @@ -724,7 +813,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets buyer_items_total_before_discount * - * @return float|null + * @return float */ public function getBuyerItemsTotalBeforeDiscount() { @@ -734,7 +823,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer_items_total_before_discount * - * @param float|null $buyer_items_total_before_discount Стоимость всех товаров в заказе в валюте покупателя без учета стоимости доставки и до применения скидок по: * акциям; * купонам; * промокодам. + * @param float $buyer_items_total_before_discount Стоимость всех товаров в заказе в валюте покупателя без учета стоимости доставки и до применения скидок по: * акциям; * купонам; * промокодам. * * @return self */ @@ -762,7 +851,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer_total_before_discount * - * @param float|null $buyer_total_before_discount {% note warning \"\" %} Этот параметр устарел. {% endnote %} Стоимость всех товаров в заказе в валюте покупателя до применения скидок и с учетом стоимости доставки (`buyerItemsTotalBeforeDiscount` + стоимость доставки). + * @param float|null $buyer_total_before_discount Стоимость всех товаров в заказе в валюте покупателя до применения скидок и с учетом стоимости доставки (`buyerItemsTotalBeforeDiscount` + стоимость доставки). * * @return self * @deprecated @@ -780,7 +869,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets payment_type * - * @return \OpenAPI\Client\Model\OrderPaymentType|null + * @return \OpenAPI\Client\Model\OrderPaymentType */ public function getPaymentType() { @@ -790,7 +879,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets payment_type * - * @param \OpenAPI\Client\Model\OrderPaymentType|null $payment_type payment_type + * @param \OpenAPI\Client\Model\OrderPaymentType $payment_type payment_type * * @return self */ @@ -807,7 +896,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets payment_method * - * @return \OpenAPI\Client\Model\OrderPaymentMethodType|null + * @return \OpenAPI\Client\Model\OrderPaymentMethodType */ public function getPaymentMethod() { @@ -817,7 +906,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets payment_method * - * @param \OpenAPI\Client\Model\OrderPaymentMethodType|null $payment_method payment_method + * @param \OpenAPI\Client\Model\OrderPaymentMethodType $payment_method payment_method * * @return self */ @@ -834,7 +923,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets fake * - * @return bool|null + * @return bool */ public function getFake() { @@ -844,7 +933,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets fake * - * @param bool|null $fake Тип заказа: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. + * @param bool $fake Тип заказа: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. * * @return self */ @@ -914,6 +1003,11 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($subsidies) && (count($subsidies) < 1)) { + throw new \InvalidArgumentException('invalid length for $subsidies when calling OrderDTO., number of items must be greater than or equal to 1.'); + } $this->container['subsidies'] = $subsidies; return $this; @@ -922,7 +1016,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets delivery * - * @return \OpenAPI\Client\Model\OrderDeliveryDTO|null + * @return \OpenAPI\Client\Model\OrderDeliveryDTO */ public function getDelivery() { @@ -932,7 +1026,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets delivery * - * @param \OpenAPI\Client\Model\OrderDeliveryDTO|null $delivery delivery + * @param \OpenAPI\Client\Model\OrderDeliveryDTO $delivery delivery * * @return self */ @@ -949,7 +1043,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets buyer * - * @return \OpenAPI\Client\Model\OrderBuyerDTO|null + * @return \OpenAPI\Client\Model\OrderBuyerDTO */ public function getBuyer() { @@ -959,7 +1053,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer * - * @param \OpenAPI\Client\Model\OrderBuyerDTO|null $buyer buyer + * @param \OpenAPI\Client\Model\OrderBuyerDTO $buyer buyer * * @return self */ @@ -1003,7 +1097,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets tax_system * - * @return \OpenAPI\Client\Model\OrderTaxSystemType|null + * @return \OpenAPI\Client\Model\OrderTaxSystemType */ public function getTaxSystem() { @@ -1013,7 +1107,7 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets tax_system * - * @param \OpenAPI\Client\Model\OrderTaxSystemType|null $tax_system tax_system + * @param \OpenAPI\Client\Model\OrderTaxSystemType $tax_system tax_system * * @return self */ @@ -1083,11 +1177,11 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1095,12 +1189,12 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1125,11 +1219,11 @@ class OrderDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDatesFilterDTO.php b/erp24/lib/yandex_market_api/Model/OrderDatesFilterDTO.php new file mode 100644 index 00000000..b8fd500a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OrderDatesFilterDTO.php @@ -0,0 +1,580 @@ + + */ +class OrderDatesFilterDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrderDatesFilterDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'creation_date_from' => '\DateTime', + 'creation_date_to' => '\DateTime', + 'shipment_date_from' => '\DateTime', + 'shipment_date_to' => '\DateTime', + 'update_date_from' => '\DateTime', + 'update_date_to' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'creation_date_from' => 'date', + 'creation_date_to' => 'date', + 'shipment_date_from' => 'date', + 'shipment_date_to' => 'date', + 'update_date_from' => 'date-time', + 'update_date_to' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'creation_date_from' => false, + 'creation_date_to' => false, + 'shipment_date_from' => false, + 'shipment_date_to' => false, + 'update_date_from' => false, + 'update_date_to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'creation_date_from' => 'creationDateFrom', + 'creation_date_to' => 'creationDateTo', + 'shipment_date_from' => 'shipmentDateFrom', + 'shipment_date_to' => 'shipmentDateTo', + 'update_date_from' => 'updateDateFrom', + 'update_date_to' => 'updateDateTo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'creation_date_from' => 'setCreationDateFrom', + 'creation_date_to' => 'setCreationDateTo', + 'shipment_date_from' => 'setShipmentDateFrom', + 'shipment_date_to' => 'setShipmentDateTo', + 'update_date_from' => 'setUpdateDateFrom', + 'update_date_to' => 'setUpdateDateTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'creation_date_from' => 'getCreationDateFrom', + 'creation_date_to' => 'getCreationDateTo', + 'shipment_date_from' => 'getShipmentDateFrom', + 'shipment_date_to' => 'getShipmentDateTo', + 'update_date_from' => 'getUpdateDateFrom', + 'update_date_to' => 'getUpdateDateTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('creation_date_from', $data ?? [], null); + $this->setIfExists('creation_date_to', $data ?? [], null); + $this->setIfExists('shipment_date_from', $data ?? [], null); + $this->setIfExists('shipment_date_to', $data ?? [], null); + $this->setIfExists('update_date_from', $data ?? [], null); + $this->setIfExists('update_date_to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets creation_date_from + * + * @return \DateTime|null + */ + public function getCreationDateFrom() + { + return $this->container['creation_date_from']; + } + + /** + * Sets creation_date_from + * + * @param \DateTime|null $creation_date_from Начальная дата оформления заказа (ГГГГ-ММ-ДД). + * + * @return self + */ + public function setCreationDateFrom($creation_date_from) + { + if (is_null($creation_date_from)) { + throw new \InvalidArgumentException('non-nullable creation_date_from cannot be null'); + } + $this->container['creation_date_from'] = $creation_date_from; + + return $this; + } + + /** + * Gets creation_date_to + * + * @return \DateTime|null + */ + public function getCreationDateTo() + { + return $this->container['creation_date_to']; + } + + /** + * Sets creation_date_to + * + * @param \DateTime|null $creation_date_to Конечная дата оформления заказа (ГГГГ-ММ-ДД). + * + * @return self + */ + public function setCreationDateTo($creation_date_to) + { + if (is_null($creation_date_to)) { + throw new \InvalidArgumentException('non-nullable creation_date_to cannot be null'); + } + $this->container['creation_date_to'] = $creation_date_to; + + return $this; + } + + /** + * Gets shipment_date_from + * + * @return \DateTime|null + */ + public function getShipmentDateFrom() + { + return $this->container['shipment_date_from']; + } + + /** + * Sets shipment_date_from + * + * @param \DateTime|null $shipment_date_from Начальная дата отгрузки (ГГГГ-ММ-ДД). + * + * @return self + */ + public function setShipmentDateFrom($shipment_date_from) + { + if (is_null($shipment_date_from)) { + throw new \InvalidArgumentException('non-nullable shipment_date_from cannot be null'); + } + $this->container['shipment_date_from'] = $shipment_date_from; + + return $this; + } + + /** + * Gets shipment_date_to + * + * @return \DateTime|null + */ + public function getShipmentDateTo() + { + return $this->container['shipment_date_to']; + } + + /** + * Sets shipment_date_to + * + * @param \DateTime|null $shipment_date_to Конечная дата отгрузки (ГГГГ-ММ-ДД). + * + * @return self + */ + public function setShipmentDateTo($shipment_date_to) + { + if (is_null($shipment_date_to)) { + throw new \InvalidArgumentException('non-nullable shipment_date_to cannot be null'); + } + $this->container['shipment_date_to'] = $shipment_date_to; + + return $this; + } + + /** + * Gets update_date_from + * + * @return \DateTime|null + */ + public function getUpdateDateFrom() + { + return $this->container['update_date_from']; + } + + /** + * Sets update_date_from + * + * @param \DateTime|null $update_date_from Начальная дата обновления заказа (ISO 8601). + * + * @return self + */ + public function setUpdateDateFrom($update_date_from) + { + if (is_null($update_date_from)) { + throw new \InvalidArgumentException('non-nullable update_date_from cannot be null'); + } + $this->container['update_date_from'] = $update_date_from; + + return $this; + } + + /** + * Gets update_date_to + * + * @return \DateTime|null + */ + public function getUpdateDateTo() + { + return $this->container['update_date_to']; + } + + /** + * Sets update_date_to + * + * @param \DateTime|null $update_date_to Конечная дата обновления заказа (ISO 8601). + * + * @return self + */ + public function setUpdateDateTo($update_date_to) + { + if (is_null($update_date_to)) { + throw new \InvalidArgumentException('non-nullable update_date_to cannot be null'); + } + $this->container['update_date_to'] = $update_date_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryAddressDTO.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryAddressDTO.php index 32f55f87..1de587fd 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryAddressDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryAddressDTO.php @@ -2,7 +2,7 @@ /** * OrderDeliveryAddressDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderDeliveryAddressDTO Class Doc Comment * * @category Class - * @description Адрес доставки. Указывается, если `type=DELIVERY`, `type=POST` или `type=PICKUP` (адрес пункта выдачи). + * @description Адрес доставки. Указывается, если параметр `type` принимает значение `DELIVERY`, `POST` или `PICKUP` (только для модели DBS). Если `type=PICKUP`, возвращается адрес пункта выдачи. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -65,7 +65,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria 'subway' => 'string', 'street' => 'string', 'house' => 'string', + 'estate' => 'string', 'block' => 'string', + 'building' => 'string', 'entrance' => 'string', 'entryphone' => 'string', 'floor' => 'string', @@ -90,7 +92,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria 'subway' => null, 'street' => null, 'house' => null, + 'estate' => null, 'block' => null, + 'building' => null, 'entrance' => null, 'entryphone' => null, 'floor' => null, @@ -113,7 +117,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria 'subway' => false, 'street' => false, 'house' => false, + 'estate' => false, 'block' => false, + 'building' => false, 'entrance' => false, 'entryphone' => false, 'floor' => false, @@ -216,7 +222,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria 'subway' => 'subway', 'street' => 'street', 'house' => 'house', + 'estate' => 'estate', 'block' => 'block', + 'building' => 'building', 'entrance' => 'entrance', 'entryphone' => 'entryphone', 'floor' => 'floor', @@ -239,7 +247,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria 'subway' => 'setSubway', 'street' => 'setStreet', 'house' => 'setHouse', + 'estate' => 'setEstate', 'block' => 'setBlock', + 'building' => 'setBuilding', 'entrance' => 'setEntrance', 'entryphone' => 'setEntryphone', 'floor' => 'setFloor', @@ -262,7 +272,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria 'subway' => 'getSubway', 'street' => 'getStreet', 'house' => 'getHouse', + 'estate' => 'getEstate', 'block' => 'getBlock', + 'building' => 'getBuilding', 'entrance' => 'getEntrance', 'entryphone' => 'getEntryphone', 'floor' => 'getFloor', @@ -324,10 +336,10 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('country', $data ?? [], null); $this->setIfExists('postcode', $data ?? [], null); @@ -336,7 +348,9 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria $this->setIfExists('subway', $data ?? [], null); $this->setIfExists('street', $data ?? [], null); $this->setIfExists('house', $data ?? [], null); + $this->setIfExists('estate', $data ?? [], null); $this->setIfExists('block', $data ?? [], null); + $this->setIfExists('building', $data ?? [], null); $this->setIfExists('entrance', $data ?? [], null); $this->setIfExists('entryphone', $data ?? [], null); $this->setIfExists('floor', $data ?? [], null); @@ -401,7 +415,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets country * - * @param string|null $country Страна. Обязательный параметр. + * @param string|null $country Страна. * * @return self */ @@ -455,7 +469,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets city * - * @param string|null $city Город или населенный пункт. Обязательный параметр. + * @param string|null $city Город или населенный пункт. * * @return self */ @@ -536,7 +550,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets street * - * @param string|null $street Улица. Обязательный параметр. + * @param string|null $street Улица. * * @return self */ @@ -563,7 +577,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets house * - * @param string|null $house Дом или владение. Обязательный параметр. + * @param string|null $house Номер дома. * * @return self */ @@ -577,6 +591,33 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria return $this; } + /** + * Gets estate + * + * @return string|null + */ + public function getEstate() + { + return $this->container['estate']; + } + + /** + * Sets estate + * + * @param string|null $estate Номер владения. + * + * @return self + */ + public function setEstate($estate) + { + if (is_null($estate)) { + throw new \InvalidArgumentException('non-nullable estate cannot be null'); + } + $this->container['estate'] = $estate; + + return $this; + } + /** * Gets block * @@ -590,7 +631,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets block * - * @param string|null $block Корпус или строение. + * @param string|null $block Корпус. * * @return self */ @@ -604,6 +645,33 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria return $this; } + /** + * Gets building + * + * @return string|null + */ + public function getBuilding() + { + return $this->container['building']; + } + + /** + * Sets building + * + * @param string|null $building Строение. + * + * @return self + */ + public function setBuilding($building) + { + if (is_null($building)) { + throw new \InvalidArgumentException('non-nullable building cannot be null'); + } + $this->container['building'] = $building; + + return $this; + } + /** * Gets entrance * @@ -617,7 +685,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets entrance * - * @param string|null $entrance Подъезд. + * @param string|null $entrance Номер подъезда. * * @return self */ @@ -698,7 +766,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets apartment * - * @param string|null $apartment Квартира или офис. + * @param string|null $apartment Номер квартиры или офиса. * * @return self */ @@ -725,7 +793,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets phone * - * @param string|null $phone Телефон получателя заказа. Обязательный параметр. + * @param string|null $phone Телефон получателя заказа. * * @return self */ @@ -752,7 +820,7 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets recipient * - * @param string|null $recipient Фамилия, имя и отчество получателя заказа. Обязательный параметр. + * @param string|null $recipient Фамилия, имя и отчество получателя заказа. * * @return self */ @@ -795,11 +863,11 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -807,12 +875,12 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -837,11 +905,11 @@ class OrderDeliveryAddressDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryDTO.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryDTO.php index 0c961cc7..fa4b0905 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryDTO.php @@ -2,7 +2,7 @@ /** * OrderDeliveryDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -92,7 +92,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => null, 'type' => null, 'service_name' => null, - 'price' => 'decimal', + 'price' => null, 'delivery_partner_type' => null, 'courier' => null, 'dates' => null, @@ -101,7 +101,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'vat' => null, 'delivery_service_id' => 'int64', 'lift_type' => null, - 'lift_price' => 'decimal', + 'lift_price' => null, 'outlet_code' => null, 'outlet_storage_limit_date' => 'date-dd-MM-yyyy', 'dispatch_type' => null, @@ -360,10 +360,10 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -415,6 +415,29 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['service_name'] === null) { + $invalidProperties[] = "'service_name' can't be null"; + } + if ($this->container['delivery_partner_type'] === null) { + $invalidProperties[] = "'delivery_partner_type' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + if ($this->container['delivery_service_id'] === null) { + $invalidProperties[] = "'delivery_service_id' can't be null"; + } + if (!is_null($this->container['tracks']) && (count($this->container['tracks']) < 1)) { + $invalidProperties[] = "invalid value for 'tracks', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['shipments']) && (count($this->container['shipments']) < 1)) { + $invalidProperties[] = "invalid value for 'shipments', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -434,6 +457,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets id * * @return string|null + * @deprecated */ public function getId() { @@ -443,9 +467,10 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param string|null $id Идентификатор доставки, присвоенный магазином. Указывается, только если магазин передал данный идентификатор в ответе на запрос методом [POST cart](../../pushapi/reference/cart.md). + * @param string|null $id Идентификатор доставки, присвоенный магазином. Указывается, только если магазин передал данный идентификатор в ответе на запрос методом `POST cart`. * * @return self + * @deprecated */ public function setId($id) { @@ -460,7 +485,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets type * - * @return \OpenAPI\Client\Model\OrderDeliveryType|null + * @return \OpenAPI\Client\Model\OrderDeliveryType */ public function getType() { @@ -470,7 +495,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets type * - * @param \OpenAPI\Client\Model\OrderDeliveryType|null $type type + * @param \OpenAPI\Client\Model\OrderDeliveryType $type type * * @return self */ @@ -487,7 +512,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets service_name * - * @return string|null + * @return string */ public function getServiceName() { @@ -497,7 +522,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets service_name * - * @param string|null $service_name Наименование службы доставки. + * @param string $service_name Название службы доставки. * * @return self */ @@ -525,7 +550,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets price * - * @param float|null $price {% note warning \"\" %} Этот параметр устарел. Стоимость доставки смотрите в параметре `deliveryTotal`. {% endnote %} Стоимость доставки в валюте заказа. + * @param float|null $price {% note warning \"Стоимость доставки смотрите в параметре `deliveryTotal`.\" %}   {% endnote %} Стоимость доставки в валюте заказа. * * @return self * @deprecated @@ -543,7 +568,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets delivery_partner_type * - * @return \OpenAPI\Client\Model\OrderDeliveryPartnerType|null + * @return \OpenAPI\Client\Model\OrderDeliveryPartnerType */ public function getDeliveryPartnerType() { @@ -553,7 +578,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets delivery_partner_type * - * @param \OpenAPI\Client\Model\OrderDeliveryPartnerType|null $delivery_partner_type delivery_partner_type + * @param \OpenAPI\Client\Model\OrderDeliveryPartnerType $delivery_partner_type delivery_partner_type * * @return self */ @@ -597,7 +622,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets dates * - * @return \OpenAPI\Client\Model\OrderDeliveryDatesDTO|null + * @return \OpenAPI\Client\Model\OrderDeliveryDatesDTO */ public function getDates() { @@ -607,7 +632,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets dates * - * @param \OpenAPI\Client\Model\OrderDeliveryDatesDTO|null $dates dates + * @param \OpenAPI\Client\Model\OrderDeliveryDatesDTO $dates dates * * @return self */ @@ -705,7 +730,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets delivery_service_id * - * @return int|null + * @return int */ public function getDeliveryServiceId() { @@ -715,7 +740,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets delivery_service_id * - * @param int|null $delivery_service_id Идентификатор службы доставки. + * @param int $delivery_service_id Идентификатор службы доставки. * * @return self */ @@ -796,7 +821,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets outlet_code * - * @param string|null $outlet_code Идентификатор пункта самовывоза, присвоенный магазином. + * @param string|null $outlet_code Идентификатор пункта выдачи, присвоенный магазином. * * @return self */ @@ -877,7 +902,7 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets tracks * - * @param \OpenAPI\Client\Model\OrderTrackDTO[]|null $tracks Информация для отслеживания перемещений посылки. + * @param \OpenAPI\Client\Model\OrderTrackDTO[]|null $tracks Информация для отслеживания посылки. * * @return self */ @@ -893,6 +918,11 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($tracks) && (count($tracks) < 1)) { + throw new \InvalidArgumentException('invalid length for $tracks when calling OrderDeliveryDTO., number of items must be greater than or equal to 1.'); + } $this->container['tracks'] = $tracks; return $this; @@ -927,6 +957,11 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($shipments) && (count($shipments) < 1)) { + throw new \InvalidArgumentException('invalid length for $shipments when calling OrderDeliveryDTO., number of items must be greater than or equal to 1.'); + } $this->container['shipments'] = $shipments; return $this; @@ -1015,11 +1050,11 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1027,12 +1062,12 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1057,11 +1092,11 @@ class OrderDeliveryDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryDateDTO.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryDateDTO.php index 7a0d479e..d475bb7b 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryDateDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryDateDTO.php @@ -2,7 +2,7 @@ /** * OrderDeliveryDateDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OrderDeliveryDateDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('to_date', $data ?? [], null); } @@ -322,11 +322,11 @@ class OrderDeliveryDateDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class OrderDeliveryDateDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class OrderDeliveryDateDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryDateReasonType.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryDateReasonType.php index 052eedc7..ecebe949 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryDateReasonType.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryDateReasonType.php @@ -2,7 +2,7 @@ /** * OrderDeliveryDateReasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryDatesDTO.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryDatesDTO.php index 096bc90d..ccbf88a7 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryDatesDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryDatesDTO.php @@ -2,7 +2,7 @@ /** * OrderDeliveryDatesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('from_date', $data ?? [], null); $this->setIfExists('to_date', $data ?? [], null); @@ -303,6 +303,9 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['from_date'] === null) { + $invalidProperties[] = "'from_date' can't be null"; + } return $invalidProperties; } @@ -321,7 +324,7 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets from_date * - * @return string|null + * @return string */ public function getFromDate() { @@ -331,7 +334,7 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets from_date * - * @param string|null $from_date Формат даты: `ДД-ММ-ГГГГ`. + * @param string $from_date Формат даты: `ДД-ММ-ГГГГ`. * * @return self */ @@ -385,7 +388,7 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets from_time * - * @param string|null $from_time Начало интервала времени доставки. Передается только совместно с параметром `type=DELIVERY`. Формат времени: 24-часовой, `ЧЧ:ММ`. В качестве минут всегда должно быть указано `00` (исключение — `23:59`). Минимальное значение: `00:00`. + * @param string|null $from_time Начало интервала времени доставки. Передается только вместе с параметром `type=DELIVERY`. Формат времени: 24-часовой, `ЧЧ:ММ`. Вместо `ММ` всегда указывайте `00` (исключение — `23:59`). Минимальное значение: `00:00`. * * @return self */ @@ -412,7 +415,7 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets to_time * - * @param string|null $to_time Конец интервала времени доставки. Передается только совместно с параметром `type=DELIVERY`. Формат времени: 24-часовой, `ЧЧ:ММ`. В качестве минут всегда должно быть указано `00` (исключение — `23:59`). Максимальное значение: `23:59`. + * @param string|null $to_time Конец интервала времени доставки. Передается только вместе с параметром `type=DELIVERY`. Формат времени: 24-часовой, `ЧЧ:ММ`. Вместо `ММ` всегда указывайте `00` (исключение — `23:59`). Максимальное значение: `23:59`. * * @return self */ @@ -455,11 +458,11 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +470,12 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +500,11 @@ class OrderDeliveryDatesDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryDispatchType.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryDispatchType.php index 48526d79..39acf697 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryDispatchType.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryDispatchType.php @@ -2,7 +2,7 @@ /** * OrderDeliveryDispatchType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderDeliveryDispatchType Class Doc Comment * * @category Class - * @description Способ отгрузки: * `BUYER` — доставка покупателю. * `MARKET_BRANDED_OUTLET` — доставка в пункт выдачи заказов Маркета. * `SHOP_OUTLET` — доставка в пункт выдачи заказов магазина. * `UNKNOWN` — неизвестный тип. + * @description Способ доставки: * `BUYER` — курьерская доставка покупателю. * `MARKET_BRANDED_OUTLET` — доставка в пункт выдачи заказов Маркета. * `SHOP_OUTLET` — доставка в пункт выдачи заказов магазина. * `UNKNOWN` — неизвестный тип. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryEacType.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryEacType.php index 855058dd..e6b553ef 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryEacType.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryEacType.php @@ -2,7 +2,7 @@ /** * OrderDeliveryEacType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderDeliveryEacType Class Doc Comment * * @category Class - * @description Тип кода подтверждения ЭАПП: * `MERCHANT_TO_COURIER` — продавец передает код курьеру. * `COURIER_TO_MERCHANT` — курьер передает код продавцу. * `CHECKING_BY_MERCHANT` — продавец проверяет код на своей стороне. + * @description Тип кода подтверждения ЭАПП: * `MERCHANT_TO_COURIER` (временно не возвращается) — продавец передает код курьеру для получения невыкупа. * `COURIER_TO_MERCHANT` — курьер передает код продавцу для получения заказа. * `CHECKING_BY_MERCHANT` — продавец проверяет код на своей стороне. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryPartnerType.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryPartnerType.php index 099f86ad..269106aa 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryPartnerType.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryPartnerType.php @@ -2,7 +2,7 @@ /** * OrderDeliveryPartnerType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderDeliveryType.php b/erp24/lib/yandex_market_api/Model/OrderDeliveryType.php index db438854..7939e165 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDeliveryType.php +++ b/erp24/lib/yandex_market_api/Model/OrderDeliveryType.php @@ -2,7 +2,7 @@ /** * OrderDeliveryType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderDigitalItemDTO.php b/erp24/lib/yandex_market_api/Model/OrderDigitalItemDTO.php index 4b09dbe0..ec789102 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDigitalItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderDigitalItemDTO.php @@ -2,7 +2,7 @@ /** * OrderDigitalItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderDigitalItemDTO Class Doc Comment * * @category Class - * @description Ключ цифрового товара. + * @description Цифровой товар. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -59,7 +59,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'id' => 'int', - 'code' => 'string', + 'codes' => 'string[]', 'slip' => 'string', 'activate_till' => '\DateTime' ]; @@ -73,7 +73,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'id' => 'int64', - 'code' => null, + 'codes' => null, 'slip' => null, 'activate_till' => 'date' ]; @@ -85,7 +85,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static array $openAPINullables = [ 'id' => false, - 'code' => false, + 'codes' => true, 'slip' => false, 'activate_till' => false ]; @@ -177,7 +177,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $attributeMap = [ 'id' => 'id', - 'code' => 'code', + 'codes' => 'codes', 'slip' => 'slip', 'activate_till' => 'activate_till' ]; @@ -189,7 +189,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $setters = [ 'id' => 'setId', - 'code' => 'setCode', + 'codes' => 'setCodes', 'slip' => 'setSlip', 'activate_till' => 'setActivateTill' ]; @@ -201,7 +201,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $getters = [ 'id' => 'getId', - 'code' => 'getCode', + 'codes' => 'getCodes', 'slip' => 'getSlip', 'activate_till' => 'getActivateTill' ]; @@ -258,13 +258,13 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('codes', $data ?? [], null); $this->setIfExists('slip', $data ?? [], null); $this->setIfExists('activate_till', $data ?? [], null); } @@ -299,12 +299,21 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; + if (!is_null($this->container['codes']) && (count($this->container['codes']) > 5000)) { + $invalidProperties[] = "invalid value for 'codes', number of items must be less than or equal to 5000."; } + + if (!is_null($this->container['codes']) && (count($this->container['codes']) < 1)) { + $invalidProperties[] = "invalid value for 'codes', number of items must be greater than or equal to 1."; + } + if ($this->container['slip'] === null) { $invalidProperties[] = "'slip' can't be null"; } + if ((mb_strlen($this->container['slip']) > 10000)) { + $invalidProperties[] = "invalid value for 'slip', the character length must be smaller than or equal to 10000."; + } + if ($this->container['activate_till'] === null) { $invalidProperties[] = "'activate_till' can't be null"; } @@ -336,7 +345,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets id * - * @param int $id Идентификатор товара в заказе. Он приходит в ответе на запрос [GET campaigns/{campaignId}/orders/{orderId}](../../reference/orders/getOrder.md) и в запросе Маркета [POST order/accept](../../pushapi/reference/orderAccept.md) — параметр `id` в `items`. + * @param int $id Идентификатор товара в заказе. Он приходит в ответе метода [POST v1/businesses/{businessId}/orders](../../reference/orders/getBusinessOrders.md) — параметр `id` в `items`. * * @return self */ @@ -351,28 +360,42 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa } /** - * Gets code + * Gets codes * - * @return string + * @return string[]|null */ - public function getCode() + public function getCodes() { - return $this->container['code']; + return $this->container['codes']; } /** - * Sets code + * Sets codes * - * @param string $code Сам ключ. + * @param string[]|null $codes Ключи, относящиеся к товару. Поле обязательно для заполнения. * * @return self */ - public function setCode($code) + public function setCodes($codes) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($codes)) { + array_push($this->openAPINullablesSetToNull, 'codes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('codes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($codes) && (count($codes) > 5000)) { + throw new \InvalidArgumentException('invalid value for $codes when calling OrderDigitalItemDTO., number of items must be less than or equal to 5000.'); } - $this->container['code'] = $code; + if (!is_null($codes) && (count($codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $codes when calling OrderDigitalItemDTO., number of items must be greater than or equal to 1.'); + } + $this->container['codes'] = $codes; return $this; } @@ -390,7 +413,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets slip * - * @param string $slip Инструкция по активации. + * @param string $slip Инструкция по активации. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                                                          , \\

                                                                                          и так далее — для заголовков; * \\
                                                                                          и \\

                                                                                          — для переноса строки; * \\

                                                                                            — для нумерованного списка; * \\
                                                                                              — для маркированного списка; * \\
                                                                                            • — для создания элементов списка (должен находиться внутри \\
                                                                                                или \\
                                                                                                  ); * \\
                                                                                                  — поддерживается, но не влияет на отображение текста. * * @return self */ @@ -399,6 +422,10 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa if (is_null($slip)) { throw new \InvalidArgumentException('non-nullable slip cannot be null'); } + if ((mb_strlen($slip) > 10000)) { + throw new \InvalidArgumentException('invalid length for $slip when calling OrderDigitalItemDTO., must be smaller than or equal to 10000.'); + } + $this->container['slip'] = $slip; return $this; @@ -417,7 +444,7 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets activate_till * - * @param \DateTime $activate_till Дата, до которой нужно активировать ключ. Если ключ действует бессрочно, укажите любую дату в отдаленном будущем. Формат даты: `ГГГГ-ММ-ДД`. + * @param \DateTime $activate_till Дата, до которой нужно активировать ключи. Если ключи действуют бессрочно, укажите любую дату в отдаленном будущем. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -433,11 +460,11 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +472,12 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +502,11 @@ class OrderDigitalItemDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderDocumentStatusType.php b/erp24/lib/yandex_market_api/Model/OrderDocumentStatusType.php index 1de10968..dbf49832 100644 --- a/erp24/lib/yandex_market_api/Model/OrderDocumentStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrderDocumentStatusType.php @@ -2,7 +2,7 @@ /** * OrderDocumentStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderItemDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemDTO.php index 9f70398b..5a3b84cc 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemDTO.php @@ -2,7 +2,7 @@ /** * OrderItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -89,14 +89,14 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'int64', 'offer_id' => null, 'offer_name' => null, - 'price' => 'decimal', - 'buyer_price' => 'decimal', - 'buyer_price_before_discount' => 'decimal', - 'price_before_discount' => 'decimal', + 'price' => null, + 'buyer_price' => null, + 'buyer_price_before_discount' => null, + 'price_before_discount' => null, 'count' => null, 'vat' => null, 'shop_sku' => null, - 'subsidy' => 'decimal', + 'subsidy' => null, 'partner_warehouse_id' => null, 'promos' => null, 'instances' => null, @@ -342,10 +342,10 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('offer_id', $data ?? [], null); @@ -394,18 +394,39 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; - if (!is_null($this->container['offer_id']) && (mb_strlen($this->container['offer_id']) > 255)) { + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; } - if (!is_null($this->container['offer_id']) && (mb_strlen($this->container['offer_id']) < 1)) { + if ((mb_strlen($this->container['offer_id']) < 1)) { $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } + if ($this->container['offer_name'] === null) { + $invalidProperties[] = "'offer_name' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['buyer_price'] === null) { + $invalidProperties[] = "'buyer_price' can't be null"; + } + if ($this->container['buyer_price_before_discount'] === null) { + $invalidProperties[] = "'buyer_price_before_discount' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } if (!is_null($this->container['shop_sku']) && (mb_strlen($this->container['shop_sku']) > 255)) { $invalidProperties[] = "invalid value for 'shop_sku', the character length must be smaller than or equal to 255."; } @@ -414,8 +435,32 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['promos']) && (count($this->container['promos']) < 1)) { + $invalidProperties[] = "invalid value for 'promos', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['details']) && (count($this->container['details']) < 1)) { + $invalidProperties[] = "invalid value for 'details', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['subsidies']) && (count($this->container['subsidies']) < 1)) { + $invalidProperties[] = "invalid value for 'subsidies', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['required_instance_types']) && (count($this->container['required_instance_types']) < 1)) { + $invalidProperties[] = "invalid value for 'required_instance_types', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -436,7 +481,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets id * - * @return int|null + * @return int */ public function getId() { @@ -446,7 +491,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id Идентификатор товара в заказе. Позволяет идентифицировать товар в рамках данного заказа. + * @param int $id Идентификатор товара в заказе. Позволяет идентифицировать товар в рамках заказа. * * @return self */ @@ -463,7 +508,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offer_id * - * @return string|null + * @return string */ public function getOfferId() { @@ -473,7 +518,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -488,8 +533,8 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling OrderItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling OrderItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling OrderItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -500,7 +545,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offer_name * - * @return string|null + * @return string */ public function getOfferName() { @@ -510,7 +555,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_name * - * @param string|null $offer_name Название товара. + * @param string $offer_name Название товара. * * @return self */ @@ -527,7 +572,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets price * - * @return float|null + * @return float */ public function getPrice() { @@ -537,7 +582,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets price * - * @param float|null $price Цена на товар в валюте заказа без учета вознаграждения партнеру за скидки по промокодам, купонам и акциям (параметр `subsidies`). + * @param float $price Цена товара в валюте заказа без учета вознаграждения продавцу за скидки по промокодам, купонам и акциям (параметр `subsidies`). Включает НДС. * * @return self */ @@ -554,7 +599,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets buyer_price * - * @return float|null + * @return float */ public function getBuyerPrice() { @@ -564,7 +609,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer_price * - * @param float|null $buyer_price Цена на товар в валюте покупателя. В цене уже учтены скидки по: * акциям; * купонам; * промокодам. + * @param float $buyer_price Цена товара в валюте покупателя. В цене уже учтены скидки по: * акциям; * купонам; * промокодам. * * @return self */ @@ -581,7 +626,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets buyer_price_before_discount * - * @return float|null + * @return float */ public function getBuyerPriceBeforeDiscount() { @@ -591,7 +636,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets buyer_price_before_discount * - * @param float|null $buyer_price_before_discount Стоимость товара в валюте покупателя до применения скидок по: * акциям; * купонам; * промокодам. + * @param float $buyer_price_before_discount Стоимость товара в валюте покупателя до применения скидок по: * акциям; * купонам; * промокодам. Это зачеркнутая цена, которая отображается покупателю на карточке товара до применения скидок. * * @return self */ @@ -619,7 +664,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets price_before_discount * - * @param float|null $price_before_discount {% note warning \"\" %} Этот параметр устарел. {% endnote %} Стоимость товара в валюте магазина до применения скидок. + * @param float|null $price_before_discount Стоимость товара в валюте магазина до применения скидок. * * @return self * @deprecated @@ -637,7 +682,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets count * - * @return int|null + * @return int */ public function getCount() { @@ -647,7 +692,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets count * - * @param int|null $count Количество единиц товара. + * @param int $count Количество единиц товара. * * @return self */ @@ -701,7 +746,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -716,8 +761,8 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling OrderItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling OrderItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling OrderItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -739,7 +784,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets subsidy * - * @param float|null $subsidy {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `subsidies`. {% endnote %} Общее вознаграждение партнеру за DBS-доставку и все скидки на товар: * по промокодам; * по купонам; * по баллам Плюса; * по акциям. Передается в валюте заказа. + * @param float|null $subsidy {% note warning \"Вместо него используйте `subsidies`.\" %}   {% endnote %} Общее вознаграждение продавцу за DBS-доставку и все скидки на товар: * по промокодам; * по купонам; * по баллам Плюса; * по акциям. * * @return self * @deprecated @@ -758,7 +803,6 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets partner_warehouse_id * * @return string|null - * @deprecated */ public function getPartnerWarehouseId() { @@ -768,10 +812,9 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets partner_warehouse_id * - * @param string|null $partner_warehouse_id {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Идентификатор склада в системе партнера, на который сформирован заказ. + * @param string|null $partner_warehouse_id **Только для модели FBY** Идентификатор склада, на который сформирован заказ. * * @return self - * @deprecated */ public function setPartnerWarehouseId($partner_warehouse_id) { @@ -796,7 +839,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets promos * - * @param \OpenAPI\Client\Model\OrderItemPromoDTO[]|null $promos Информация о вознаграждениях партнеру за скидки на товар по промокодам, купонам и акциям. + * @param \OpenAPI\Client\Model\OrderItemPromoDTO[]|null $promos Информация о вознаграждении продавцу за скидки на товар по промокодам, купонам и акциям. * * @return self */ @@ -812,6 +855,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($promos) && (count($promos) < 1)) { + throw new \InvalidArgumentException('invalid length for $promos when calling OrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['promos'] = $promos; return $this; @@ -830,7 +878,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets instances * - * @param \OpenAPI\Client\Model\OrderItemInstanceDTO[]|null $instances Информация о маркировке единиц товара. Возвращаются данные для маркировки, переданные в запросе [PUT campaigns/{campaignId}/orders/{orderId}/cis](../../reference/orders/provideOrderItemCis.md). Если магазин еще не передавал коды для этого заказа, `instances` отсутствует. + * @param \OpenAPI\Client\Model\OrderItemInstanceDTO[]|null $instances Информация о маркировке единиц товара. Возвращаются данные для маркировки, переданные в запросе: * Для DBS — [PUT v2/campaigns/{campaignId}/orders/{orderId}/identifiers](../../reference/orders/provideOrderItemIdentifiers.md) или [PUT v2/campaigns/{campaignId}/orders/{orderId}/boxes](../../reference/orders/setOrderBoxLayout.md). * Для FBS и EXPRESS — [PUT v2/campaigns/{campaignId}/orders/{orderId}/boxes](../../reference/orders/setOrderBoxLayout.md). Для FBY возвращаются коды маркировки, переданные во время поставки. Если магазин еще не передавал коды для этого заказа, `instances` отсутствует. * * @return self */ @@ -846,6 +894,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling OrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['instances'] = $instances; return $this; @@ -855,6 +908,7 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets details * * @return \OpenAPI\Client\Model\OrderItemDetailDTO[]|null + * @deprecated */ public function getDetails() { @@ -864,9 +918,10 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets details * - * @param \OpenAPI\Client\Model\OrderItemDetailDTO[]|null $details Информация об удалении товара из заказа. + * @param \OpenAPI\Client\Model\OrderItemDetailDTO[]|null $details {% note warning \"Для получения информации о невыкупах и возвратах используйте [GET v2/campaigns/{campaignId}/returns](../../reference/orders/getReturns.md).\" %}   {% endnote %} Информация о невыкупленных или возвращенных товарах в заказе. * * @return self + * @deprecated */ public function setDetails($details) { @@ -880,6 +935,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($details) && (count($details) < 1)) { + throw new \InvalidArgumentException('invalid length for $details when calling OrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['details'] = $details; return $this; @@ -914,6 +974,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($subsidies) && (count($subsidies) < 1)) { + throw new \InvalidArgumentException('invalid length for $subsidies when calling OrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['subsidies'] = $subsidies; return $this; @@ -948,6 +1013,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($required_instance_types) && (count($required_instance_types) < 1)) { + throw new \InvalidArgumentException('invalid length for $required_instance_types when calling OrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['required_instance_types'] = $required_instance_types; return $this; @@ -982,6 +1052,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling OrderItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['tags'] = $tags; return $this; @@ -989,11 +1064,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1001,12 +1076,12 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1031,11 +1106,11 @@ class OrderItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemDetailDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemDetailDTO.php index f31318ba..9e465f6d 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemDetailDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemDetailDTO.php @@ -2,7 +2,7 @@ /** * OrderItemDetailDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('item_count', $data ?? [], null); $this->setIfExists('item_status', $data ?? [], null); @@ -289,6 +289,15 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab { $invalidProperties = []; + if ($this->container['item_count'] === null) { + $invalidProperties[] = "'item_count' can't be null"; + } + if ($this->container['item_status'] === null) { + $invalidProperties[] = "'item_status' can't be null"; + } + if ($this->container['update_date'] === null) { + $invalidProperties[] = "'update_date' can't be null"; + } return $invalidProperties; } @@ -307,7 +316,7 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets item_count * - * @return int|null + * @return int */ public function getItemCount() { @@ -317,7 +326,7 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets item_count * - * @param int|null $item_count Количество единиц товара. + * @param int $item_count Количество единиц товара. * * @return self */ @@ -334,7 +343,7 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets item_status * - * @return \OpenAPI\Client\Model\OrderItemStatusType|null + * @return \OpenAPI\Client\Model\OrderItemStatusType */ public function getItemStatus() { @@ -344,7 +353,7 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets item_status * - * @param \OpenAPI\Client\Model\OrderItemStatusType|null $item_status item_status + * @param \OpenAPI\Client\Model\OrderItemStatusType $item_status item_status * * @return self */ @@ -361,7 +370,7 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets update_date * - * @return string|null + * @return string */ public function getUpdateDate() { @@ -371,7 +380,7 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets update_date * - * @param string|null $update_date Формат даты: `ДД-ММ-ГГГГ`. + * @param string $update_date Формат даты: `ДД-ММ-ГГГГ`. * * @return self */ @@ -387,11 +396,11 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +408,12 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +438,11 @@ class OrderItemDetailDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemInstanceDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemInstanceDTO.php index f2c4e436..1f99ed6f 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemInstanceDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemInstanceDTO.php @@ -2,7 +2,7 @@ /** * OrderItemInstanceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderItemInstanceDTO Class Doc Comment * * @category Class - * @description Переданные вами для данной позиции коды маркировки или УИНы. Коды «Честного знака» возвращаются в двух вариантах — с криптохвостом и без. + * @description Переданные для данной позиции коды маркировки или УИНы. Коды «Честного знака» возвращаются в двух вариантах — с криптохвостом и без. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -62,7 +62,8 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ 'cis_full' => 'string', 'uin' => 'string', 'rnpt' => 'string', - 'gtd' => 'string' + 'gtd' => 'string', + 'country_code' => 'string' ]; /** @@ -77,7 +78,8 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ 'cis_full' => null, 'uin' => null, 'rnpt' => null, - 'gtd' => null + 'gtd' => null, + 'country_code' => null ]; /** @@ -90,7 +92,8 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ 'cis_full' => false, 'uin' => false, 'rnpt' => false, - 'gtd' => false + 'gtd' => false, + 'country_code' => false ]; /** @@ -183,7 +186,8 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ 'cis_full' => 'cisFull', 'uin' => 'uin', 'rnpt' => 'rnpt', - 'gtd' => 'gtd' + 'gtd' => 'gtd', + 'country_code' => 'countryCode' ]; /** @@ -196,7 +200,8 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ 'cis_full' => 'setCisFull', 'uin' => 'setUin', 'rnpt' => 'setRnpt', - 'gtd' => 'setGtd' + 'gtd' => 'setGtd', + 'country_code' => 'setCountryCode' ]; /** @@ -209,7 +214,8 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ 'cis_full' => 'getCisFull', 'uin' => 'getUin', 'rnpt' => 'getRnpt', - 'gtd' => 'getGtd' + 'gtd' => 'getGtd', + 'country_code' => 'getCountryCode' ]; /** @@ -264,16 +270,17 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('cis', $data ?? [], null); $this->setIfExists('cis_full', $data ?? [], null); $this->setIfExists('uin', $data ?? [], null); $this->setIfExists('rnpt', $data ?? [], null); $this->setIfExists('gtd', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); } /** @@ -303,6 +310,18 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ { $invalidProperties = []; + if (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) > 2)) { + $invalidProperties[] = "invalid value for 'country_code', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) < 2)) { + $invalidProperties[] = "invalid value for 'country_code', the character length must be bigger than or equal to 2."; + } + + if (!is_null($this->container['country_code']) && !preg_match("/^[A-Z]{2}$/", $this->container['country_code'])) { + $invalidProperties[] = "invalid value for 'country_code', must be conform to the pattern /^[A-Z]{2}$/."; + } + return $invalidProperties; } @@ -331,7 +350,7 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets cis * - * @param string|null $cis Код идентификации единицы товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/) без криптохвоста. + * @param string|null $cis Код идентификации единицы товара в системе [«Честный ЗНАК»](https://честныйзнак.рф/) без криптохвоста или [«ASL BELGISI»](https://aslbelgisi.uz) (для продавцов Market Yandex Go). * * @return self */ @@ -358,7 +377,7 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Sets cis_full * - * @param string|null $cis_full Код идентификации единицы товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/) с криптохвостом. + * @param string|null $cis_full Код идентификации единицы товара в системе [«Честный ЗНАК»](https://честныйзнак.рф/) с криптохвостом. * * @return self */ @@ -452,14 +471,51 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ return $this; } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code Страна производства в формате ISO 3166-1 alpha-2. [Как получить](../../reference/regions/getRegionsCodes.md) + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + if ((mb_strlen($country_code) > 2)) { + throw new \InvalidArgumentException('invalid length for $country_code when calling OrderItemInstanceDTO., must be smaller than or equal to 2.'); + } + if ((mb_strlen($country_code) < 2)) { + throw new \InvalidArgumentException('invalid length for $country_code when calling OrderItemInstanceDTO., must be bigger than or equal to 2.'); + } + if ((!preg_match("/^[A-Z]{2}$/", ObjectSerializer::toString($country_code)))) { + throw new \InvalidArgumentException("invalid value for \$country_code when calling OrderItemInstanceDTO., must conform to the pattern /^[A-Z]{2}$/."); + } + + $this->container['country_code'] = $country_code; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +523,12 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +553,11 @@ class OrderItemInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemInstanceModificationDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemInstanceModificationDTO.php index cc38f1f3..66dcf1a2 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemInstanceModificationDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemInstanceModificationDTO.php @@ -2,7 +2,7 @@ /** * OrderItemInstanceModificationDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrderItemInstanceModificationDTO implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('instances', $data ?? [], null); @@ -316,7 +316,7 @@ class OrderItemInstanceModificationDTO implements ModelInterface, ArrayAccess, \ /** * Sets id * - * @param int $id Идентификатор товара в заказе. Он приходит в ответе на запрос [GET campaigns/{campaignId}/orders/{orderId}](../../reference/orders/getOrder.md) и в запросе Маркета [POST order/accept](../../pushapi/reference/orderAccept.md) — параметр `id` в `items`. + * @param int $id Идентификатор товара в заказе. Он приходит в ответе метода [POST v1/businesses/{businessId}/orders](../../reference/orders/getBusinessOrders.md) — параметр `id` в `items`. * * @return self */ @@ -359,11 +359,11 @@ class OrderItemInstanceModificationDTO implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class OrderItemInstanceModificationDTO implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class OrderItemInstanceModificationDTO implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemInstanceType.php b/erp24/lib/yandex_market_api/Model/OrderItemInstanceType.php index 8d81b6d6..cc3d805b 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemInstanceType.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemInstanceType.php @@ -2,7 +2,7 @@ /** * OrderItemInstanceType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderItemInstanceType Class Doc Comment * * @category Class - * @description Вид маркировки товара: * `CIS` — КИЗ, идентификатор единицы товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/). Обязателен для заполнения. * `CIS_OPTIONAL` — КИЗ, идентификатор единицы товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/). Необязателен для заполнения, но в ближайшее время потребуется его передача. * `UIN` — УИН, уникальный идентификационный номер. * `RNPT` — РНПТ, регистрационный номер партии товара. * `GTD` — номер ГТД, грузовой таможенной декларации. + * @description Вид маркировки товара: * `CIS` — КИЗ, идентификатор единицы товара в системе [«Честный ЗНАК»](https://честныйзнак.рф/) или [«ASL BELGISI»](https://aslbelgisi.uz) (для продавцов Market Yandex Go). Обязателен для заполнения. * `CIS_OPTIONAL` — КИЗ, идентификатор единицы товара в системе [«Честный ЗНАК»](https://честныйзнак.рф/). Необязателен для заполнения, но в ближайшее время потребуется его передача. * `UIN` — УИН, уникальный идентификационный номер. * `RNPT` — РНПТ, регистрационный номер партии товара. * `GTD` — номер ГТД, грузовой таможенной декларации. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderItemModificationDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemModificationDTO.php index f9ee7963..efec3cd1 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemModificationDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemModificationDTO.php @@ -2,7 +2,7 @@ /** * OrderItemModificationDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('count', $data ?? [], null); @@ -299,6 +299,10 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri $invalidProperties[] = "invalid value for 'count', must be bigger than or equal to 0."; } + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -327,7 +331,7 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets id * - * @param int $id Идентификатор товара в рамках заказа. Получить идентификатор можно с помощью ресурсов [GET campaigns/{campaignId}/orders](../../reference/orders/getOrders.md) или [GET campaigns/{campaignId}/orders/{orderId}](../../reference/orders/getOrder.md). Обязательный параметр. + * @param int $id Идентификатор товара в рамках заказа. Получить идентификатор можно с помощью метода: * [POST v1/businesses/{businessId}/orders](../../reference/orders/getBusinessOrders.md). Обязательный параметр. * * @return self */ @@ -386,7 +390,7 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets instances * - * @param \OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]|null $instances Информация о маркировке единиц товара. Передавайте в запросе все единицы товара, который подлежит маркировке. Обязательный параметр, если в заказе есть товары, подлежащие маркировке [в системе «Честный ЗНАК»](https://честныйзнак.рф/). + * @param \OpenAPI\Client\Model\BriefOrderItemInstanceDTO[]|null $instances Информация о маркировке единиц товара. Передавайте в запросе все единицы товара, который подлежит маркировке. Обязательный параметр, если в заказе от бизнеса есть товары, подлежащие маркировке в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]). * * @return self */ @@ -402,6 +406,11 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling OrderItemModificationDTO., number of items must be greater than or equal to 1.'); + } $this->container['instances'] = $instances; return $this; @@ -409,11 +418,11 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -421,12 +430,12 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -451,11 +460,11 @@ class OrderItemModificationDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemPromoDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemPromoDTO.php index b6b354ce..5df62035 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemPromoDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemPromoDTO.php @@ -2,7 +2,7 @@ /** * OrderItemPromoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderItemPromoDTO Class Doc Comment * * @category Class - * @description Информация о вознаграждениях партнеру за скидки на товар по промокодам, купонам и акциям. + * @description Информация о вознаграждении продавцу за скидки на товар по промокодам, купонам и акциям. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -74,8 +74,8 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'type' => null, - 'discount' => 'decimal', - 'subsidy' => 'decimal', + 'discount' => null, + 'subsidy' => null, 'shop_promo_id' => null, 'market_promo_id' => null ]; @@ -264,10 +264,10 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('discount', $data ?? [], null); @@ -306,6 +306,9 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + if ($this->container['subsidy'] === null) { + $invalidProperties[] = "'subsidy' can't be null"; + } return $invalidProperties; } @@ -378,7 +381,7 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets subsidy * - * @return float|null + * @return float */ public function getSubsidy() { @@ -388,7 +391,7 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets subsidy * - * @param float|null $subsidy Вознаграждение партнеру от Маркета за товар, проданный в рамках акции. Передается в валюте заказа. + * @param float $subsidy Вознаграждение продавцу от Маркета за товар, проданный в рамках акции. * * @return self */ @@ -442,7 +445,7 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets market_promo_id * - * @param string|null $market_promo_id Идентификатор акции в рамках соглашения на оказание услуг по продвижению сервиса между Маркетом и партнером. Параметр передается, только если параметр `type=MARKET_DEAL`. + * @param string|null $market_promo_id Идентификатор акции в рамках соглашения на оказание услуг по продвижению сервиса между Маркетом и продавцом. * * @return self */ @@ -458,11 +461,11 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -470,12 +473,12 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -500,11 +503,11 @@ class OrderItemPromoDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemStatusType.php b/erp24/lib/yandex_market_api/Model/OrderItemStatusType.php index 38e37436..4e839410 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemStatusType.php @@ -2,7 +2,7 @@ /** * OrderItemStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderItemStatusType Class Doc Comment * * @category Class - * @description Возвращенный или невыкупленный товар: * `REJECTED` — невыкупленный. * `RETURNED` — возвращенный. + * @description Невыкупленный или возвращенный товар: * `REJECTED` — невыкупленный. * `RETURNED` — возвращенный. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderItemSubsidyDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemSubsidyDTO.php index 7a616fc2..128e7c43 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemSubsidyDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemSubsidyDTO.php @@ -2,7 +2,7 @@ /** * OrderItemSubsidyDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderItemSubsidyDTO Class Doc Comment * * @category Class - * @description Общее вознаграждение партнеру за все скидки на товар: * по промокодам, купонам и акциям; * по баллам Плюса. Передается в валюте заказа. + * @description Общее вознаграждение продавцу за все скидки на товар: * по промокодам, купонам и акциям; * по баллам Плюса. Включает НДС. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -71,7 +71,7 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'type' => null, - 'amount' => 'decimal' + 'amount' => null ]; /** @@ -246,10 +246,10 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); @@ -282,6 +282,12 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } return $invalidProperties; } @@ -300,7 +306,7 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets type * - * @return \OpenAPI\Client\Model\OrderItemSubsidyType|null + * @return \OpenAPI\Client\Model\OrderItemSubsidyType */ public function getType() { @@ -310,7 +316,7 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets type * - * @param \OpenAPI\Client\Model\OrderItemSubsidyType|null $type type + * @param \OpenAPI\Client\Model\OrderItemSubsidyType $type type * * @return self */ @@ -327,7 +333,7 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets amount * - * @return float|null + * @return float */ public function getAmount() { @@ -337,7 +343,7 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets amount * - * @param float|null $amount Сумма субсидии. + * @param float $amount Сумма субсидии. * * @return self */ @@ -353,11 +359,11 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +371,12 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +401,11 @@ class OrderItemSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderItemSubsidyType.php b/erp24/lib/yandex_market_api/Model/OrderItemSubsidyType.php index d38a68e7..bc776163 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemSubsidyType.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemSubsidyType.php @@ -2,7 +2,7 @@ /** * OrderItemSubsidyType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderItemTagType.php b/erp24/lib/yandex_market_api/Model/OrderItemTagType.php index b44595e3..31c21e07 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemTagType.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemTagType.php @@ -2,7 +2,7 @@ /** * OrderItemTagType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderItemValidationStatusDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemValidationStatusDTO.php new file mode 100644 index 00000000..b1581d2a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OrderItemValidationStatusDTO.php @@ -0,0 +1,513 @@ + + */ +class OrderItemValidationStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrderItemValidationStatusDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'uin' => '\OpenAPI\Client\Model\UinDTO[]', + 'cis' => '\OpenAPI\Client\Model\CisDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'uin' => null, + 'cis' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'uin' => true, + 'cis' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'uin' => 'uin', + 'cis' => 'cis' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'uin' => 'setUin', + 'cis' => 'setCis' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'uin' => 'getUin', + 'cis' => 'getCis' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('uin', $data ?? [], null); + $this->setIfExists('cis', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (!is_null($this->container['uin']) && (count($this->container['uin']) < 1)) { + $invalidProperties[] = "invalid value for 'uin', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['cis']) && (count($this->container['cis']) < 1)) { + $invalidProperties[] = "invalid value for 'cis', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор товара в заказе. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets uin + * + * @return \OpenAPI\Client\Model\UinDTO[]|null + */ + public function getUin() + { + return $this->container['uin']; + } + + /** + * Sets uin + * + * @param \OpenAPI\Client\Model\UinDTO[]|null $uin Информация по проверке :no-translate[УИНов]. + * + * @return self + */ + public function setUin($uin) + { + if (is_null($uin)) { + array_push($this->openAPINullablesSetToNull, 'uin'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('uin', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($uin) && (count($uin) < 1)) { + throw new \InvalidArgumentException('invalid length for $uin when calling OrderItemValidationStatusDTO., number of items must be greater than or equal to 1.'); + } + $this->container['uin'] = $uin; + + return $this; + } + + /** + * Gets cis + * + * @return \OpenAPI\Client\Model\CisDTO[]|null + */ + public function getCis() + { + return $this->container['cis']; + } + + /** + * Sets cis + * + * @param \OpenAPI\Client\Model\CisDTO[]|null $cis Информация по проверке кодов маркировки в системе :no-translate[«Честный ЗНАК»]. + * + * @return self + */ + public function setCis($cis) + { + if (is_null($cis)) { + array_push($this->openAPINullablesSetToNull, 'cis'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cis', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($cis) && (count($cis) < 1)) { + throw new \InvalidArgumentException('invalid length for $cis when calling OrderItemValidationStatusDTO., number of items must be greater than or equal to 1.'); + } + $this->container['cis'] = $cis; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OrderItemsModificationRequestReasonType.php b/erp24/lib/yandex_market_api/Model/OrderItemsModificationRequestReasonType.php index 9f1f37cb..62efa6f1 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemsModificationRequestReasonType.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemsModificationRequestReasonType.php @@ -2,7 +2,7 @@ /** * OrderItemsModificationRequestReasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderItemsModificationRequestReasonType Class Doc Comment * * @category Class - * @description Причина обновления состава заказа. + * @description Причина, почему обновился состав заказа: * `PARTNER_REQUESTED_REMOVE` — магазин удалил товар. * `USER_REQUESTED_REMOVE` — покупатель попросил удалить товар. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderItemsModificationResultDTO.php b/erp24/lib/yandex_market_api/Model/OrderItemsModificationResultDTO.php index 9633fad3..13dfa138 100644 --- a/erp24/lib/yandex_market_api/Model/OrderItemsModificationResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderItemsModificationResultDTO.php @@ -2,7 +2,7 @@ /** * OrderItemsModificationResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OrderItemsModificationResultDTO implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('items', $data ?? [], null); } @@ -322,11 +322,11 @@ class OrderItemsModificationResultDTO implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class OrderItemsModificationResultDTO implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class OrderItemsModificationResultDTO implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderLabelDTO.php b/erp24/lib/yandex_market_api/Model/OrderLabelDTO.php index c1affe10..882a88e9 100644 --- a/erp24/lib/yandex_market_api/Model/OrderLabelDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderLabelDTO.php @@ -2,7 +2,7 @@ /** * OrderLabelDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_id', $data ?? [], null); $this->setIfExists('places_number', $data ?? [], null); @@ -305,6 +305,14 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['url'] === null) { $invalidProperties[] = "'url' can't be null"; } + if ((mb_strlen($this->container['url']) > 2000)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2000."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + if ($this->container['parcel_box_labels'] === null) { $invalidProperties[] = "'parcel_box_labels' can't be null"; } @@ -390,7 +398,7 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets url * - * @param string $url URL файла с ярлыками‑наклейками на все коробки в заказе. Соответствует URL, по которому выполняется запрос [GET campaigns/{campaignId}/orders/{orderId}/delivery/labels](../../reference/orders/generateOrderLabels.md). + * @param string $url url * * @return self */ @@ -399,6 +407,13 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($url)) { throw new \InvalidArgumentException('non-nullable url cannot be null'); } + if ((mb_strlen($url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $url when calling OrderLabelDTO., must be smaller than or equal to 2000.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling OrderLabelDTO., must be bigger than or equal to 1.'); + } + $this->container['url'] = $url; return $this; @@ -433,11 +448,11 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +460,12 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +490,11 @@ class OrderLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderLiftType.php b/erp24/lib/yandex_market_api/Model/OrderLiftType.php index 13e76202..927846b9 100644 --- a/erp24/lib/yandex_market_api/Model/OrderLiftType.php +++ b/erp24/lib/yandex_market_api/Model/OrderLiftType.php @@ -2,7 +2,7 @@ /** * OrderLiftType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderParcelBoxDTO.php b/erp24/lib/yandex_market_api/Model/OrderParcelBoxDTO.php index bfb89309..49406965 100644 --- a/erp24/lib/yandex_market_api/Model/OrderParcelBoxDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderParcelBoxDTO.php @@ -2,7 +2,7 @@ /** * OrderParcelBoxDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('fulfilment_id', $data ?? [], null); @@ -282,6 +282,12 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['fulfilment_id'] === null) { + $invalidProperties[] = "'fulfilment_id' can't be null"; + } return $invalidProperties; } @@ -300,7 +306,7 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets id * - * @return int|null + * @return int */ public function getId() { @@ -310,7 +316,7 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets id * - * @param int|null $id Идентификатор грузоместа. + * @param int $id Идентификатор грузового места. * * @return self */ @@ -327,7 +333,7 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets fulfilment_id * - * @return string|null + * @return string */ public function getFulfilmentId() { @@ -337,7 +343,7 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets fulfilment_id * - * @param string|null $fulfilment_id Идентификатор грузового места в информационной системе магазина. + * @param string $fulfilment_id Идентификатор грузового места в системе магазина. * * @return self */ @@ -353,11 +359,11 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +371,12 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +401,11 @@ class OrderParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderPaymentMethodType.php b/erp24/lib/yandex_market_api/Model/OrderPaymentMethodType.php index 2c10dad5..ba233534 100644 --- a/erp24/lib/yandex_market_api/Model/OrderPaymentMethodType.php +++ b/erp24/lib/yandex_market_api/Model/OrderPaymentMethodType.php @@ -2,7 +2,7 @@ /** * OrderPaymentMethodType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -27,14 +27,13 @@ */ namespace OpenAPI\Client\Model; - use \OpenAPI\Client\ObjectSerializer; /** * OrderPaymentMethodType Class Doc Comment * * @category Class - * @description Способ оплаты заказа: * Значения, если выбрана оплата при оформлении заказа (`\"paymentType\": \"PREPAID\"`): * `YANDEX` — банковской картой. * `APPLE_PAY` — Apple Pay. * `GOOGLE_PAY` — Google Pay. * `CREDIT` — в кредит. * `TINKOFF_CREDIT` — в кредит в Тинькофф Банке. * `TINKOFF_INSTALLMENTS` — рассрочка в Тинькофф Банке. * `EXTERNAL_CERTIFICATE` — подарочным сертификатом (например, из приложения «Сбербанк Онлайн»). * `SBP` — через систему быстрых платежей. * `B2B_ACCOUNT_PREPAYMENT` — заказ оплачивает организация. * Значения, если выбрана оплата при получении заказа (`\"paymentType\": \"POSTPAID\"`): * `CARD_ON_DELIVERY` — банковской картой. * `BOUND_CARD_ON_DELIVERY` — привязанной картой при получении. * `CASH_ON_DELIVERY` — наличными. * `B2B_ACCOUNT_POSTPAYMENT` — заказ оплачивает организация после доставки. * `UNKNOWN` — неизвестный тип. Значение по умолчанию: `CASH_ON_DELIVERY`. + * @description Способ оплаты заказа: * Значения, если выбрана оплата при оформлении заказа (`\"paymentType\": \"PREPAID\"`): * `YANDEX` — банковской картой. * `APPLE_PAY` — Apple Pay (не используется). * `GOOGLE_PAY` — Google Pay (не используется). * `CREDIT` — в кредит. * `TINKOFF_CREDIT` — в кредит в Тинькофф Банке. * `TINKOFF_INSTALLMENTS` — рассрочка в Тинькофф Банке. * `EXTERNAL_CERTIFICATE` — подарочным сертификатом (например, из приложения «Сбербанк Онлайн»). * `SBP` — через систему быстрых платежей. * `B2B_ACCOUNT_PREPAYMENT` — заказ оплачивает организация. * Значения, если выбрана оплата при получении заказа (`\"paymentType\": \"POSTPAID\"`): * `CARD_ON_DELIVERY` — банковской картой. * `BOUND_CARD_ON_DELIVERY` — привязанной картой при получении. * `BNPL_BANK_ON_DELIVERY` — супер Сплитом. * `BNPL_ON_DELIVERY` — Сплитом. * `CASH_ON_DELIVERY` — наличными. * `B2B_ACCOUNT_POSTPAYMENT` — заказ оплачивает организация после доставки. * `UNKNOWN` — неизвестный тип. Значение по умолчанию: `CASH_ON_DELIVERY`. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -50,6 +49,10 @@ class OrderPaymentMethodType public const BOUND_CARD_ON_DELIVERY = 'BOUND_CARD_ON_DELIVERY'; + public const BNPL_BANK_ON_DELIVERY = 'BNPL_BANK_ON_DELIVERY'; + + public const BNPL_ON_DELIVERY = 'BNPL_ON_DELIVERY'; + public const YANDEX = 'YANDEX'; public const APPLE_PAY = 'APPLE_PAY'; @@ -82,6 +85,8 @@ class OrderPaymentMethodType self::CASH_ON_DELIVERY, self::CARD_ON_DELIVERY, self::BOUND_CARD_ON_DELIVERY, + self::BNPL_BANK_ON_DELIVERY, + self::BNPL_ON_DELIVERY, self::YANDEX, self::APPLE_PAY, self::EXTERNAL_CERTIFICATE, @@ -95,23 +100,6 @@ class OrderPaymentMethodType self::UNKNOWN ]; } - - public const PAYMENT_LABELS = [ - self::CASH_ON_DELIVERY => 'Наличными при получении', - self::CARD_ON_DELIVERY => 'Картой при получении', - self::BOUND_CARD_ON_DELIVERY => 'Привязанной картой при получении', - self::YANDEX => 'Банковской картой', - self::APPLE_PAY => 'Apple Pay', - self::EXTERNAL_CERTIFICATE => 'Подарочным сертификатом', - self::CREDIT => 'Кредит', - self::GOOGLE_PAY => 'Google Pay', - self::TINKOFF_CREDIT => 'Кредит в Тинькофф Банке', - self::SBP => 'СБП (Cистема быстрых платежей)', - self::TINKOFF_INSTALLMENTS => 'Рассрочка в Тинькофф Банке', - self::B2_B_ACCOUNT_PREPAYMENT => 'Заказ оплачивает организация при получении', - self::B2_B_ACCOUNT_POSTPAYMENT => 'Заказ оплачивает организация после доставки', - self::UNKNOWN => 'Неизвестный тип оплаты', - ]; } diff --git a/erp24/lib/yandex_market_api/Model/OrderPaymentType.php b/erp24/lib/yandex_market_api/Model/OrderPaymentType.php index c7fe7c5c..b34410c7 100644 --- a/erp24/lib/yandex_market_api/Model/OrderPaymentType.php +++ b/erp24/lib/yandex_market_api/Model/OrderPaymentType.php @@ -2,7 +2,7 @@ /** * OrderPaymentType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderPriceDTO.php b/erp24/lib/yandex_market_api/Model/OrderPriceDTO.php new file mode 100644 index 00000000..39860239 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OrderPriceDTO.php @@ -0,0 +1,512 @@ + + */ +class OrderPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrderPriceDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'subsidy' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'cashback' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'delivery' => '\OpenAPI\Client\Model\DeliveryPriceDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment' => null, + 'subsidy' => null, + 'cashback' => null, + 'delivery' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment' => false, + 'subsidy' => false, + 'cashback' => false, + 'delivery' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment' => 'payment', + 'subsidy' => 'subsidy', + 'cashback' => 'cashback', + 'delivery' => 'delivery' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment' => 'setPayment', + 'subsidy' => 'setSubsidy', + 'cashback' => 'setCashback', + 'delivery' => 'setDelivery' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment' => 'getPayment', + 'subsidy' => 'getSubsidy', + 'cashback' => 'getCashback', + 'delivery' => 'getDelivery' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('subsidy', $data ?? [], null); + $this->setIfExists('cashback', $data ?? [], null); + $this->setIfExists('delivery', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getPayment() + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $payment payment + * + * @return self + */ + public function setPayment($payment) + { + if (is_null($payment)) { + throw new \InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets subsidy + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getSubsidy() + { + return $this->container['subsidy']; + } + + /** + * Sets subsidy + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $subsidy subsidy + * + * @return self + */ + public function setSubsidy($subsidy) + { + if (is_null($subsidy)) { + throw new \InvalidArgumentException('non-nullable subsidy cannot be null'); + } + $this->container['subsidy'] = $subsidy; + + return $this; + } + + /** + * Gets cashback + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getCashback() + { + return $this->container['cashback']; + } + + /** + * Sets cashback + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $cashback cashback + * + * @return self + */ + public function setCashback($cashback) + { + if (is_null($cashback)) { + throw new \InvalidArgumentException('non-nullable cashback cannot be null'); + } + $this->container['cashback'] = $cashback; + + return $this; + } + + /** + * Gets delivery + * + * @return \OpenAPI\Client\Model\DeliveryPriceDTO|null + */ + public function getDelivery() + { + return $this->container['delivery']; + } + + /** + * Sets delivery + * + * @param \OpenAPI\Client\Model\DeliveryPriceDTO|null $delivery delivery + * + * @return self + */ + public function setDelivery($delivery) + { + if (is_null($delivery)) { + throw new \InvalidArgumentException('non-nullable delivery cannot be null'); + } + $this->container['delivery'] = $delivery; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OrderPromoType.php b/erp24/lib/yandex_market_api/Model/OrderPromoType.php index fbf07cbf..db810f06 100644 --- a/erp24/lib/yandex_market_api/Model/OrderPromoType.php +++ b/erp24/lib/yandex_market_api/Model/OrderPromoType.php @@ -2,7 +2,7 @@ /** * OrderPromoType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderPromoType Class Doc Comment * * @category Class - * @description Тип скидки: * `DIRECT_DISCOUNT` — прямая скидка, которую устанавливает продавец или Маркет. * `BLUE_SET` — комплекты. * `BLUE_FLASH` — флеш-акция. * `MARKET_COUPON` — скидка по промокоду Маркета. * `MARKET_PROMOCODE` — скидка по промокоду магазина. * `MARKET_BLUE` — скидка на Маркете. * `YANDEX_PLUS` — бесплатная доставка с подпиской Яндекс Плюс. * `YANDEX_EMPLOYEE` — бесплатная доставка по определенным адресам. * `LIMITED_FREE_DELIVERY_PROMO` — бесплатная доставка по ограниченному предложению. * `FREE_DELIVERY_THRESHOLD` — бесплатная доставка при достижении определенной суммы заказа. * `MULTICART_DISCOUNT` — скидка за то, что оформлена мультикорзина. * `FREE_DELIVERY_FOR_LDI` — бесплатная доставка за то, что один из товаров крупногабаритный. * `FREE_DELIVERY_FOR_LSC` — бесплатная доставка за то, что одна из корзин в мультикорзине крупногабаритная. * `FREE_PICKUP` — бесплатная доставка в пункт выдачи заказов. * `CHEAPEST_AS_GIFT` — самый дешевый товар в подарок. * `CASHBACK` — кешбэк. * `SUPPLIER_MULTICART_DISCOUNT` — скидка за доставку. * `SPREAD_DISCOUNT_COUNT` — скидка за количество одинаковых товаров. * `SPREAD_DISCOUNT_RECEIPT` — скидка от суммы чека. * `ANNOUNCEMENT_PROMO` — информационная акция, скидка не применяется к товарам. * `DISCOUNT_BY_PAYMENT_TYPE` — прямая скидка при оплате картой Плюса. * `PERCENT_DISCOUNT` — прямая скидка в процентах. * `DCO_EXTRA_DISCOUNT` — дополнительная скидка, необходимая для расчета субсидии от Маркета. * `EMPTY_PROMO` — скрытые промокоды. * `BLOCKING_PROMO` — блокирующее промо. * `UNKNOWN` — неизвестный тип. Устаревшие типы: * `GENERIC_BUNDLE`. * `MARKET_DEAL`. * `MARKET_PRIME`. * `MARKET_COIN`. * `BERU_PLUS`. * `PRICE_DROP_AS_YOU_SHOP`. * `SECRET_SALE`. + * @description Тип скидки: * `DIRECT_DISCOUNT` — прямая скидка, которую устанавливает продавец или Маркет. * `BLUE_SET` — комплекты. * `BLUE_FLASH` — флеш-акция. * `MARKET_COUPON` — скидка по промокоду Маркета. * `MARKET_PROMOCODE` — скидка по промокоду магазина. * `MARKET_BLUE` — скидка на Маркете. * `CHEAPEST_AS_GIFT` — самый дешевый товар в подарок. * `CASHBACK` — кешбэк. * `SPREAD_DISCOUNT_COUNT` — скидка за количество одинаковых товаров. * `SPREAD_DISCOUNT_RECEIPT` — скидка от суммы чека. * `DISCOUNT_BY_PAYMENT_TYPE` — прямая скидка при оплате картой Плюса. * `PERCENT_DISCOUNT` — прямая скидка в процентах. * `DCO_EXTRA_DISCOUNT` — дополнительная скидка, необходимая для расчета субсидии от Маркета. * `UNKNOWN` — неизвестный тип. Устаревшие типы: * `GENERIC_BUNDLE`. * `MARKET_COIN`. * `PRICE_DROP_AS_YOU_SHOP`. * `SECRET_SALE`. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -55,58 +55,28 @@ class OrderPromoType public const MARKET_PROMOCODE = 'MARKET_PROMOCODE'; - public const MARKET_DEAL = 'MARKET_DEAL'; - public const MARKET_BLUE = 'MARKET_BLUE'; - public const MARKET_PRIME = 'MARKET_PRIME'; - - public const YANDEX_PLUS = 'YANDEX_PLUS'; - - public const BERU_PLUS = 'BERU_PLUS'; - public const MARKET_COIN = 'MARKET_COIN'; - public const YANDEX_EMPLOYEE = 'YANDEX_EMPLOYEE'; - - public const LIMITED_FREE_DELIVERY_PROMO = 'LIMITED_FREE_DELIVERY_PROMO'; - - public const FREE_DELIVERY_THRESHOLD = 'FREE_DELIVERY_THRESHOLD'; - - public const MULTICART_DISCOUNT = 'MULTICART_DISCOUNT'; - public const PRICE_DROP_AS_YOU_SHOP = 'PRICE_DROP_AS_YOU_SHOP'; - public const FREE_DELIVERY_FOR_LDI = 'FREE_DELIVERY_FOR_LDI'; - - public const FREE_DELIVERY_FOR_LSC = 'FREE_DELIVERY_FOR_LSC'; - public const SECRET_SALE = 'SECRET_SALE'; - public const FREE_PICKUP = 'FREE_PICKUP'; - public const CHEAPEST_AS_GIFT = 'CHEAPEST_AS_GIFT'; public const CASHBACK = 'CASHBACK'; - public const SUPPLIER_MULTICART_DISCOUNT = 'SUPPLIER_MULTICART_DISCOUNT'; - public const SPREAD_DISCOUNT_COUNT = 'SPREAD_DISCOUNT_COUNT'; public const SPREAD_DISCOUNT_RECEIPT = 'SPREAD_DISCOUNT_RECEIPT'; - public const ANNOUNCEMENT_PROMO = 'ANNOUNCEMENT_PROMO'; - public const DISCOUNT_BY_PAYMENT_TYPE = 'DISCOUNT_BY_PAYMENT_TYPE'; public const PERCENT_DISCOUNT = 'PERCENT_DISCOUNT'; public const DCO_EXTRA_DISCOUNT = 'DCO_EXTRA_DISCOUNT'; - public const EMPTY_PROMO = 'EMPTY_PROMO'; - - public const BLOCKING_PROMO = 'BLOCKING_PROMO'; - public const UNKNOWN = 'UNKNOWN'; /** @@ -122,32 +92,17 @@ class OrderPromoType self::GENERIC_BUNDLE, self::MARKET_COUPON, self::MARKET_PROMOCODE, - self::MARKET_DEAL, self::MARKET_BLUE, - self::MARKET_PRIME, - self::YANDEX_PLUS, - self::BERU_PLUS, self::MARKET_COIN, - self::YANDEX_EMPLOYEE, - self::LIMITED_FREE_DELIVERY_PROMO, - self::FREE_DELIVERY_THRESHOLD, - self::MULTICART_DISCOUNT, self::PRICE_DROP_AS_YOU_SHOP, - self::FREE_DELIVERY_FOR_LDI, - self::FREE_DELIVERY_FOR_LSC, self::SECRET_SALE, - self::FREE_PICKUP, self::CHEAPEST_AS_GIFT, self::CASHBACK, - self::SUPPLIER_MULTICART_DISCOUNT, self::SPREAD_DISCOUNT_COUNT, self::SPREAD_DISCOUNT_RECEIPT, - self::ANNOUNCEMENT_PROMO, self::DISCOUNT_BY_PAYMENT_TYPE, self::PERCENT_DISCOUNT, self::DCO_EXTRA_DISCOUNT, - self::EMPTY_PROMO, - self::BLOCKING_PROMO, self::UNKNOWN ]; } diff --git a/erp24/lib/yandex_market_api/Model/OrderShipmentDTO.php b/erp24/lib/yandex_market_api/Model/OrderShipmentDTO.php index ec07eb3b..95fd3cb8 100644 --- a/erp24/lib/yandex_market_api/Model/OrderShipmentDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderShipmentDTO.php @@ -2,7 +2,7 @@ /** * OrderShipmentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('shipment_date', $data ?? [], null); @@ -303,6 +303,14 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if (!is_null($this->container['tracks']) && (count($this->container['tracks']) < 1)) { + $invalidProperties[] = "invalid value for 'tracks', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['boxes']) && (count($this->container['boxes']) < 1)) { + $invalidProperties[] = "invalid value for 'boxes', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -322,6 +330,7 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets id * * @return int|null + * @deprecated */ public function getId() { @@ -334,6 +343,7 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable * @param int|null $id Идентификатор посылки, присвоенный Маркетом. * * @return self + * @deprecated */ public function setId($id) { @@ -412,7 +422,7 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets tracks * - * @param \OpenAPI\Client\Model\OrderTrackDTO[]|null $tracks **Только для модели DBS** Информация для отслеживания перемещений посылки. + * @param \OpenAPI\Client\Model\OrderTrackDTO[]|null $tracks **Только для модели DBS** Информация для отслеживания посылки. * * @return self */ @@ -428,6 +438,11 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($tracks) && (count($tracks) < 1)) { + throw new \InvalidArgumentException('invalid length for $tracks when calling OrderShipmentDTO., number of items must be greater than or equal to 1.'); + } $this->container['tracks'] = $tracks; return $this; @@ -462,6 +477,11 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($boxes) && (count($boxes) < 1)) { + throw new \InvalidArgumentException('invalid length for $boxes when calling OrderShipmentDTO., number of items must be greater than or equal to 1.'); + } $this->container['boxes'] = $boxes; return $this; @@ -469,11 +489,11 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -481,12 +501,12 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -511,11 +531,11 @@ class OrderShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderStateDTO.php b/erp24/lib/yandex_market_api/Model/OrderStateDTO.php index 10f6f323..532b2952 100644 --- a/erp24/lib/yandex_market_api/Model/OrderStateDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderStateDTO.php @@ -2,7 +2,7 @@ /** * OrderStateDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OrderStateDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -393,11 +393,11 @@ class OrderStateDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +405,12 @@ class OrderStateDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +435,11 @@ class OrderStateDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderStatsStatusType.php b/erp24/lib/yandex_market_api/Model/OrderStatsStatusType.php index f7897ee6..c519f61d 100644 --- a/erp24/lib/yandex_market_api/Model/OrderStatsStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrderStatsStatusType.php @@ -2,7 +2,7 @@ /** * OrderStatsStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderStatsStatusType Class Doc Comment * * @category Class - * @description Текущий статус заказа: * `CANCELLED_BEFORE_PROCESSING` — заказ отменен до начала его обработки. * `CANCELLED_IN_DELIVERY` — заказ отменен во время его доставки. * `CANCELLED_IN_PROCESSING` — заказ отменен во время его обработки. * `DELIVERY` — заказ передан службе доставки. * `DELIVERED` — заказ доставлен. * `PARTIALLY_DELIVERED` — заказ частично доставлен. * `PARTIALLY_RETURNED` — заказ частично возвращен покупателем. * `PENDING` — заказ ожидает подтверждения. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ в обработке. * `RESERVED` — товар зарезервирован на складе. * `RETURNED` — заказ полностью возвращен покупателем. * `UNKNOWN` — неизвестный статус заказа. * `UNPAID` — заказ от юридического лица ожидает оплаты. * `LOST` — заказ утерян. + * @description Текущий статус заказа: * `CANCELLED_BEFORE_PROCESSING` — заказ отменен до начала его обработки. * `CANCELLED_IN_DELIVERY` — заказ отменен во время его доставки. * `CANCELLED_IN_PROCESSING` — заказ отменен во время его обработки. * `DELIVERY` — заказ передан службе доставки. * `DELIVERED` — заказ доставлен. * `PARTIALLY_DELIVERED` — заказ частично доставлен. {% note warning \"Статус заказа может перейти в `PARTIALLY_DELIVERED` не сразу\" %} Если в доставленном заказе был невыкуп, статус изменится только после получения заказа на складе Маркета. {% endnote %} * `PARTIALLY_RETURNED` — заказ частично возвращен покупателем. * `PENDING` — заказ ожидает подтверждения. * `PICKUP` — заказ доставлен в пункт выдачи. * `PROCESSING` — заказ в обработке. * `RESERVED` — товар зарезервирован на складе. * `RETURNED` — заказ полностью возвращен покупателем. * `UNKNOWN` — неизвестный статус заказа. * `UNPAID` — заказ от юридического лица ожидает оплаты. * `LOST` — заказ утерян. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderStatusChangeDTO.php b/erp24/lib/yandex_market_api/Model/OrderStatusChangeDTO.php index 90e9008e..7ac522f8 100644 --- a/erp24/lib/yandex_market_api/Model/OrderStatusChangeDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderStatusChangeDTO.php @@ -2,7 +2,7 @@ /** * OrderStatusChangeDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OrderStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('substatus', $data ?? [], null); @@ -390,11 +390,11 @@ class OrderStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class OrderStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class OrderStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDTO.php b/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDTO.php index 5351be9c..8822f631 100644 --- a/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDTO.php @@ -2,7 +2,7 @@ /** * OrderStatusChangeDeliveryDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OrderStatusChangeDeliveryDTO implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('dates', $data ?? [], null); } @@ -319,11 +319,11 @@ class OrderStatusChangeDeliveryDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class OrderStatusChangeDeliveryDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class OrderStatusChangeDeliveryDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDatesDTO.php b/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDatesDTO.php index c3f23042..36f06535 100644 --- a/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDatesDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderStatusChangeDeliveryDatesDTO.php @@ -2,7 +2,7 @@ /** * OrderStatusChangeDeliveryDatesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OrderStatusChangeDeliveryDatesDTO implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('real_delivery_date', $data ?? [], null); } @@ -303,7 +303,7 @@ class OrderStatusChangeDeliveryDatesDTO implements ModelInterface, ArrayAccess, /** * Sets real_delivery_date * - * @param \DateTime|null $real_delivery_date **Только для модели DBS** Фактическая дата доставки.

                                                                                                  Когда передавать параметр `realDeliveryDate`: * Не передавайте параметр, если: * переводите заказ в любой статус, кроме `PICKUP` или `DELIVERED`; * меняете статус заказа на `PICKUP` или `DELIVERED` в день доставки — будет указана дата выполнения запроса. * Передавайте дату доставки, если переводите заказ в статус `PICKUP` или `DELIVERED` не в день доставки. Нельзя указывать дату доставки в будущем. {% note warning \"Индекс качества\" %} Передача статуса после установленного срока снижает индекс качества. О сроках читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/quality/tech#dbs). {% endnote %}   + * @param \DateTime|null $real_delivery_date **Только для модели DBS** Фактическая дата доставки.

                                                                                                  Когда передавать параметр `realDeliveryDate`: * Не передавайте параметр, если: * переводите заказ в любой статус, кроме `PICKUP` или `DELIVERED`; * меняете статус заказа на `PICKUP` или `DELIVERED` в день доставки — будет указана дата выполнения запроса. * Передавайте дату доставки, если переводите заказ в статус `PICKUP` или `DELIVERED` не в день доставки. Нельзя указывать дату доставки в будущем. {% note warning \"Передача статуса после установленного срока снижает индекс качества\" %} О сроках читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/quality/tech#dbs). {% endnote %}   Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -319,11 +319,11 @@ class OrderStatusChangeDeliveryDatesDTO implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class OrderStatusChangeDeliveryDatesDTO implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class OrderStatusChangeDeliveryDatesDTO implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderStatusType.php b/erp24/lib/yandex_market_api/Model/OrderStatusType.php index 8e29ed65..cce44fe9 100644 --- a/erp24/lib/yandex_market_api/Model/OrderStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrderStatusType.php @@ -2,7 +2,7 @@ /** * OrderStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderStatusType Class Doc Comment * * @category Class - * @description Статус заказа: * `CANCELLED` — отменен. * `DELIVERED` — получен покупателем. * `DELIVERY` — передан в службу доставки. * `PICKUP` — доставлен в пункт самовывоза. * `PROCESSING` — находится в обработке. * `PENDING` — ожидает обработки со стороны продавца. * `UNPAID` — оформлен, но еще не оплачен (если выбрана оплата при оформлении). * `PLACING` — оформляется, подготовка к резервированию. * `RESERVED` — зарезервирован, но недооформлен. * `PARTIALLY_RETURNED` — возвращен частично. * `RETURNED` — возвращен полностью. * `UNKNOWN` — неизвестный статус. Также могут возвращаться другие значения. Обрабатывать их не требуется. + * @description Статус заказа: * `PLACING` — оформляется, подготовка к резервированию. * `RESERVED` — зарезервирован, но недооформлен. * `UNPAID` — оформлен, но еще не оплачен (если выбрана оплата при оформлении). * `PROCESSING` — находится в обработке. * `DELIVERY` — передан в службу доставки. * `PICKUP` — доставлен в пункт выдачи. * `DELIVERED` — получен покупателем. * `CANCELLED` — отменен. * `PENDING` — ожидает обработки со стороны продавца. * `PARTIALLY_RETURNED` — возвращен частично. * `RETURNED` — возвращен полностью. * `UNKNOWN` — неизвестный статус. Также могут возвращаться другие значения. Обрабатывать их не нужно. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderSubsidyDTO.php b/erp24/lib/yandex_market_api/Model/OrderSubsidyDTO.php index 11153b30..ff2027e8 100644 --- a/erp24/lib/yandex_market_api/Model/OrderSubsidyDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderSubsidyDTO.php @@ -2,7 +2,7 @@ /** * OrderSubsidyDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderSubsidyDTO Class Doc Comment * * @category Class - * @description Общее вознаграждение партнеру за DBS-доставку и все скидки на товар: * по промокодам, купонам и акциям; * по баллам Плюса; * по доставке (DBS). Передается в валюте заказа. + * @description Общее вознаграждение продавцу за DBS-доставку и все скидки на товар: * по промокодам, купонам и акциям; * по баллам Плюса; * по доставке (DBS). Включает НДС. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -71,7 +71,7 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'type' => null, - 'amount' => 'decimal' + 'amount' => null ]; /** @@ -246,10 +246,10 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); @@ -282,6 +282,12 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } return $invalidProperties; } @@ -300,7 +306,7 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets type * - * @return \OpenAPI\Client\Model\OrderSubsidyType|null + * @return \OpenAPI\Client\Model\OrderSubsidyType */ public function getType() { @@ -310,7 +316,7 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets type * - * @param \OpenAPI\Client\Model\OrderSubsidyType|null $type type + * @param \OpenAPI\Client\Model\OrderSubsidyType $type type * * @return self */ @@ -327,7 +333,7 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets amount * - * @return float|null + * @return float */ public function getAmount() { @@ -337,7 +343,7 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets amount * - * @param float|null $amount Сумма субсидии. + * @param float $amount Сумма субсидии. * * @return self */ @@ -353,11 +359,11 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +371,12 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +401,11 @@ class OrderSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderSubsidyType.php b/erp24/lib/yandex_market_api/Model/OrderSubsidyType.php index 262ca0cc..b73b85f2 100644 --- a/erp24/lib/yandex_market_api/Model/OrderSubsidyType.php +++ b/erp24/lib/yandex_market_api/Model/OrderSubsidyType.php @@ -2,7 +2,7 @@ /** * OrderSubsidyType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrderSubstatusType.php b/erp24/lib/yandex_market_api/Model/OrderSubstatusType.php index 67ac2c93..cf0a6b0b 100644 --- a/erp24/lib/yandex_market_api/Model/OrderSubstatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrderSubstatusType.php @@ -2,7 +2,7 @@ /** * OrderSubstatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderSubstatusType Class Doc Comment * * @category Class - * @description Этап обработки заказа (если он имеет статус `PROCESSING`) или причина отмены заказа (если он имеет статус `CANCELLED`). * Значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * Значения для заказа в статусе `CANCELLED`: * `PROCESSING_EXPIRED` — значение более не используется. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `TECHNICAL_ERROR` — техническая ошибка на стороне Маркета. Обратитесь в поддержку. Также могут возвращаться другие значения. Обрабатывать их не требуется. + * @description Этап обработки заказа (статус `PROCESSING`) или причина отмены заказа (статус `CANCELLED`). * Значения для заказа в статусе `PROCESSING`: * `STARTED` — заказ подтвержден, его можно начать обрабатывать. * `READY_TO_SHIP` — заказ собран и готов к отправке. * Значения для заказа в статусе `CANCELLED`: * `RESERVATION_EXPIRED` — покупатель не завершил оформление зарезервированного заказа в течение 10 минут. * `USER_NOT_PAID` — покупатель не оплатил заказ (для типа оплаты `PREPAID`) в течение 30 минут. * `USER_UNREACHABLE` — не удалось связаться с покупателем. Для отмены с этой причиной необходимо выполнить условия: * не менее 3 звонков с 8 до 21 в часовом поясе покупателя; * перерыв между первым и третьим звонком не менее 90 минут; * соединение не короче 5 секунд. Если хотя бы одно из этих условий не выполнено (кроме случая, когда номер недоступен), отменить заказ не получится. Вернется ответ с кодом ошибки 400. * `USER_CHANGED_MIND` — покупатель отменил заказ по личным причинам. * `USER_REFUSED_DELIVERY` — покупателя не устроили условия доставки. * `USER_REFUSED_PRODUCT` — покупателю не подошел товар. * `SHOP_FAILED` — магазин не может выполнить заказ. * `USER_REFUSED_QUALITY` — покупателя не устроило качество товара. * `REPLACING_ORDER` — покупатель решил заменить товар другим по собственной инициативе. * `PROCESSING_EXPIRED` — значение более не используется. * `PICKUP_EXPIRED` — закончился срок хранения заказа в пункт выдачи. * `TOO_MANY_DELIVERY_DATE_CHANGES` — заказ переносили слишком много раз. * `TOO_LONG_DELIVERY` — заказ доставляется слишком долго. * `INCORRECT_PERSONAL_DATA` — для заказа из-за рубежа указаны неправильные данные получателя, заказ не пройдет проверку на таможне. * `TECHNICAL_ERROR` — техническая ошибка на стороне Маркета. Обратитесь в поддержку. Также могут возвращаться другие значения. Обрабатывать их не нужно. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -95,8 +95,6 @@ class OrderSubstatusType public const WAREHOUSE_FAILED_TO_SHIP = 'WAREHOUSE_FAILED_TO_SHIP'; - public const DELIVERY_SERIVCE_UNDELIVERED = 'DELIVERY_SERIVCE_UNDELIVERED'; - public const DELIVERY_SERVICE_UNDELIVERED = 'DELIVERY_SERVICE_UNDELIVERED'; public const PREORDER = 'PREORDER'; @@ -113,8 +111,6 @@ class OrderSubstatusType public const ASYNC_PROCESSING = 'ASYNC_PROCESSING'; - public const USER_REFUSED_TO_PROVIDE_PERSONAL_DATA = 'USER_REFUSED_TO_PROVIDE_PERSONAL_DATA'; - public const WAITING_USER_INPUT = 'WAITING_USER_INPUT'; public const WAITING_BANK_DECISION = 'WAITING_BANK_DECISION'; @@ -155,8 +151,6 @@ class OrderSubstatusType public const USER_FORGOT_TO_USE_BONUS = 'USER_FORGOT_TO_USE_BONUS'; - public const RECEIVED_ON_DISTRIBUTION_CENTER = 'RECEIVED_ON_DISTRIBUTION_CENTER'; - public const DELIVERY_SERVICE_NOT_RECEIVED = 'DELIVERY_SERVICE_NOT_RECEIVED'; public const DELIVERY_SERVICE_LOST = 'DELIVERY_SERVICE_LOST'; @@ -269,6 +263,16 @@ class OrderSubstatusType public const READY_FOR_PICKUP = 'READY_FOR_PICKUP'; + public const TOO_MANY_DELIVERY_DATE_CHANGES = 'TOO_MANY_DELIVERY_DATE_CHANGES'; + + public const TOO_LONG_DELIVERY = 'TOO_LONG_DELIVERY'; + + public const DEFERRED_PAYMENT = 'DEFERRED_PAYMENT'; + + public const POSTPAID_FAILED = 'POSTPAID_FAILED'; + + public const INCORRECT_PERSONAL_DATA = 'INCORRECT_PERSONAL_DATA'; + public const UNKNOWN = 'UNKNOWN'; /** @@ -304,7 +308,6 @@ class OrderSubstatusType self::CUSTOM, self::DELIVERY_SERVICE_FAILED, self::WAREHOUSE_FAILED_TO_SHIP, - self::DELIVERY_SERIVCE_UNDELIVERED, self::DELIVERY_SERVICE_UNDELIVERED, self::PREORDER, self::AWAIT_CONFIRMATION, @@ -313,7 +316,6 @@ class OrderSubstatusType self::READY_TO_SHIP, self::SHIPPED, self::ASYNC_PROCESSING, - self::USER_REFUSED_TO_PROVIDE_PERSONAL_DATA, self::WAITING_USER_INPUT, self::WAITING_BANK_DECISION, self::BANK_REJECT_CREDIT_OFFER, @@ -334,7 +336,6 @@ class OrderSubstatusType self::USER_WANTED_ANOTHER_PAYMENT_METHOD, self::USER_RECEIVED_TECHNICAL_ERROR, self::USER_FORGOT_TO_USE_BONUS, - self::RECEIVED_ON_DISTRIBUTION_CENTER, self::DELIVERY_SERVICE_NOT_RECEIVED, self::DELIVERY_SERVICE_LOST, self::SHIPPED_TO_WRONG_DELIVERY_SERVICE, @@ -391,6 +392,11 @@ class OrderSubstatusType self::POSTPAID_BUDGET_RESERVATION_FAILED, self::AWAIT_CUSTOM_PRICE_CONFIRMATION, self::READY_FOR_PICKUP, + self::TOO_MANY_DELIVERY_DATE_CHANGES, + self::TOO_LONG_DELIVERY, + self::DEFERRED_PAYMENT, + self::POSTPAID_FAILED, + self::INCORRECT_PERSONAL_DATA, self::UNKNOWN ]; } diff --git a/erp24/lib/yandex_market_api/Model/OrderTaxSystemType.php b/erp24/lib/yandex_market_api/Model/OrderTaxSystemType.php index 79b4ebef..fd4fd574 100644 --- a/erp24/lib/yandex_market_api/Model/OrderTaxSystemType.php +++ b/erp24/lib/yandex_market_api/Model/OrderTaxSystemType.php @@ -2,7 +2,7 @@ /** * OrderTaxSystemType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrderTaxSystemType Class Doc Comment * * @category Class - * @description Система налогообложения (СНО) магазина на момент оформления заказа: * `ECHN` — единый сельскохозяйственный налог (ЕСХН). * `ENVD` — единый налог на вмененный доход (ЕНВД). * `OSN` — общая система налогообложения (ОСН). * `PSN` — патентная система налогообложения (ПСН). * `USN` — упрощенная система налогообложения (УСН). * `USN_MINUS_COST` — упрощенная система налогообложения, доходы, уменьшенные на величину расходов (УСН «Доходы минус расходы»). * `NPD` — налог на профессиональный доход (НПД). * `UNKNOWN_VALUE` — неизвестное значение. Используется только совместно с параметром `payment-method=YANDEX`. + * @description Система налогообложения (СНО) магазина на момент оформления заказа: * `ECHN` — единый сельскохозяйственный налог (ЕСХН). * `ENVD` — единый налог на вмененный доход (ЕНВД). * `OSN` — общая система налогообложения (ОСН). * `PSN` — патентная система налогообложения (ПСН). * `USN` — упрощенная система налогообложения (УСН). * `USN_MINUS_COST` — упрощенная система налогообложения, доходы, уменьшенные на величину расходов (УСН «Доходы минус расходы»). * `NPD` — налог на профессиональный доход (НПД). * `UNKNOWN_VALUE` — неизвестное значение. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrderTrackDTO.php b/erp24/lib/yandex_market_api/Model/OrderTrackDTO.php index a574cb90..d66b65c6 100644 --- a/erp24/lib/yandex_market_api/Model/OrderTrackDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrderTrackDTO.php @@ -2,7 +2,7 @@ /** * OrderTrackDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('track_code', $data ?? [], null); $this->setIfExists('delivery_service_id', $data ?? [], null); @@ -282,6 +282,9 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['delivery_service_id'] === null) { + $invalidProperties[] = "'delivery_service_id' can't be null"; + } return $invalidProperties; } @@ -327,7 +330,7 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets delivery_service_id * - * @return int|null + * @return int */ public function getDeliveryServiceId() { @@ -337,7 +340,7 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets delivery_service_id * - * @param int|null $delivery_service_id Идентификатор службы доставки. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). + * @param int $delivery_service_id Идентификатор службы доставки. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). * * @return self */ @@ -353,11 +356,11 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class OrderTrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrderUpdateStatusType.php b/erp24/lib/yandex_market_api/Model/OrderUpdateStatusType.php index c5c40f03..08630eb8 100644 --- a/erp24/lib/yandex_market_api/Model/OrderUpdateStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrderUpdateStatusType.php @@ -2,7 +2,7 @@ /** * OrderUpdateStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrdersShipmentInfoDTO.php b/erp24/lib/yandex_market_api/Model/OrdersShipmentInfoDTO.php index 8293c977..79f69445 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersShipmentInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersShipmentInfoDTO.php @@ -2,7 +2,7 @@ /** * OrdersShipmentInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrdersShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_ids_with_labels', $data ?? [], null); $this->setIfExists('order_ids_without_labels', $data ?? [], null); @@ -363,11 +363,11 @@ class OrdersShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -375,12 +375,12 @@ class OrdersShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -405,11 +405,11 @@ class OrdersShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionDTO.php index 44096d2b..1a919c9d 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsCommissionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrdersStatsCommissionDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('actual', $data ?? [], null); @@ -337,7 +337,7 @@ class OrdersStatsCommissionDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets actual * - * @param float|null $actual Сумма в рублях, которая была выставлена в момент создания заказа и которую нужно оплатить. Точность — два знака после запятой. + * @param float|null $actual Сумма, которая была выставлена в момент создания заказа и которую нужно оплатить. Точность — два знака после запятой. * * @return self */ @@ -353,11 +353,11 @@ class OrdersStatsCommissionDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OrdersStatsCommissionDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OrdersStatsCommissionDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionType.php index 62c6b295..896c1531 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsCommissionType.php @@ -2,7 +2,7 @@ /** * OrdersStatsCommissionType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsDTO.php index 368e99c2..a1ab04e1 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrdersStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('orders', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class OrdersStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class OrdersStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class OrdersStatsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsDeliveryRegionDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsDeliveryRegionDTO.php index 01b7343b..9a4c49a3 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsDeliveryRegionDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsDeliveryRegionDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsDeliveryRegionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OrdersStatsDeliveryRegionDTO implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -353,11 +353,11 @@ class OrdersStatsDeliveryRegionDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OrdersStatsDeliveryRegionDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OrdersStatsDeliveryRegionDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsDetailsDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsDetailsDTO.php index 13a53962..39b832c6 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsDetailsDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsDetailsDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsDetailsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OrdersStatsDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('item_status', $data ?? [], null); $this->setIfExists('item_count', $data ?? [], null); @@ -378,7 +378,7 @@ class OrdersStatsDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets update_date * - * @param \DateTime|null $update_date Дата, когда товар получил статус, указанный в параметре `itemStatus`. Формат даты: `ГГГГ-ММ-ДД`. + * @param \DateTime|null $update_date **Только для модели FBY** Дата, когда возврат был обработан на складе Маркета. Формат даты: `ГГГГ-ММ-ДД`. * * @return self */ @@ -421,11 +421,11 @@ class OrdersStatsDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ class OrdersStatsDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ class OrdersStatsDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsItemDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsItemDTO.php index ea939219..e4d45440 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsItemDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -306,10 +306,10 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_name', $data ?? [], null); $this->setIfExists('market_sku', $data ?? [], null); @@ -364,8 +364,20 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['prices']) && (count($this->container['prices']) < 1)) { + $invalidProperties[] = "invalid value for 'prices', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['details']) && (count($this->container['details']) < 1)) { + $invalidProperties[] = "invalid value for 'details', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['cis_list']) && (count($this->container['cis_list']) < 1)) { + $invalidProperties[] = "invalid value for 'cis_list', number of items must be greater than or equal to 1."; } if (!is_null($this->container['bid_fee']) && ($this->container['bid_fee'] > 10000)) { @@ -431,7 +443,7 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -463,7 +475,7 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -478,8 +490,8 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling OrdersStatsItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling OrdersStatsItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling OrdersStatsItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -543,6 +555,11 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($prices) && (count($prices) < 1)) { + throw new \InvalidArgumentException('invalid length for $prices when calling OrdersStatsItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['prices'] = $prices; return $this; @@ -604,6 +621,11 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($details) && (count($details) < 1)) { + throw new \InvalidArgumentException('invalid length for $details when calling OrdersStatsItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['details'] = $details; return $this; @@ -622,7 +644,7 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets cis_list * - * @param string[]|null $cis_list Список кодов идентификации товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/). + * @param string[]|null $cis_list Список кодов идентификации товара в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]). * * @return self */ @@ -638,6 +660,11 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($cis_list) && (count($cis_list) < 1)) { + throw new \InvalidArgumentException('invalid length for $cis_list when calling OrdersStatsItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['cis_list'] = $cis_list; return $this; @@ -718,7 +745,7 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets cofinance_threshold * - * @param float|null $cofinance_threshold Порог для скидок с Маркетом на момент оформления заказа. [Что это такое?](https://yandex.ru/support/marketplace/marketing/smart-pricing.html#sponsored-discounts) Указан в рублях. Точность — два знака после запятой. + * @param float|null $cofinance_threshold Порог для скидок с Маркетом на момент оформления заказа. [Что это такое?](https://yandex.ru/support/marketplace/marketing/smart-pricing.html#sponsored-discounts) Точность — два знака после запятой. * * @return self */ @@ -745,7 +772,7 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets cofinance_value * - * @param float|null $cofinance_value Скидка с Маркетом. [Что это такое?](https://yandex.ru/support/marketplace/marketing/smart-pricing.html#sponsored-discounts) Указана в рублях. Точность — два знака после запятой. + * @param float|null $cofinance_value Скидка с Маркетом. [Что это такое?](https://yandex.ru/support/marketplace/marketing/smart-pricing.html#sponsored-discounts) Точность — два знака после запятой. * * @return self */ @@ -761,11 +788,11 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -773,12 +800,12 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -803,11 +830,11 @@ class OrdersStatsItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsItemStatusType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsItemStatusType.php index 01ff17e6..85a01c4f 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsItemStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsItemStatusType.php @@ -2,7 +2,7 @@ /** * OrdersStatsItemStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsOrderDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsOrderDTO.php index cdd73865..8b2be275 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsOrderDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsOrderDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsOrderDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -69,7 +69,9 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa 'items' => '\OpenAPI\Client\Model\OrdersStatsItemDTO[]', 'initial_items' => '\OpenAPI\Client\Model\OrdersStatsItemDTO[]', 'payments' => '\OpenAPI\Client\Model\OrdersStatsPaymentDTO[]', - 'commissions' => '\OpenAPI\Client\Model\OrdersStatsCommissionDTO[]' + 'commissions' => '\OpenAPI\Client\Model\OrdersStatsCommissionDTO[]', + 'subsidies' => '\OpenAPI\Client\Model\OrdersStatsSubsidyDTO[]', + 'currency' => '\OpenAPI\Client\Model\CurrencyType' ]; /** @@ -91,7 +93,9 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa 'items' => null, 'initial_items' => null, 'payments' => null, - 'commissions' => null + 'commissions' => null, + 'subsidies' => null, + 'currency' => null ]; /** @@ -111,7 +115,9 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa 'items' => false, 'initial_items' => true, 'payments' => false, - 'commissions' => false + 'commissions' => false, + 'subsidies' => true, + 'currency' => false ]; /** @@ -211,7 +217,9 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa 'items' => 'items', 'initial_items' => 'initialItems', 'payments' => 'payments', - 'commissions' => 'commissions' + 'commissions' => 'commissions', + 'subsidies' => 'subsidies', + 'currency' => 'currency' ]; /** @@ -231,7 +239,9 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa 'items' => 'setItems', 'initial_items' => 'setInitialItems', 'payments' => 'setPayments', - 'commissions' => 'setCommissions' + 'commissions' => 'setCommissions', + 'subsidies' => 'setSubsidies', + 'currency' => 'setCurrency' ]; /** @@ -251,7 +261,9 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa 'items' => 'getItems', 'initial_items' => 'getInitialItems', 'payments' => 'getPayments', - 'commissions' => 'getCommissions' + 'commissions' => 'getCommissions', + 'subsidies' => 'getSubsidies', + 'currency' => 'getCurrency' ]; /** @@ -306,10 +318,10 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('creation_date', $data ?? [], null); @@ -323,6 +335,8 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa $this->setIfExists('initial_items', $data ?? [], null); $this->setIfExists('payments', $data ?? [], null); $this->setIfExists('commissions', $data ?? [], null); + $this->setIfExists('subsidies', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); } /** @@ -355,12 +369,23 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa if ($this->container['items'] === null) { $invalidProperties[] = "'items' can't be null"; } + if (!is_null($this->container['initial_items']) && (count($this->container['initial_items']) < 1)) { + $invalidProperties[] = "invalid value for 'initial_items', number of items must be greater than or equal to 1."; + } + if ($this->container['payments'] === null) { $invalidProperties[] = "'payments' can't be null"; } if ($this->container['commissions'] === null) { $invalidProperties[] = "'commissions' can't be null"; } + if (!is_null($this->container['subsidies']) && (count($this->container['subsidies']) < 1)) { + $invalidProperties[] = "invalid value for 'subsidies', number of items must be greater than or equal to 1."; + } + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } return $invalidProperties; } @@ -551,7 +576,7 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets fake * - * @param bool|null $fake Тип заказа: * `false` — настоящий заказ покупателя. * `true` — [тестовый](../../pushapi/concepts/sandbox.md) заказ Маркета. + * @param bool|null $fake Тип заказа: * `false` — настоящий заказ покупателя. * `true` — [тестовый заказ](../../concepts/sandbox.md) Маркета. * * @return self */ @@ -605,7 +630,7 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets items * - * @param \OpenAPI\Client\Model\OrdersStatsItemDTO[] $items Список товаров в заказе после возможных изменений. + * @param \OpenAPI\Client\Model\OrdersStatsItemDTO[] $items Список товаров в заказе после возможных изменений. Информация о доставке заказа добавляется отдельным элементом в массиве `items`— параметр `offerName` со значением `Доставка`. * * @return self */ @@ -632,7 +657,7 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets initial_items * - * @param \OpenAPI\Client\Model\OrdersStatsItemDTO[]|null $initial_items Список товаров в заказе до изменений. + * @param \OpenAPI\Client\Model\OrdersStatsItemDTO[]|null $initial_items Список товаров в заказе. Возвращается, только если было изменение количества товаров. * * @return self */ @@ -648,6 +673,11 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($initial_items) && (count($initial_items) < 1)) { + throw new \InvalidArgumentException('invalid length for $initial_items when calling OrdersStatsOrderDTO., number of items must be greater than or equal to 1.'); + } $this->container['initial_items'] = $initial_items; return $this; @@ -666,7 +696,7 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets payments * - * @param \OpenAPI\Client\Model\OrdersStatsPaymentDTO[] $payments Информация о денежных переводах по заказу. + * @param \OpenAPI\Client\Model\OrdersStatsPaymentDTO[] $payments Информация о расчетах по заказу. Возвращается пустым, если заказ: * только начали обрабатывать (даже если он оплачен); * отменили до момента передачи в доставку. Окончательная информация о расчетах по заказу вернется после его финальной обработки (например, после перехода в статус `DELIVERED`). * * @return self */ @@ -693,7 +723,7 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets commissions * - * @param \OpenAPI\Client\Model\OrdersStatsCommissionDTO[] $commissions Информация о комиссиях за заказ. + * @param \OpenAPI\Client\Model\OrdersStatsCommissionDTO[] $commissions Информация о стоимости услуг. * * @return self */ @@ -706,14 +736,80 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa return $this; } + + /** + * Gets subsidies + * + * @return \OpenAPI\Client\Model\OrdersStatsSubsidyDTO[]|null + */ + public function getSubsidies() + { + return $this->container['subsidies']; + } + + /** + * Sets subsidies + * + * @param \OpenAPI\Client\Model\OrdersStatsSubsidyDTO[]|null $subsidies Начисление баллов, которые используются для уменьшения стоимости размещения, и их списание в случае невыкупа или возврата. + * + * @return self + */ + public function setSubsidies($subsidies) + { + if (is_null($subsidies)) { + array_push($this->openAPINullablesSetToNull, 'subsidies'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subsidies', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($subsidies) && (count($subsidies) < 1)) { + throw new \InvalidArgumentException('invalid length for $subsidies when calling OrdersStatsOrderDTO., number of items must be greater than or equal to 1.'); + } + $this->container['subsidies'] = $subsidies; + + return $this; + } + + /** + * Gets currency + * + * @return \OpenAPI\Client\Model\CurrencyType + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \OpenAPI\Client\Model\CurrencyType $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -721,12 +817,12 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -751,11 +847,11 @@ class OrdersStatsOrderDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsOrderPaymentType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsOrderPaymentType.php index 2c50e24c..01dc9942 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsOrderPaymentType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsOrderPaymentType.php @@ -2,7 +2,7 @@ /** * OrdersStatsOrderPaymentType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrdersStatsOrderPaymentType Class Doc Comment * * @category Class - * @description Тип оплаты заказа: - `CREDIT` — заказ оформлен в кредит. - `POSTPAID` — заказ оплачен после того, как был получен. - `PREPAID` — заказ оплачен до того, как был получен. + * @description Тип оплаты заказа: - `POSTPAID` — заказ оплачен после того, как был получен. - `PREPAID` — заказ оплачен до того, как был получен. - `UNKNOWN` — неизвестный тип оплаты. Скорее всего покупатель отменил или вернул заказ или не было его оплаты. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -43,13 +43,11 @@ class OrdersStatsOrderPaymentType /** * Possible values of this enum */ - public const CREDIT = 'CREDIT'; - public const POSTPAID = 'POSTPAID'; public const PREPAID = 'PREPAID'; - public const TINKOFF_CREDIT = 'TINKOFF_CREDIT'; + public const UNKNOWN = 'UNKNOWN'; /** * Gets allowable values of the enum @@ -58,10 +56,9 @@ class OrdersStatsOrderPaymentType public static function getAllowableEnumValues() { return [ - self::CREDIT, self::POSTPAID, self::PREPAID, - self::TINKOFF_CREDIT + self::UNKNOWN ]; } } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentDTO.php index fe2984f7..69bf1d20 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsPaymentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class OrdersStatsPaymentDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('date', $data ?? [], null); @@ -446,7 +446,7 @@ class OrdersStatsPaymentDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets total * - * @param float|null $total Сумма денежного перевода. Значение указывается в рублях независимо от способа денежного перевода. Точность — два знака после запятой. + * @param float|null $total Сумма денежного перевода. Точность — два знака после запятой. * * @return self */ @@ -489,11 +489,11 @@ class OrdersStatsPaymentDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -501,12 +501,12 @@ class OrdersStatsPaymentDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -531,11 +531,11 @@ class OrdersStatsPaymentDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentOrderDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentOrderDTO.php index 195b5f71..13e4c761 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentOrderDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentOrderDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsPaymentOrderDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrdersStatsPaymentOrderDTO Class Doc Comment * * @category Class - * @description Информация о платежном получении. + * @description Информация о платежном поручении. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class OrdersStatsPaymentOrderDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('date', $data ?? [], null); @@ -353,11 +353,11 @@ class OrdersStatsPaymentOrderDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OrdersStatsPaymentOrderDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OrdersStatsPaymentOrderDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentSourceType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentSourceType.php index 4fd9774e..4039c47b 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentSourceType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentSourceType.php @@ -2,7 +2,7 @@ /** * OrdersStatsPaymentSourceType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrdersStatsPaymentSourceType Class Doc Comment * * @category Class - * @description Способ денежного перевода: - `BUYER` — оплата или возврат деньгами. - `CASHBACK` — оплата или возврат баллами Плюса. - `MARKETPLACE` — оплата или возврат купонами. - `SPLIT` — оплата картой по частям (Сплит). + * @description Способ денежного перевода: - `BUYER` — оплата или возврат деньгами. Устаревшие способы: - `CASHBACK`. - `MARKETPLACE`. - `SPLIT`. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentType.php index d99ed9a5..d5e55e50 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsPaymentType.php @@ -2,7 +2,7 @@ /** * OrdersStatsPaymentType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -47,8 +47,6 @@ class OrdersStatsPaymentType public const REFUND = 'REFUND'; - public const UNKNOWN = 'UNKNOWN'; - /** * Gets allowable values of the enum * @return string[] @@ -57,8 +55,7 @@ class OrdersStatsPaymentType { return [ self::PAYMENT, - self::REFUND, - self::UNKNOWN + self::REFUND ]; } } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsPriceDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsPriceDTO.php index fef24ecf..ccb7c83e 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsPriceDTO.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsPriceDTO.php @@ -2,7 +2,7 @@ /** * OrdersStatsPriceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class OrdersStatsPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('cost_per_item', $data ?? [], null); @@ -344,7 +344,7 @@ class OrdersStatsPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets cost_per_item * - * @param float|null $cost_per_item Цена или скидка на единицу товара в заказе. Указана в рублях. Точность — два знака после запятой. + * @param float|null $cost_per_item Цена или скидка на единицу товара в заказе. Точность — два знака после запятой. Включает НДС. * * @return self */ @@ -371,7 +371,7 @@ class OrdersStatsPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets total * - * @param float|null $total Суммарная цена или скидка на все единицы товара в заказе. Указана в рублях. Точность — два знака после запятой. + * @param float|null $total Суммарная цена или скидка на все единицы товара в заказе. Точность — два знака после запятой. Включает НДС. * * @return self */ @@ -387,11 +387,11 @@ class OrdersStatsPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class OrdersStatsPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class OrdersStatsPriceDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsPriceType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsPriceType.php index a4e12d2e..f4acd4b2 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsPriceType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsPriceType.php @@ -2,7 +2,7 @@ /** * OrdersStatsPriceType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrdersStatsPriceType Class Doc Comment * * @category Class - * @description Тип скидки или цена на товар: - `BUYER` — цена на товар с учетом скидок, в том числе купонов. - `CASHBACK` — баллы Плюса. - `MARKETPLACE` — купоны. + * @description Тип скидки или цена товара: - `BUYER` — цена товара с учетом скидок, в том числе купонов. - `CASHBACK` — баллы Плюса. - `MARKETPLACE` — купоны. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsStockType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsStockType.php index 6ae1eeef..cedc7895 100644 --- a/erp24/lib/yandex_market_api/Model/OrdersStatsStockType.php +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsStockType.php @@ -2,7 +2,7 @@ /** * OrdersStatsStockType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OrdersStatsStockType Class Doc Comment * * @category Class - * @description Тип товара: * `DEFECT` — товар бракованный. * `FIT` — товар надлежащего качества. + * @description Тип товара: * `FIT` — товар надлежащего качества. * `DEFECT` — товар бракованный. * `EXPIRED` — товар с истекшим сроком годности. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -45,14 +45,6 @@ class OrdersStatsStockType */ public const FIT = 'FIT'; - public const FREEZE = 'FREEZE'; - - public const AVAILABLE = 'AVAILABLE'; - - public const QUARANTINE = 'QUARANTINE'; - - public const UTILIZATION = 'UTILIZATION'; - public const DEFECT = 'DEFECT'; public const EXPIRED = 'EXPIRED'; @@ -65,10 +57,6 @@ class OrdersStatsStockType { return [ self::FIT, - self::FREEZE, - self::AVAILABLE, - self::QUARANTINE, - self::UTILIZATION, self::DEFECT, self::EXPIRED ]; diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsSubsidyDTO.php b/erp24/lib/yandex_market_api/Model/OrdersStatsSubsidyDTO.php new file mode 100644 index 00000000..ae933b20 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsSubsidyDTO.php @@ -0,0 +1,487 @@ + + */ +class OrdersStatsSubsidyDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrdersStatsSubsidyDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation_type' => '\OpenAPI\Client\Model\OrdersStatsSubsidyOperationType', + 'type' => '\OpenAPI\Client\Model\OrdersStatsSubsidyType', + 'amount' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation_type' => null, + 'type' => null, + 'amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'operation_type' => false, + 'type' => false, + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation_type' => 'operationType', + 'type' => 'type', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation_type' => 'setOperationType', + 'type' => 'setType', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation_type' => 'getOperationType', + 'type' => 'getType', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets operation_type + * + * @return \OpenAPI\Client\Model\OrdersStatsSubsidyOperationType + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param \OpenAPI\Client\Model\OrdersStatsSubsidyOperationType $operation_type operation_type + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\OrdersStatsSubsidyType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\OrdersStatsSubsidyType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount Количество баллов, которые используются для уменьшения стоимости размещения, с точностью до двух знаков после запятой. + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/OrdersStatsSubsidyOperationType.php b/erp24/lib/yandex_market_api/Model/OrdersStatsSubsidyOperationType.php new file mode 100644 index 00000000..fffe8cfb --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/OrdersStatsSubsidyOperationType.php @@ -0,0 +1,63 @@ +setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -353,11 +353,11 @@ class OrdersStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class OrdersStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class OrdersStatsWarehouseDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletAddressDTO.php b/erp24/lib/yandex_market_api/Model/OutletAddressDTO.php index 0d90d3ae..3ebc4def 100644 --- a/erp24/lib/yandex_market_api/Model/OutletAddressDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletAddressDTO.php @@ -2,7 +2,7 @@ /** * OutletAddressDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -288,10 +288,10 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('region_id', $data ?? [], null); $this->setIfExists('street', $data ?? [], null); @@ -386,7 +386,7 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets region_id * - * @param int $region_id Идентификатор региона. Идентификатор можно получить c помощью запроса [GET regions](../../reference/regions/searchRegionsByName.md). {% note alert %} При создании и редактировании точек продаж можно указывать только регионы типов `TOWN` (город), `CITY` (крупный город) и `REPUBLIC_AREA` (район субъекта федерации). Тип региона указан в выходных параметрах type запросов [GET regions](../../reference/regions/searchRegionsByName.md) и [GET regions/{regionId}](../../reference/regions/searchRegionsById.md). {% endnote %} + * @param int $region_id Идентификатор региона. Идентификатор можно получить c помощью запроса [GET v2/regions](../../reference/regions/searchRegionsByName.md). {% note alert \"Типы регионов при создании и редактировании точек продаж\" %} Указывайте только регионы типов `TOWN` (город), `CITY` (крупный город) и `REPUBLIC_AREA` (район субъекта федерации). Тип региона указан в выходных параметрах `type` запросов [GET v2/regions](../../reference/regions/searchRegionsByName.md) и [GET v2/regions/{regionId}](../../reference/regions/searchRegionsById.md). {% endnote %} * * @return self */ @@ -613,6 +613,7 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets city * * @return string|null + * @deprecated */ public function getCity() { @@ -622,9 +623,10 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets city * - * @param string|null $city {% note warning \"\" %} Этот параметр устарел. Не используйте его. Город или населенный пункт возвращается в параметре `regionId`. {% endnote %} + * @param string|null $city {% note warning \"В ответах города и населенные пункты возвращаются в параметре `regionId`.\" %}   {% endnote %} * * @return self + * @deprecated */ public function setCity($city) { @@ -642,11 +644,11 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -654,12 +656,12 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -684,11 +686,11 @@ class OutletAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletDTO.php b/erp24/lib/yandex_market_api/Model/OutletDTO.php index f1d85f53..f559185a 100644 --- a/erp24/lib/yandex_market_api/Model/OutletDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletDTO.php @@ -2,7 +2,7 @@ /** * OutletDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -300,10 +300,10 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -364,6 +364,10 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['working_schedule'] === null) { $invalidProperties[] = "'working_schedule' can't be null"; } + if (!is_null($this->container['delivery_rules']) && (count($this->container['delivery_rules']) < 1)) { + $invalidProperties[] = "invalid value for 'delivery_rules', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -581,7 +585,7 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets phones * - * @param string[] $phones Номера телефонов точки продаж. Передавайте в формате: `+7 (999) 999-99-99`. + * @param string[] $phones Номера телефонов точки продаж. Передавайте номер в формате: `+<код страны>(<код города>)<номер>[#<добавочный>]`. Примеры: - `+7 (999) 999-99-99` - `+7 (999) 999-99-99#1234` * * @return self */ @@ -656,6 +660,11 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($delivery_rules) && (count($delivery_rules) < 1)) { + throw new \InvalidArgumentException('invalid length for $delivery_rules when calling OutletDTO., number of items must be greater than or equal to 1.'); + } $this->container['delivery_rules'] = $delivery_rules; return $this; @@ -690,11 +699,11 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -702,12 +711,12 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -732,11 +741,11 @@ class OutletDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletDeliveryRuleDTO.php b/erp24/lib/yandex_market_api/Model/OutletDeliveryRuleDTO.php index d1e99880..8b5e3b29 100644 --- a/erp24/lib/yandex_market_api/Model/OutletDeliveryRuleDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletDeliveryRuleDTO.php @@ -2,7 +2,7 @@ /** * OutletDeliveryRuleDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class OutletDeliveryRuleDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('min_delivery_days', $data ?? [], null); $this->setIfExists('max_delivery_days', $data ?? [], null); @@ -432,7 +432,7 @@ class OutletDeliveryRuleDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets delivery_service_id * - * @param int|null $delivery_service_id Идентификатор службы доставки товаров в точку продаж. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). + * @param int|null $delivery_service_id Идентификатор службы доставки товаров в точку продаж. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). * * @return self */ @@ -494,7 +494,7 @@ class OutletDeliveryRuleDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets price_free_pickup * - * @param float|null $price_free_pickup Цена на товар, начиная с которой действует бесплатный самовывоз товара из точки продаж. + * @param float|null $price_free_pickup Цена товара, начиная с которой действует бесплатный самовывоз товара из точки продаж. * * @return self */ @@ -537,11 +537,11 @@ class OutletDeliveryRuleDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -549,12 +549,12 @@ class OutletDeliveryRuleDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -579,11 +579,11 @@ class OutletDeliveryRuleDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletLicenseDTO.php b/erp24/lib/yandex_market_api/Model/OutletLicenseDTO.php index 9210573a..5bf28ad2 100644 --- a/erp24/lib/yandex_market_api/Model/OutletLicenseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletLicenseDTO.php @@ -2,7 +2,7 @@ /** * OutletLicenseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class OutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('outlet_id', $data ?? [], null); @@ -357,7 +357,7 @@ class OutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id Идентификатор лицензии. Параметр указывается, только если нужно изменить информацию о существующей лицензии. Ее идентификатор можно узнать с помощью запроса [GET campaigns/{campaignId}/outlets/licenses](../../reference/outlets/getOutletLicenses.md). При передаче информации о новой лицензии указывать идентификатор не нужно. Идентификатор лицензии присваивается Маркетом. Не путайте его с номером, указанным на лицензии: он передается в параметре `number`. + * @param int|null $id Идентификатор лицензии. Параметр указывается, только если нужно изменить информацию о существующей лицензии. Ее идентификатор можно узнать с помощью запроса [GET v2/campaigns/{campaignId}/outlets/licenses](../../reference/outlets/getOutletLicenses.md). При передаче информации о новой лицензии указывать идентификатор не нужно. Идентификатор лицензии присваивается Маркетом. Не путайте его с номером, указанным на лицензии: он передается в параметре `number`. * * @return self */ @@ -513,11 +513,11 @@ class OutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -525,12 +525,12 @@ class OutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -555,11 +555,11 @@ class OutletLicenseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletLicensesResponseDTO.php b/erp24/lib/yandex_market_api/Model/OutletLicensesResponseDTO.php index fcc94af1..b131b7fd 100644 --- a/erp24/lib/yandex_market_api/Model/OutletLicensesResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletLicensesResponseDTO.php @@ -2,7 +2,7 @@ /** * OutletLicensesResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OutletLicensesResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('licenses', $data ?? [], null); } @@ -322,11 +322,11 @@ class OutletLicensesResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class OutletLicensesResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class OutletLicensesResponseDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletResponseDTO.php b/erp24/lib/yandex_market_api/Model/OutletResponseDTO.php index 7fdaa9d7..c517d21d 100644 --- a/erp24/lib/yandex_market_api/Model/OutletResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletResponseDTO.php @@ -2,7 +2,7 @@ /** * OutletResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class OutletResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); } @@ -319,11 +319,11 @@ class OutletResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class OutletResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class OutletResponseDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletStatusType.php b/erp24/lib/yandex_market_api/Model/OutletStatusType.php index e7b0cf80..da66fcac 100644 --- a/erp24/lib/yandex_market_api/Model/OutletStatusType.php +++ b/erp24/lib/yandex_market_api/Model/OutletStatusType.php @@ -2,7 +2,7 @@ /** * OutletStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OutletStatusType Class Doc Comment * * @category Class - * @description Статус точки продаж. Возможные значения: * `AT_MODERATION` — проверяется. * `FAILED` — не прошла проверку и отклонена модератором. * `MODERATED` — проверена и одобрена. * `NONMODERATED` — новая точка, нуждается в проверке. + * @description Статус точки продаж. Возможные значения: * `AT_MODERATION` — проверяется. * `FAILED` — не прошла проверку и отклонена модератором. * `MODERATED` — проверена и одобрена. * `NONMODERATED` — новая точка, нуждается в проверке. * `UNKNOWN` — статус не указан. При определении статуса произошла ошибка. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OutletType.php b/erp24/lib/yandex_market_api/Model/OutletType.php index 0c1bcdf1..d75cfac7 100644 --- a/erp24/lib/yandex_market_api/Model/OutletType.php +++ b/erp24/lib/yandex_market_api/Model/OutletType.php @@ -2,7 +2,7 @@ /** * OutletType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OutletType Class Doc Comment * * @category Class - * @description Тип точки продаж. Возможные значения: * `DEPOT` — пункт выдачи заказов. * `MIXED` — смешанный тип точки продаж (торговый зал и пункт выдачи заказов). * `RETAIL` — розничная точка продаж (торговый зал). + * @description Тип точки продаж. Возможные значения: * `DEPOT` — пункт выдачи заказов. * `MIXED` — смешанный тип точки продаж (торговый зал и пункт выдачи заказов). * `RETAIL` — розничная точка продаж (торговый зал). * `NOT_DEFINED` — неизвестный тип точки продажи. При определении типа произошла ошибка. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OutletVisibilityType.php b/erp24/lib/yandex_market_api/Model/OutletVisibilityType.php index 76918e5b..4298edc6 100644 --- a/erp24/lib/yandex_market_api/Model/OutletVisibilityType.php +++ b/erp24/lib/yandex_market_api/Model/OutletVisibilityType.php @@ -2,7 +2,7 @@ /** * OutletVisibilityType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * OutletVisibilityType Class Doc Comment * * @category Class - * @description Состояние точки продаж. Возможные значения: * `HIDDEN` — точка продаж выключена. * `VISIBLE` — точка продаж включена. + * @description Состояние точки продаж. Возможные значения: * `HIDDEN` — точка продаж выключена. * `VISIBLE` — точка продаж включена. * `UNKNOWN` — неизвестное состояние точки продажи. При определении состояния произошла ошибка. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleDTO.php b/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleDTO.php index 0e6fce1b..3ec84da9 100644 --- a/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleDTO.php @@ -2,7 +2,7 @@ /** * OutletWorkingScheduleDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class OutletWorkingScheduleDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('work_in_holiday', $data ?? [], null); $this->setIfExists('schedule_items', $data ?? [], null); @@ -365,11 +365,11 @@ class OutletWorkingScheduleDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -377,12 +377,12 @@ class OutletWorkingScheduleDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -407,11 +407,11 @@ class OutletWorkingScheduleDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleItemDTO.php b/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleItemDTO.php index 5df690df..e52a6af2 100644 --- a/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/OutletWorkingScheduleItemDTO.php @@ -2,7 +2,7 @@ /** * OutletWorkingScheduleItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class OutletWorkingScheduleItemDTO implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('start_day', $data ?? [], null); $this->setIfExists('end_day', $data ?? [], null); @@ -451,11 +451,11 @@ class OutletWorkingScheduleItemDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -463,12 +463,12 @@ class OutletWorkingScheduleItemDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -493,11 +493,11 @@ class OutletWorkingScheduleItemDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PageFormatType.php b/erp24/lib/yandex_market_api/Model/PageFormatType.php index 7ae98290..9c9d11c0 100644 --- a/erp24/lib/yandex_market_api/Model/PageFormatType.php +++ b/erp24/lib/yandex_market_api/Model/PageFormatType.php @@ -2,7 +2,7 @@ /** * PageFormatType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * PageFormatType Class Doc Comment * * @category Class - * @description Размещение ярлыков на странице: * `A7` — в PDF-файле будут страницы формата близкому к A7. На каждой странице размещается ярлык размером 75 × 120 мм (80,4 × 125,6 мм с учетом полей). * `A4` — в PDF-файле будут страницы формата A4. На каждой странице размещаются восемь ярлыков размером 70,6 × 99,1 мм без полей. + * @description Размещение ярлыков на странице PDF-файла: * `A9_HORIZONTALLY` — ярлык размером 58 × 40 мм без полей, близок к формату :no-translate[A9]. {% cut \"Пример ярлыка для продавцов Маркета\" %} ![Изображение горизонтального ярлыка формата :no-translate[A9] для продавцов Маркета](../../_images/labels/label-A9-horizontally.png) {% endcut %} {% cut \"Пример ярлыка для продавцов Market Yandex Go\" %} ![Изображение горизонтального ярлыка формата A9 для продавцов Market Yandex Go](../../_images/labels/label-A9-horizontally-uz.png) {% endcut %} * `A9` — ярлык размером 40 × 58 мм без полей, близок к формату A9. {% cut \"Пример ярлыка для продавцов Маркета\" %} ![Изображение вертикального ярлыка формата :no-translate[A9] для продавцов Маркета](../../_images/labels/label-A9.png) {% endcut %} {% cut \"Пример ярлыка для продавцов Market Yandex Go\" %} ![Изображение вертикального ярлыка формата :no-translate[A9] для продавцов Market Yandex Go](../../_images/labels/label-A9-uz.png) {% endcut %} * `A7` — ярлык размером 75 × 120 мм (80,4 × 125,6 мм с учетом полей), близок к формату :no-translate[A7]. {% cut \"Пример ярлыка для продавцов Маркета\" %} ![Изображение ярлыка формата A7 для продавцов Маркета](../../_images/labels/label-A7.jpg) {% endcut %} {% cut \"Пример ярлыка для продавцов Market Yandex Go\" %} ![Изображение ярлыка формата :no-translate[A7] для продавцов Market Yandex Go](../../_images/labels/label-A7-uz.png) {% endcut %} * `A4` — на листе A4 располагается ярлык того формата, который выбран в кабинете продавца на Маркете — перейдите на страницу **Заказы** → **Заказы и отгрузки** → на вкладке нужной модели работы нажмите кнопку **Формат ярлыков**. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -43,6 +43,10 @@ class PageFormatType /** * Possible values of this enum */ + public const A9_HORIZONTALLY = 'A9_HORIZONTALLY'; + + public const A9 = 'A9'; + public const A7 = 'A7'; public const A4 = 'A4'; @@ -54,6 +58,8 @@ class PageFormatType public static function getAllowableEnumValues() { return [ + self::A9_HORIZONTALLY, + self::A9, self::A7, self::A4 ]; diff --git a/erp24/lib/yandex_market_api/Model/PagedReturnsDTO.php b/erp24/lib/yandex_market_api/Model/PagedReturnsDTO.php index 4a8b63d5..59f595e5 100644 --- a/erp24/lib/yandex_market_api/Model/PagedReturnsDTO.php +++ b/erp24/lib/yandex_market_api/Model/PagedReturnsDTO.php @@ -2,7 +2,7 @@ /** * PagedReturnsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * PagedReturnsDTO Class Doc Comment * * @category Class - * @description Возвраты. + * @description Невыкупы или возвраты. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class PagedReturnsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('returns', $data ?? [], null); @@ -340,7 +340,7 @@ class PagedReturnsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets returns * - * @param \OpenAPI\Client\Model\ReturnDTO[] $returns Список возвратов. + * @param \OpenAPI\Client\Model\ReturnDTO[] $returns Список невыкупов или возвратов. * * @return self */ @@ -356,11 +356,11 @@ class PagedReturnsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class PagedReturnsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class PagedReturnsDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PagedWarehousesDTO.php b/erp24/lib/yandex_market_api/Model/PagedWarehousesDTO.php new file mode 100644 index 00000000..0f7ca13c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/PagedWarehousesDTO.php @@ -0,0 +1,447 @@ + + */ +class PagedWarehousesDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PagedWarehousesDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'warehouses' => '\OpenAPI\Client\Model\WarehouseDetailsDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'warehouses' => null, + 'paging' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'warehouses' => false, + 'paging' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'warehouses' => 'warehouses', + 'paging' => 'paging' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'warehouses' => 'setWarehouses', + 'paging' => 'setPaging' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'warehouses' => 'getWarehouses', + 'paging' => 'getPaging' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('warehouses', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['warehouses'] === null) { + $invalidProperties[] = "'warehouses' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets warehouses + * + * @return \OpenAPI\Client\Model\WarehouseDetailsDTO[] + */ + public function getWarehouses() + { + return $this->container['warehouses']; + } + + /** + * Sets warehouses + * + * @param \OpenAPI\Client\Model\WarehouseDetailsDTO[] $warehouses Список складов. + * + * @return self + */ + public function setWarehouses($warehouses) + { + if (is_null($warehouses)) { + throw new \InvalidArgumentException('non-nullable warehouses cannot be null'); + } + $this->container['warehouses'] = $warehouses; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/PalletsCountDTO.php b/erp24/lib/yandex_market_api/Model/PalletsCountDTO.php index 7a59e38a..4b88055e 100644 --- a/erp24/lib/yandex_market_api/Model/PalletsCountDTO.php +++ b/erp24/lib/yandex_market_api/Model/PalletsCountDTO.php @@ -2,7 +2,7 @@ /** * PalletsCountDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class PalletsCountDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('planned', $data ?? [], null); $this->setIfExists('fact', $data ?? [], null); @@ -371,11 +371,11 @@ class PalletsCountDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -383,12 +383,12 @@ class PalletsCountDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -413,11 +413,11 @@ class PalletsCountDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ParameterType.php b/erp24/lib/yandex_market_api/Model/ParameterType.php index 145924b7..5aaa6c8b 100644 --- a/erp24/lib/yandex_market_api/Model/ParameterType.php +++ b/erp24/lib/yandex_market_api/Model/ParameterType.php @@ -2,7 +2,7 @@ /** * ParameterType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/ParameterValueConstraintsDTO.php b/erp24/lib/yandex_market_api/Model/ParameterValueConstraintsDTO.php index 4a476eb9..b82e5aa7 100644 --- a/erp24/lib/yandex_market_api/Model/ParameterValueConstraintsDTO.php +++ b/erp24/lib/yandex_market_api/Model/ParameterValueConstraintsDTO.php @@ -2,7 +2,7 @@ /** * ParameterValueConstraintsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class ParameterValueConstraintsDTO implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('min_value', $data ?? [], null); $this->setIfExists('max_value', $data ?? [], null); @@ -387,11 +387,11 @@ class ParameterValueConstraintsDTO implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class ParameterValueConstraintsDTO implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class ParameterValueConstraintsDTO implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ParameterValueDTO.php b/erp24/lib/yandex_market_api/Model/ParameterValueDTO.php index ef82b994..05007d01 100644 --- a/erp24/lib/yandex_market_api/Model/ParameterValueDTO.php +++ b/erp24/lib/yandex_market_api/Model/ParameterValueDTO.php @@ -2,7 +2,7 @@ /** * ParameterValueDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * ParameterValueDTO Class Doc Comment * * @category Class - * @description Значение характеристики. Вы можете указывать несколько значений одной характеристики при условии, что: * Тип характеристики — `ENUM`. * В ответе на запрос [POST category/{categoryId}/parameters](../../reference/content/getCategoryContentParameters.md) у данной характеристики поле `multivalue` имеет значение `true`. Для этого в `parameterValues` передавайте каждое значение отдельно — несколько объектов с параметрами `parameterId`, `valueId` и `value`. Параметр `parameterId` должен быть одинаковым. + * @description Значение характеристики. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -258,10 +258,10 @@ class ParameterValueDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('parameter_id', $data ?? [], null); $this->setIfExists('unit_id', $data ?? [], null); @@ -390,7 +390,7 @@ class ParameterValueDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets value_id * - * @param int|null $value_id Идентификатор значения. Обязательно указывайте идентификатор, если передаете значение из перечня допустимых значений, полученного от Маркета. Только для характеристик типа `ENUM`. + * @param int|null $value_id Идентификатор значения. - Обязательно указывайте идентификатор, если передаете значение из перечня допустимых значений, полученного от Маркета. - Не указывайте для собственных значений. - Только для характеристик типа `ENUM`. * * @return self */ @@ -417,7 +417,7 @@ class ParameterValueDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets value * - * @param string|null $value Значение. + * @param string|null $value Значение. Для характеристик типа `ENUM` передавайте: - вместе с `valueId`, если значение берете из справочника; - без `valueId`, если значение собственное. * * @return self */ @@ -433,11 +433,11 @@ class ParameterValueDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -445,12 +445,12 @@ class ParameterValueDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -475,11 +475,11 @@ class ParameterValueDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ParameterValueOptionDTO.php b/erp24/lib/yandex_market_api/Model/ParameterValueOptionDTO.php index 2011edfa..9f51835f 100644 --- a/erp24/lib/yandex_market_api/Model/ParameterValueOptionDTO.php +++ b/erp24/lib/yandex_market_api/Model/ParameterValueOptionDTO.php @@ -2,7 +2,7 @@ /** * ParameterValueOptionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class ParameterValueOptionDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); @@ -393,11 +393,11 @@ class ParameterValueOptionDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +405,12 @@ class ParameterValueOptionDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +435,11 @@ class ParameterValueOptionDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ParcelBoxDTO.php b/erp24/lib/yandex_market_api/Model/ParcelBoxDTO.php index 263f3936..79743c04 100644 --- a/erp24/lib/yandex_market_api/Model/ParcelBoxDTO.php +++ b/erp24/lib/yandex_market_api/Model/ParcelBoxDTO.php @@ -2,7 +2,7 @@ /** * ParcelBoxDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * ParcelBoxDTO Class Doc Comment * * @category Class - * @description Элемент отображает одно грузовое место. Вложенные поля больше не используются, передавайте элемент пустым в запросах и не обращайте внимание на содержимое в ответах. + * @description Параметр отображает одно грузовое место. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('fulfilment_id', $data ?? [], null); @@ -282,8 +282,8 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; - if (!is_null($this->container['fulfilment_id']) && !preg_match("/^[\\p{Alnum}- ]*$/", $this->container['fulfilment_id'])) { - $invalidProperties[] = "invalid value for 'fulfilment_id', must be conform to the pattern /^[\\p{Alnum}- ]*$/."; + if (!is_null($this->container['fulfilment_id']) && !preg_match("/^[[a-zA-Z0-9]- ]*$/", $this->container['fulfilment_id'])) { + $invalidProperties[] = "invalid value for 'fulfilment_id', must be conform to the pattern /^[[a-zA-Z0-9]- ]*$/."; } return $invalidProperties; @@ -314,7 +314,7 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} + * @param int|null $id Идентификатор коробки в составе заказа. * * @return self */ @@ -332,6 +332,7 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets fulfilment_id * * @return string|null + * @deprecated */ public function getFulfilmentId() { @@ -341,9 +342,10 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets fulfilment_id * - * @param string|null $fulfilment_id {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} + * @param string|null $fulfilment_id {% note warning \"Не используйте этот параметр.\" %}   {% endnote %} * * @return self + * @deprecated */ public function setFulfilmentId($fulfilment_id) { @@ -351,8 +353,8 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable throw new \InvalidArgumentException('non-nullable fulfilment_id cannot be null'); } - if ((!preg_match("/^[\\p{Alnum}- ]*$/", ObjectSerializer::toString($fulfilment_id)))) { - throw new \InvalidArgumentException("invalid value for \$fulfilment_id when calling ParcelBoxDTO., must conform to the pattern /^[\\p{Alnum}- ]*$/."); + if ((!preg_match("/^[[a-zA-Z0-9]- ]*$/", ObjectSerializer::toString($fulfilment_id)))) { + throw new \InvalidArgumentException("invalid value for \$fulfilment_id when calling ParcelBoxDTO., must conform to the pattern /^[[a-zA-Z0-9]- ]*$/."); } $this->container['fulfilment_id'] = $fulfilment_id; @@ -362,11 +364,11 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -374,12 +376,12 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -404,11 +406,11 @@ class ParcelBoxDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ParcelBoxLabelDTO.php b/erp24/lib/yandex_market_api/Model/ParcelBoxLabelDTO.php index 7e5a11e5..f3e09c1e 100644 --- a/erp24/lib/yandex_market_api/Model/ParcelBoxLabelDTO.php +++ b/erp24/lib/yandex_market_api/Model/ParcelBoxLabelDTO.php @@ -2,7 +2,7 @@ /** * ParcelBoxLabelDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -312,10 +312,10 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('url', $data ?? [], null); $this->setIfExists('supplier_name', $data ?? [], null); @@ -362,6 +362,14 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl if ($this->container['url'] === null) { $invalidProperties[] = "'url' can't be null"; } + if ((mb_strlen($this->container['url']) > 2000)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2000."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + if ($this->container['supplier_name'] === null) { $invalidProperties[] = "'supplier_name' can't be null"; } @@ -420,7 +428,7 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets url * - * @param string $url Соответствует URL, по которому выполняется запрос [GET campaigns/{campaignId}/orders/{orderId}/delivery/shipments/{shipmentId}/boxes/{boxId}/label](../../reference/orders/generateOrderLabel.md). + * @param string $url url * * @return self */ @@ -429,6 +437,13 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl if (is_null($url)) { throw new \InvalidArgumentException('non-nullable url cannot be null'); } + if ((mb_strlen($url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $url when calling ParcelBoxLabelDTO., must be smaller than or equal to 2000.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling ParcelBoxLabelDTO., must be bigger than or equal to 1.'); + } + $this->container['url'] = $url; return $this; @@ -654,6 +669,7 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl * Gets weight * * @return string + * @deprecated */ public function getWeight() { @@ -663,9 +679,10 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets weight * - * @param string $weight {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Общая масса всех товаров в заказе. Возвращается в формате: `weight кг`. + * @param string $weight Общая масса всех товаров в заказе. Возвращается в формате `weight кг`. * * @return self + * @deprecated */ public function setWeight($weight) { @@ -690,7 +707,7 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets delivery_service_id * - * @param string $delivery_service_id Идентификатор службы доставки. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). + * @param string $delivery_service_id Идентификатор службы доставки. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). * * @return self */ @@ -760,11 +777,11 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -772,12 +789,12 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -802,11 +819,11 @@ class ParcelBoxLabelDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ParcelBoxRequestDTO.php b/erp24/lib/yandex_market_api/Model/ParcelBoxRequestDTO.php new file mode 100644 index 00000000..956ba6bf --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ParcelBoxRequestDTO.php @@ -0,0 +1,421 @@ + + */ +class ParcelBoxRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ParcelBoxRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fulfilment_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fulfilment_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'fulfilment_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'fulfilment_id' => 'fulfilmentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fulfilment_id' => 'setFulfilmentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fulfilment_id' => 'getFulfilmentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('fulfilment_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['fulfilment_id']) && !preg_match("/^[[a-zA-Z0-9]- ]*$/", $this->container['fulfilment_id'])) { + $invalidProperties[] = "invalid value for 'fulfilment_id', must be conform to the pattern /^[[a-zA-Z0-9]- ]*$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets fulfilment_id + * + * @return string|null + * @deprecated + */ + public function getFulfilmentId() + { + return $this->container['fulfilment_id']; + } + + /** + * Sets fulfilment_id + * + * @param string|null $fulfilment_id {% note warning \"Не используйте этот параметр.\" %}   {% endnote %} + * + * @return self + * @deprecated + */ + public function setFulfilmentId($fulfilment_id) + { + if (is_null($fulfilment_id)) { + throw new \InvalidArgumentException('non-nullable fulfilment_id cannot be null'); + } + + if ((!preg_match("/^[[a-zA-Z0-9]- ]*$/", ObjectSerializer::toString($fulfilment_id)))) { + throw new \InvalidArgumentException("invalid value for \$fulfilment_id when calling ParcelBoxRequestDTO., must conform to the pattern /^[[a-zA-Z0-9]- ]*$/."); + } + + $this->container['fulfilment_id'] = $fulfilment_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ParcelRequestDTO.php b/erp24/lib/yandex_market_api/Model/ParcelRequestDTO.php new file mode 100644 index 00000000..e751f53c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ParcelRequestDTO.php @@ -0,0 +1,422 @@ + + */ +class ParcelRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ParcelRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'boxes' => '\OpenAPI\Client\Model\ParcelBoxRequestDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'boxes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'boxes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'boxes' => 'boxes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'boxes' => 'setBoxes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'boxes' => 'getBoxes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('boxes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['boxes'] === null) { + $invalidProperties[] = "'boxes' can't be null"; + } + if ((count($this->container['boxes']) < 1)) { + $invalidProperties[] = "invalid value for 'boxes', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets boxes + * + * @return \OpenAPI\Client\Model\ParcelBoxRequestDTO[] + */ + public function getBoxes() + { + return $this->container['boxes']; + } + + /** + * Sets boxes + * + * @param \OpenAPI\Client\Model\ParcelBoxRequestDTO[] $boxes Список грузовых мест. По его длине Маркет определяет количество мест. + * + * @return self + */ + public function setBoxes($boxes) + { + if (is_null($boxes)) { + throw new \InvalidArgumentException('non-nullable boxes cannot be null'); + } + + + if ((count($boxes) < 1)) { + throw new \InvalidArgumentException('invalid length for $boxes when calling ParcelRequestDTO., number of items must be greater than or equal to 1.'); + } + $this->container['boxes'] = $boxes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/PartnerShipmentWarehouseDTO.php b/erp24/lib/yandex_market_api/Model/PartnerShipmentWarehouseDTO.php index d3c38518..78ef158d 100644 --- a/erp24/lib/yandex_market_api/Model/PartnerShipmentWarehouseDTO.php +++ b/erp24/lib/yandex_market_api/Model/PartnerShipmentWarehouseDTO.php @@ -2,7 +2,7 @@ /** * PartnerShipmentWarehouseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class PartnerShipmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -399,11 +399,11 @@ class PartnerShipmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -411,12 +411,12 @@ class PartnerShipmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -441,11 +441,11 @@ class PartnerShipmentWarehouseDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PaymentFrequencyType.php b/erp24/lib/yandex_market_api/Model/PaymentFrequencyType.php index 49de435b..82a9dc6e 100644 --- a/erp24/lib/yandex_market_api/Model/PaymentFrequencyType.php +++ b/erp24/lib/yandex_market_api/Model/PaymentFrequencyType.php @@ -2,7 +2,7 @@ /** * PaymentFrequencyType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/PickupAddressDTO.php b/erp24/lib/yandex_market_api/Model/PickupAddressDTO.php index 82cff6e3..3a2b5c82 100644 --- a/erp24/lib/yandex_market_api/Model/PickupAddressDTO.php +++ b/erp24/lib/yandex_market_api/Model/PickupAddressDTO.php @@ -2,7 +2,7 @@ /** * PickupAddressDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class PickupAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('country', $data ?? [], null); $this->setIfExists('city', $data ?? [], null); @@ -455,11 +455,11 @@ class PickupAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +467,12 @@ class PickupAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +497,11 @@ class PickupAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PlacementType.php b/erp24/lib/yandex_market_api/Model/PlacementType.php index 0c74adcc..0a208b54 100644 --- a/erp24/lib/yandex_market_api/Model/PlacementType.php +++ b/erp24/lib/yandex_market_api/Model/PlacementType.php @@ -2,7 +2,7 @@ /** * PlacementType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -49,6 +49,8 @@ class PlacementType public const DBS = 'DBS'; + public const LAAS = 'LAAS'; + /** * Gets allowable values of the enum * @return string[] @@ -58,7 +60,8 @@ class PlacementType return [ self::FBS, self::FBY, - self::DBS + self::DBS, + self::LAAS ]; } } diff --git a/erp24/lib/yandex_market_api/Model/PriceCompetitivenessThresholdsDTO.php b/erp24/lib/yandex_market_api/Model/PriceCompetitivenessThresholdsDTO.php index ebde7208..9b7fe419 100644 --- a/erp24/lib/yandex_market_api/Model/PriceCompetitivenessThresholdsDTO.php +++ b/erp24/lib/yandex_market_api/Model/PriceCompetitivenessThresholdsDTO.php @@ -2,7 +2,7 @@ /** * PriceCompetitivenessThresholdsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class PriceCompetitivenessThresholdsDTO implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('optimal_price', $data ?? [], null); $this->setIfExists('average_price', $data ?? [], null); @@ -353,11 +353,11 @@ class PriceCompetitivenessThresholdsDTO implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class PriceCompetitivenessThresholdsDTO implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class PriceCompetitivenessThresholdsDTO implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PriceCompetitivenessType.php b/erp24/lib/yandex_market_api/Model/PriceCompetitivenessType.php index b7b48160..36c40b72 100644 --- a/erp24/lib/yandex_market_api/Model/PriceCompetitivenessType.php +++ b/erp24/lib/yandex_market_api/Model/PriceCompetitivenessType.php @@ -2,7 +2,7 @@ /** * PriceCompetitivenessType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/PriceDTO.php b/erp24/lib/yandex_market_api/Model/PriceDTO.php index a97a0f47..220bd5f5 100644 --- a/erp24/lib/yandex_market_api/Model/PriceDTO.php +++ b/erp24/lib/yandex_market_api/Model/PriceDTO.php @@ -2,7 +2,7 @@ /** * PriceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('discount_base', $data ?? [], null); @@ -296,6 +296,14 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if (!is_null($this->container['value']) && ($this->container['value'] <= 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than 0."; + } + + if (!is_null($this->container['discount_base']) && ($this->container['discount_base'] <= 0)) { + $invalidProperties[] = "invalid value for 'discount_base', must be bigger than 0."; + } + return $invalidProperties; } @@ -324,7 +332,7 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets value * - * @param float|null $value Цена на товар. + * @param float|null $value Цена товара. * * @return self */ @@ -333,6 +341,11 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($value)) { throw new \InvalidArgumentException('non-nullable value cannot be null'); } + + if (($value <= 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling PriceDTO., must be bigger than 0.'); + } + $this->container['value'] = $value; return $this; @@ -351,7 +364,7 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets discount_base * - * @param float|null $discount_base Цена на товар без скидки. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. + * @param float|null $discount_base Зачеркнутая цена. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. * * @return self */ @@ -360,6 +373,11 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($discount_base)) { throw new \InvalidArgumentException('non-nullable discount_base cannot be null'); } + + if (($discount_base <= 0)) { + throw new \InvalidArgumentException('invalid value for $discount_base when calling PriceDTO., must be bigger than 0.'); + } + $this->container['discount_base'] = $discount_base; return $this; @@ -405,7 +423,7 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets vat * - * @param int|null $vat Идентификатор ставки НДС, применяемой для товара: * `2` — 10%. * `5` — 0%. * `6` — не облагается НДС. * `7` — 20%. Если параметр не указан, используется ставка НДС, установленная в кабинете. + * @param int|null $vat Идентификатор НДС, применяемый для товара: * `2` — НДС 10%. Например, используется при реализации отдельных продовольственных и медицинских товаров. * `5` — НДС 0%. Например, используется при продаже товаров, вывезенных в таможенной процедуре экспорта, или при оказании услуг по международной перевозке товаров. * `6` — НДС не облагается, используется только для отдельных видов услуг. * `7` — НДС 20%. Основной НДС с 2019 года до 1 января 2026 года. * `10` — НДС 5%. НДС для упрощенной системы налогообложения (УСН). * `11` — НДС 7%. НДС для упрощенной системы налогообложения (УСН). * `14` — НДС 22%. Основной НДС с 1 января 2026 года. Если параметр не указан, используется НДС, установленный в кабинете. **Для продавцов :no-translate[Market Yandex Go]** недоступна передача и получение НДС. * * @return self */ @@ -421,11 +439,11 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +451,12 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +481,11 @@ class PriceDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictDTO.php b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictDTO.php index d2170828..47052192 100644 --- a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictDTO.php +++ b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictDTO.php @@ -2,7 +2,7 @@ /** * PriceQuarantineVerdictDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class PriceQuarantineVerdictDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('params', $data ?? [], null); @@ -356,11 +356,11 @@ class PriceQuarantineVerdictDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class PriceQuarantineVerdictDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class PriceQuarantineVerdictDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParamNameType.php b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParamNameType.php index 74c38de1..dda729c7 100644 --- a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParamNameType.php +++ b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParamNameType.php @@ -2,7 +2,7 @@ /** * PriceQuarantineVerdictParamNameType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParameterDTO.php b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParameterDTO.php index 9a57ff1b..3968b9b0 100644 --- a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParameterDTO.php +++ b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictParameterDTO.php @@ -2,7 +2,7 @@ /** * PriceQuarantineVerdictParameterDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class PriceQuarantineVerdictParameterDTO implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); @@ -359,11 +359,11 @@ class PriceQuarantineVerdictParameterDTO implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class PriceQuarantineVerdictParameterDTO implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class PriceQuarantineVerdictParameterDTO implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictType.php b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictType.php index 3dff9563..3c9f704e 100644 --- a/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictType.php +++ b/erp24/lib/yandex_market_api/Model/PriceQuarantineVerdictType.php @@ -2,7 +2,7 @@ /** * PriceQuarantineVerdictType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/PriceRecommendationItemDTO.php b/erp24/lib/yandex_market_api/Model/PriceRecommendationItemDTO.php index 9f351d3a..67392287 100644 --- a/erp24/lib/yandex_market_api/Model/PriceRecommendationItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/PriceRecommendationItemDTO.php @@ -2,7 +2,7 @@ /** * PriceRecommendationItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -71,7 +71,7 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPIFormats = [ 'campaign_id' => 'int64', - 'price' => 'decimal' + 'price' => null ]; /** @@ -246,10 +246,10 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -285,6 +285,10 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + if ($this->container['price'] === null) { $invalidProperties[] = "'price' can't be null"; } @@ -320,7 +324,7 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -329,6 +333,11 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling PriceRecommendationItemDTO., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -347,7 +356,7 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets price * - * @param float $price Рекомендованная цена на товар. Чтобы продвижение хорошо работало, цена на товар должна быть не выше этого значения. [Подробно о рекомендованных ценах](https://yandex.ru/support/marketplace/marketing/campaigns.html#prices) + * @param float $price Рекомендованная цена товара. Чтобы продвижение хорошо работало, цена товара должна быть не выше этого значения. [Подробно о рекомендованных ценах](https://yandex.ru/support/marketplace/marketing/campaigns.html#prices) * * @return self */ @@ -368,11 +377,11 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -380,12 +389,12 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -410,11 +419,11 @@ class PriceRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PriceWithDiscountDTO.php b/erp24/lib/yandex_market_api/Model/PriceWithDiscountDTO.php new file mode 100644 index 00000000..20bfca1d --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/PriceWithDiscountDTO.php @@ -0,0 +1,502 @@ + + */ +class PriceWithDiscountDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PriceWithDiscountDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'float', + 'currency_id' => '\OpenAPI\Client\Model\CurrencyType', + 'discount_base' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'currency_id' => null, + 'discount_base' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => false, + 'currency_id' => false, + 'discount_base' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'currency_id' => 'currencyId', + 'discount_base' => 'discountBase' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'currency_id' => 'setCurrencyId', + 'discount_base' => 'setDiscountBase' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'currency_id' => 'getCurrencyId', + 'discount_base' => 'getDiscountBase' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('currency_id', $data ?? [], null); + $this->setIfExists('discount_base', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if (($this->container['value'] <= 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than 0."; + } + + if ($this->container['currency_id'] === null) { + $invalidProperties[] = "'currency_id' can't be null"; + } + if (!is_null($this->container['discount_base']) && ($this->container['discount_base'] <= 0)) { + $invalidProperties[] = "invalid value for 'discount_base', must be bigger than 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return float + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float $value Цена товара. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value <= 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling PriceWithDiscountDTO., must be bigger than 0.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency_id + * + * @return \OpenAPI\Client\Model\CurrencyType + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param \OpenAPI\Client\Model\CurrencyType $currency_id currency_id + * + * @return self + */ + public function setCurrencyId($currency_id) + { + if (is_null($currency_id)) { + throw new \InvalidArgumentException('non-nullable currency_id cannot be null'); + } + $this->container['currency_id'] = $currency_id; + + return $this; + } + + /** + * Gets discount_base + * + * @return float|null + */ + public function getDiscountBase() + { + return $this->container['discount_base']; + } + + /** + * Sets discount_base + * + * @param float|null $discount_base Зачеркнутая цена. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. + * + * @return self + */ + public function setDiscountBase($discount_base) + { + if (is_null($discount_base)) { + throw new \InvalidArgumentException('non-nullable discount_base cannot be null'); + } + + if (($discount_base <= 0)) { + throw new \InvalidArgumentException('invalid value for $discount_base when calling PriceWithDiscountDTO., must be bigger than 0.'); + } + + $this->container['discount_base'] = $discount_base; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/PromoOfferAutoParticipatingDetailsDTO.php b/erp24/lib/yandex_market_api/Model/PromoOfferAutoParticipatingDetailsDTO.php index 38d896cc..41368d21 100644 --- a/erp24/lib/yandex_market_api/Model/PromoOfferAutoParticipatingDetailsDTO.php +++ b/erp24/lib/yandex_market_api/Model/PromoOfferAutoParticipatingDetailsDTO.php @@ -2,7 +2,7 @@ /** * PromoOfferAutoParticipatingDetailsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('campaign_ids', $data ?? [], null); } @@ -275,6 +275,10 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce { $invalidProperties = []; + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -303,7 +307,7 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce /** * Sets campaign_ids * - * @param int[]|null $campaign_ids Магазины, в которых товар добавлен в акцию автоматически. Возвращается, если статус товара в акции — `PARTIALLY_AUTO`. + * @param int[]|null $campaign_ids Идентификаторы кампаний тех магазинов, в которых товар добавлен в акцию автоматически. Возвращается, если статус товара в акции — `PARTIALLY_AUTO`. * * @return self */ @@ -319,6 +323,11 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling PromoOfferAutoParticipatingDetailsDTO., number of items must be greater than or equal to 1.'); + } $this->container['campaign_ids'] = $campaign_ids; return $this; @@ -326,11 +335,11 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -338,12 +347,12 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -368,11 +377,11 @@ class PromoOfferAutoParticipatingDetailsDTO implements ModelInterface, ArrayAcce /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PromoOfferDiscountParamsDTO.php b/erp24/lib/yandex_market_api/Model/PromoOfferDiscountParamsDTO.php index 4029ab11..8767c3e0 100644 --- a/erp24/lib/yandex_market_api/Model/PromoOfferDiscountParamsDTO.php +++ b/erp24/lib/yandex_market_api/Model/PromoOfferDiscountParamsDTO.php @@ -2,7 +2,7 @@ /** * PromoOfferDiscountParamsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class PromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('price', $data ?? [], null); $this->setIfExists('promo_price', $data ?? [], null); @@ -390,11 +390,11 @@ class PromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -402,12 +402,12 @@ class PromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -432,11 +432,11 @@ class PromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PromoOfferParamsDTO.php b/erp24/lib/yandex_market_api/Model/PromoOfferParamsDTO.php index c23eef69..4e275f83 100644 --- a/erp24/lib/yandex_market_api/Model/PromoOfferParamsDTO.php +++ b/erp24/lib/yandex_market_api/Model/PromoOfferParamsDTO.php @@ -2,7 +2,7 @@ /** * PromoOfferParamsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,8 +58,7 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'discount_params' => '\OpenAPI\Client\Model\PromoOfferDiscountParamsDTO', - 'promocode_params' => '\OpenAPI\Client\Model\PromoOfferPromocodeParamsDTO' + 'discount_params' => '\OpenAPI\Client\Model\PromoOfferDiscountParamsDTO' ]; /** @@ -70,8 +69,7 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'discount_params' => null, - 'promocode_params' => null + 'discount_params' => null ]; /** @@ -80,8 +78,7 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'discount_params' => false, - 'promocode_params' => false + 'discount_params' => false ]; /** @@ -170,8 +167,7 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $attributeMap = [ - 'discount_params' => 'discountParams', - 'promocode_params' => 'promocodeParams' + 'discount_params' => 'discountParams' ]; /** @@ -180,8 +176,7 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $setters = [ - 'discount_params' => 'setDiscountParams', - 'promocode_params' => 'setPromocodeParams' + 'discount_params' => 'setDiscountParams' ]; /** @@ -190,8 +185,7 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $getters = [ - 'discount_params' => 'getDiscountParams', - 'promocode_params' => 'getPromocodeParams' + 'discount_params' => 'getDiscountParams' ]; /** @@ -246,13 +240,12 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('discount_params', $data ?? [], null); - $this->setIfExists('promocode_params', $data ?? [], null); } /** @@ -323,41 +316,14 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa return $this; } - - /** - * Gets promocode_params - * - * @return \OpenAPI\Client\Model\PromoOfferPromocodeParamsDTO|null - */ - public function getPromocodeParams() - { - return $this->container['promocode_params']; - } - - /** - * Sets promocode_params - * - * @param \OpenAPI\Client\Model\PromoOfferPromocodeParamsDTO|null $promocode_params promocode_params - * - * @return self - */ - public function setPromocodeParams($promocode_params) - { - if (is_null($promocode_params)) { - throw new \InvalidArgumentException('non-nullable promocode_params cannot be null'); - } - $this->container['promocode_params'] = $promocode_params; - - return $this; - } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +331,12 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +361,11 @@ class PromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusFilterType.php b/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusFilterType.php index a8563aab..cd1df55d 100644 --- a/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusFilterType.php +++ b/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusFilterType.php @@ -2,7 +2,7 @@ /** * PromoOfferParticipationStatusFilterType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * PromoOfferParticipationStatusFilterType Class Doc Comment * * @category Class - * @description Фильтр для товаров, которые добавлены в акцию вручную: * `MANUALLY_ADDED` — товары, которые добавлены вручную. * `NOT_MANUALLY_ADDED`— товары, которые не участвуют в акции и те, которые добавлены автоматически. Если не передать параметр `statusType`, вернутся все товары. Об автоматическом и ручном добавлении товаров в акцию читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/marketing/promos/market/index). + * @description Фильтр для товаров, которые добавлены в акцию вручную: * `MANUALLY_ADDED` — товары, которые добавлены вручную. * `NOT_MANUALLY_ADDED`— товары, которые не участвуют в акции и те, которые добавлены автоматически. Об автоматическом и ручном добавлении товаров в акцию читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/marketing/promos/market/index). * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusMultiFilterType.php b/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusMultiFilterType.php new file mode 100644 index 00000000..23c58f1a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/PromoOfferParticipationStatusMultiFilterType.php @@ -0,0 +1,72 @@ +setIfExists('code', $data ?? [], null); $this->setIfExists('campaign_ids', $data ?? [], null); @@ -285,6 +285,10 @@ class PromoOfferUpdateWarningDTO implements ModelInterface, ArrayAccess, \JsonSe if ($this->container['code'] === null) { $invalidProperties[] = "'code' can't be null"; } + if (!is_null($this->container['campaign_ids']) && (count($this->container['campaign_ids']) < 1)) { + $invalidProperties[] = "invalid value for 'campaign_ids', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -340,7 +344,7 @@ class PromoOfferUpdateWarningDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets campaign_ids * - * @param int[]|null $campaign_ids Идентификаторы магазинов в кабинете, для которых получены предупреждения. Не возвращается, если предупреждения действуют для всех магазинов в кабинете. + * @param int[]|null $campaign_ids Идентификаторы кампаний тех магазинов, для которых получены предупреждения. Не возвращается, если предупреждения действуют для всех магазинов в кабинете. * * @return self */ @@ -356,6 +360,11 @@ class PromoOfferUpdateWarningDTO implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($campaign_ids) && (count($campaign_ids) < 1)) { + throw new \InvalidArgumentException('invalid length for $campaign_ids when calling PromoOfferUpdateWarningDTO., number of items must be greater than or equal to 1.'); + } $this->container['campaign_ids'] = $campaign_ids; return $this; @@ -363,11 +372,11 @@ class PromoOfferUpdateWarningDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -375,12 +384,12 @@ class PromoOfferUpdateWarningDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -405,11 +414,11 @@ class PromoOfferUpdateWarningDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PromoParticipationType.php b/erp24/lib/yandex_market_api/Model/PromoParticipationType.php index f038333d..21cb7e22 100644 --- a/erp24/lib/yandex_market_api/Model/PromoParticipationType.php +++ b/erp24/lib/yandex_market_api/Model/PromoParticipationType.php @@ -2,7 +2,7 @@ /** * PromoParticipationType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * PromoParticipationType Class Doc Comment * * @category Class - * @description Какие акции вернутся: * `PARTICIPATING_NOW` — текущие и будущие акции продавца. * `PARTICIPATED` — завершенные акции продавца за последний год. Если за год их было меньше 15, в ответе придут 15 последних акций за все время. + * @description Без указания фильтра возвращаются акции, в которых продавец участвует или может принять участие. Какие акции вернутся при указании фильтра: * `PARTICIPATING_NOW` — текущие акции, в которых участвует продавец. * `PARTICIPATED` — завершенные акции, в которых продавец участвовал за последний год. Если за год их было меньше 15, в ответе придут 15 последних акций за все время. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/PromoPeriodDTO.php b/erp24/lib/yandex_market_api/Model/PromoPeriodDTO.php index 6d00e51f..a90e84a8 100644 --- a/erp24/lib/yandex_market_api/Model/PromoPeriodDTO.php +++ b/erp24/lib/yandex_market_api/Model/PromoPeriodDTO.php @@ -2,7 +2,7 @@ /** * PromoPeriodDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class PromoPeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('date_time_from', $data ?? [], null); $this->setIfExists('date_time_to', $data ?? [], null); @@ -359,11 +359,11 @@ class PromoPeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class PromoPeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class PromoPeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ProvideOrderDigitalCodesRequest.php b/erp24/lib/yandex_market_api/Model/ProvideOrderDigitalCodesRequest.php index f51033b8..6ca66006 100644 --- a/erp24/lib/yandex_market_api/Model/ProvideOrderDigitalCodesRequest.php +++ b/erp24/lib/yandex_market_api/Model/ProvideOrderDigitalCodesRequest.php @@ -2,7 +2,7 @@ /** * ProvideOrderDigitalCodesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('items', $data ?? [], null); } @@ -278,6 +278,14 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J if ($this->container['items'] === null) { $invalidProperties[] = "'items' can't be null"; } + if ((count($this->container['items']) > 100)) { + $invalidProperties[] = "invalid value for 'items', number of items must be less than or equal to 100."; + } + + if ((count($this->container['items']) < 1)) { + $invalidProperties[] = "invalid value for 'items', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -306,7 +314,7 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J /** * Sets items * - * @param \OpenAPI\Client\Model\OrderDigitalItemDTO[] $items Список проданных ключей. Если в заказе есть несколько **одинаковых** товаров (например, несколько ключей к одной и той же подписке), передайте каждый в виде отдельного элемента массива. `id` у этих элементов должен быть один и тот же. + * @param \OpenAPI\Client\Model\OrderDigitalItemDTO[] $items Список проданных товаров. Для товара с одинаковым `id` передавайте один элемент и массив `codes` по количеству ключей. * * @return self */ @@ -315,6 +323,13 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J if (is_null($items)) { throw new \InvalidArgumentException('non-nullable items cannot be null'); } + + if ((count($items) > 100)) { + throw new \InvalidArgumentException('invalid value for $items when calling ProvideOrderDigitalCodesRequest., number of items must be less than or equal to 100.'); + } + if ((count($items) < 1)) { + throw new \InvalidArgumentException('invalid length for $items when calling ProvideOrderDigitalCodesRequest., number of items must be greater than or equal to 1.'); + } $this->container['items'] = $items; return $this; @@ -322,11 +337,11 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +349,12 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +379,11 @@ class ProvideOrderDigitalCodesRequest implements ModelInterface, ArrayAccess, \J /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersRequest.php b/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersRequest.php index 9ad166b1..60be4554 100644 --- a/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersRequest.php +++ b/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersRequest.php @@ -2,7 +2,7 @@ /** * ProvideOrderItemIdentifiersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -239,10 +239,10 @@ class ProvideOrderItemIdentifiersRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('items', $data ?? [], null); } @@ -321,11 +321,11 @@ class ProvideOrderItemIdentifiersRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -333,12 +333,12 @@ class ProvideOrderItemIdentifiersRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -363,11 +363,11 @@ class ProvideOrderItemIdentifiersRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersResponse.php b/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersResponse.php index 24f7a1e6..ead3c149 100644 --- a/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersResponse.php +++ b/erp24/lib/yandex_market_api/Model/ProvideOrderItemIdentifiersResponse.php @@ -2,7 +2,7 @@ /** * ProvideOrderItemIdentifiersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class ProvideOrderItemIdentifiersResponse implements ModelInterface, ArrayAccess /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/PutSkuBidsRequest.php b/erp24/lib/yandex_market_api/Model/PutSkuBidsRequest.php index 4208568c..ac2df0f1 100644 --- a/erp24/lib/yandex_market_api/Model/PutSkuBidsRequest.php +++ b/erp24/lib/yandex_market_api/Model/PutSkuBidsRequest.php @@ -2,7 +2,7 @@ /** * PutSkuBidsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class PutSkuBidsRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('bids', $data ?? [], null); } @@ -337,11 +337,11 @@ class PutSkuBidsRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class PutSkuBidsRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class PutSkuBidsRequest implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QualityRatingAffectedOrderDTO.php b/erp24/lib/yandex_market_api/Model/QualityRatingAffectedOrderDTO.php index 9ea9c6f1..938ad2e3 100644 --- a/erp24/lib/yandex_market_api/Model/QualityRatingAffectedOrderDTO.php +++ b/erp24/lib/yandex_market_api/Model/QualityRatingAffectedOrderDTO.php @@ -2,7 +2,7 @@ /** * QualityRatingAffectedOrderDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class QualityRatingAffectedOrderDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_id', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); @@ -405,11 +405,11 @@ class QualityRatingAffectedOrderDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -417,12 +417,12 @@ class QualityRatingAffectedOrderDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -447,11 +447,11 @@ class QualityRatingAffectedOrderDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QualityRatingComponentDTO.php b/erp24/lib/yandex_market_api/Model/QualityRatingComponentDTO.php index 4d75c250..6514b054 100644 --- a/erp24/lib/yandex_market_api/Model/QualityRatingComponentDTO.php +++ b/erp24/lib/yandex_market_api/Model/QualityRatingComponentDTO.php @@ -2,7 +2,7 @@ /** * QualityRatingComponentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class QualityRatingComponentDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('value', $data ?? [], null); $this->setIfExists('component_type', $data ?? [], null); @@ -375,11 +375,11 @@ class QualityRatingComponentDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -387,12 +387,12 @@ class QualityRatingComponentDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -417,11 +417,11 @@ class QualityRatingComponentDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QualityRatingComponentType.php b/erp24/lib/yandex_market_api/Model/QualityRatingComponentType.php index 99bd7881..aa78eed3 100644 --- a/erp24/lib/yandex_market_api/Model/QualityRatingComponentType.php +++ b/erp24/lib/yandex_market_api/Model/QualityRatingComponentType.php @@ -2,7 +2,7 @@ /** * QualityRatingComponentType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/QualityRatingDTO.php b/erp24/lib/yandex_market_api/Model/QualityRatingDTO.php index 9a4a9e16..5181a173 100644 --- a/erp24/lib/yandex_market_api/Model/QualityRatingDTO.php +++ b/erp24/lib/yandex_market_api/Model/QualityRatingDTO.php @@ -2,7 +2,7 @@ /** * QualityRatingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class QualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('rating', $data ?? [], null); $this->setIfExists('calculation_date', $data ?? [], null); @@ -412,11 +412,11 @@ class QualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -424,12 +424,12 @@ class QualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -454,11 +454,11 @@ class QualityRatingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QualityRatingDetailsDTO.php b/erp24/lib/yandex_market_api/Model/QualityRatingDetailsDTO.php index 13997cc7..5b59eec1 100644 --- a/erp24/lib/yandex_market_api/Model/QualityRatingDetailsDTO.php +++ b/erp24/lib/yandex_market_api/Model/QualityRatingDetailsDTO.php @@ -2,7 +2,7 @@ /** * QualityRatingDetailsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class QualityRatingDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('affected_orders', $data ?? [], null); } @@ -322,11 +322,11 @@ class QualityRatingDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class QualityRatingDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class QualityRatingDetailsDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QuantumDTO.php b/erp24/lib/yandex_market_api/Model/QuantumDTO.php index 4bea853a..43f87a4e 100644 --- a/erp24/lib/yandex_market_api/Model/QuantumDTO.php +++ b/erp24/lib/yandex_market_api/Model/QuantumDTO.php @@ -2,7 +2,7 @@ /** * QuantumDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * QuantumDTO Class Doc Comment * * @category Class - * @description Настройка продажи квантами. Чтобы сбросить установленные ранее значения, передайте пустой параметр `quantum`. {% cut \"Пример\" %} ```json { \"offers\": [ { \"offerId\": \"08e35dc1-89a2-11e3-8055-0015e9b8c48d\", \"quantum\": {} } ] } ``` {% endcut %} + * @description Настройка продажи квантами. Чтобы сбросить установленные ранее значения, передайте пустой параметр `quantum`. {% cut \"Пример\" %} ```json translate=no { \"offers\": [ { \"offerId\": \"08e35dc1-89a2-11e3-8055-0015e9b8c48d\", \"quantum\": {} } ] } ``` {% endcut %} * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class QuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('min_quantity', $data ?? [], null); $this->setIfExists('step_quantity', $data ?? [], null); @@ -378,11 +378,11 @@ class QuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -390,12 +390,12 @@ class QuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -420,11 +420,11 @@ class QuantumDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QuarantineOfferDTO.php b/erp24/lib/yandex_market_api/Model/QuarantineOfferDTO.php index 0440447c..6f763c83 100644 --- a/erp24/lib/yandex_market_api/Model/QuarantineOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/QuarantineOfferDTO.php @@ -2,7 +2,7 @@ /** * QuarantineOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('current_price', $data ?? [], null); @@ -304,8 +304,12 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['verdicts']) && (count($this->container['verdicts']) < 1)) { + $invalidProperties[] = "invalid value for 'verdicts', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -336,7 +340,7 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -351,8 +355,8 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling QuarantineOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling QuarantineOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling QuarantineOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -443,6 +447,11 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($verdicts) && (count($verdicts) < 1)) { + throw new \InvalidArgumentException('invalid length for $verdicts when calling QuarantineOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['verdicts'] = $verdicts; return $this; @@ -450,11 +459,11 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -462,12 +471,12 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -492,11 +501,11 @@ class QuarantineOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/QuestionDTO.php b/erp24/lib/yandex_market_api/Model/QuestionDTO.php new file mode 100644 index 00000000..e6354766 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/QuestionDTO.php @@ -0,0 +1,622 @@ + + */ +class QuestionDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuestionDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'question_identifiers' => '\OpenAPI\Client\Model\QuestionIdentifiersDTO', + 'business_id' => 'int', + 'text' => 'string', + 'created_at' => '\DateTime', + 'votes' => '\OpenAPI\Client\Model\VotesDTO', + 'author' => '\OpenAPI\Client\Model\QuestionsTextContentAuthorDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'question_identifiers' => null, + 'business_id' => 'int64', + 'text' => null, + 'created_at' => 'date-time', + 'votes' => null, + 'author' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'question_identifiers' => false, + 'business_id' => false, + 'text' => false, + 'created_at' => false, + 'votes' => false, + 'author' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'question_identifiers' => 'questionIdentifiers', + 'business_id' => 'businessId', + 'text' => 'text', + 'created_at' => 'createdAt', + 'votes' => 'votes', + 'author' => 'author' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'question_identifiers' => 'setQuestionIdentifiers', + 'business_id' => 'setBusinessId', + 'text' => 'setText', + 'created_at' => 'setCreatedAt', + 'votes' => 'setVotes', + 'author' => 'setAuthor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'question_identifiers' => 'getQuestionIdentifiers', + 'business_id' => 'getBusinessId', + 'text' => 'getText', + 'created_at' => 'getCreatedAt', + 'votes' => 'getVotes', + 'author' => 'getAuthor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('question_identifiers', $data ?? [], null); + $this->setIfExists('business_id', $data ?? [], null); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('votes', $data ?? [], null); + $this->setIfExists('author', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['question_identifiers'] === null) { + $invalidProperties[] = "'question_identifiers' can't be null"; + } + if ($this->container['business_id'] === null) { + $invalidProperties[] = "'business_id' can't be null"; + } + if (($this->container['business_id'] < 1)) { + $invalidProperties[] = "invalid value for 'business_id', must be bigger than or equal to 1."; + } + + if ($this->container['text'] === null) { + $invalidProperties[] = "'text' can't be null"; + } + if ((mb_strlen($this->container['text']) > 5000)) { + $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 5000."; + } + + if ((mb_strlen($this->container['text']) < 1)) { + $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1."; + } + + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['votes'] === null) { + $invalidProperties[] = "'votes' can't be null"; + } + if ($this->container['author'] === null) { + $invalidProperties[] = "'author' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets question_identifiers + * + * @return \OpenAPI\Client\Model\QuestionIdentifiersDTO + */ + public function getQuestionIdentifiers() + { + return $this->container['question_identifiers']; + } + + /** + * Sets question_identifiers + * + * @param \OpenAPI\Client\Model\QuestionIdentifiersDTO $question_identifiers question_identifiers + * + * @return self + */ + public function setQuestionIdentifiers($question_identifiers) + { + if (is_null($question_identifiers)) { + throw new \InvalidArgumentException('non-nullable question_identifiers cannot be null'); + } + $this->container['question_identifiers'] = $question_identifiers; + + return $this; + } + + /** + * Gets business_id + * + * @return int + */ + public function getBusinessId() + { + return $this->container['business_id']; + } + + /** + * Sets business_id + * + * @param int $business_id Идентификатор кабинета. Чтобы его узнать, воспользуйтесь запросом [GET v2/campaigns](../../reference/campaigns/getCampaigns.md). ℹ️ [Что такое кабинет и магазин на Маркете](https://yandex.ru/support/marketplace/account/introduction.html) + * + * @return self + */ + public function setBusinessId($business_id) + { + if (is_null($business_id)) { + throw new \InvalidArgumentException('non-nullable business_id cannot be null'); + } + + if (($business_id < 1)) { + throw new \InvalidArgumentException('invalid value for $business_id when calling QuestionDTO., must be bigger than or equal to 1.'); + } + + $this->container['business_id'] = $business_id; + + return $this; + } + + /** + * Gets text + * + * @return string + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string $text Текстовое содержимое. + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + if ((mb_strlen($text) > 5000)) { + throw new \InvalidArgumentException('invalid length for $text when calling QuestionDTO., must be smaller than or equal to 5000.'); + } + if ((mb_strlen($text) < 1)) { + throw new \InvalidArgumentException('invalid length for $text when calling QuestionDTO., must be bigger than or equal to 1.'); + } + + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at Дата и время создания вопроса. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets votes + * + * @return \OpenAPI\Client\Model\VotesDTO + */ + public function getVotes() + { + return $this->container['votes']; + } + + /** + * Sets votes + * + * @param \OpenAPI\Client\Model\VotesDTO $votes votes + * + * @return self + */ + public function setVotes($votes) + { + if (is_null($votes)) { + throw new \InvalidArgumentException('non-nullable votes cannot be null'); + } + $this->container['votes'] = $votes; + + return $this; + } + + /** + * Gets author + * + * @return \OpenAPI\Client\Model\QuestionsTextContentAuthorDTO + */ + public function getAuthor() + { + return $this->container['author']; + } + + /** + * Sets author + * + * @param \OpenAPI\Client\Model\QuestionsTextContentAuthorDTO $author author + * + * @return self + */ + public function setAuthor($author) + { + if (is_null($author)) { + throw new \InvalidArgumentException('non-nullable author cannot be null'); + } + $this->container['author'] = $author; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/QuestionIdentifiersDTO.php b/erp24/lib/yandex_market_api/Model/QuestionIdentifiersDTO.php new file mode 100644 index 00000000..f1561f6a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/QuestionIdentifiersDTO.php @@ -0,0 +1,524 @@ + + */ +class QuestionIdentifiersDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuestionIdentifiersDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'category_id' => 'int', + 'offer_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'category_id' => 'int64', + 'offer_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'category_id' => false, + 'offer_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'category_id' => 'categoryId', + 'offer_id' => 'offerId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'category_id' => 'setCategoryId', + 'offer_id' => 'setOfferId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'category_id' => 'getCategoryId', + 'offer_id' => 'getOfferId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('category_id', $data ?? [], null); + $this->setIfExists('offer_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['category_id']) && ($this->container['category_id'] < 0)) { + $invalidProperties[] = "invalid value for 'category_id', must be bigger than or equal to 0."; + } + + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор вопроса. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling QuestionIdentifiersDTO., must be bigger than or equal to 1.'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets category_id + * + * @return int|null + */ + public function getCategoryId() + { + return $this->container['category_id']; + } + + /** + * Sets category_id + * + * @param int|null $category_id Идентификатор категории. + * + * @return self + */ + public function setCategoryId($category_id) + { + if (is_null($category_id)) { + throw new \InvalidArgumentException('non-nullable category_id cannot be null'); + } + + if (($category_id < 0)) { + throw new \InvalidArgumentException('invalid value for $category_id when calling QuestionIdentifiersDTO., must be bigger than or equal to 0.'); + } + + $this->container['category_id'] = $category_id; + + return $this; + } + + /** + * Gets offer_id + * + * @return string + */ + public function getOfferId() + { + return $this->container['offer_id']; + } + + /** + * Sets offer_id + * + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * + * @return self + */ + public function setOfferId($offer_id) + { + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); + } + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling QuestionIdentifiersDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling QuestionIdentifiersDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling QuestionIdentifiersDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/QuestionListDTO.php b/erp24/lib/yandex_market_api/Model/QuestionListDTO.php new file mode 100644 index 00000000..17af349b --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/QuestionListDTO.php @@ -0,0 +1,484 @@ + + */ +class QuestionListDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuestionListDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'questions' => '\OpenAPI\Client\Model\QuestionDTO[]', + 'paging' => '\OpenAPI\Client\Model\ForwardScrollingPagerDTO', + 'total_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'questions' => null, + 'paging' => null, + 'total_count' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'questions' => false, + 'paging' => false, + 'total_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'questions' => 'questions', + 'paging' => 'paging', + 'total_count' => 'totalCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'questions' => 'setQuestions', + 'paging' => 'setPaging', + 'total_count' => 'setTotalCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'questions' => 'getQuestions', + 'paging' => 'getPaging', + 'total_count' => 'getTotalCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('questions', $data ?? [], null); + $this->setIfExists('paging', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['questions'] === null) { + $invalidProperties[] = "'questions' can't be null"; + } + if ($this->container['total_count'] === null) { + $invalidProperties[] = "'total_count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets questions + * + * @return \OpenAPI\Client\Model\QuestionDTO[] + */ + public function getQuestions() + { + return $this->container['questions']; + } + + /** + * Sets questions + * + * @param \OpenAPI\Client\Model\QuestionDTO[] $questions Список вопросов. + * + * @return self + */ + public function setQuestions($questions) + { + if (is_null($questions)) { + throw new \InvalidArgumentException('non-nullable questions cannot be null'); + } + $this->container['questions'] = $questions; + + return $this; + } + + /** + * Gets paging + * + * @return \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \OpenAPI\Client\Model\ForwardScrollingPagerDTO|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + + /** + * Gets total_count + * + * @return int + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int $total_count Общее количество вопросов, которые попадают под фильтр. + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/QuestionSortOrderType.php b/erp24/lib/yandex_market_api/Model/QuestionSortOrderType.php new file mode 100644 index 00000000..ba827d3d --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/QuestionSortOrderType.php @@ -0,0 +1,63 @@ + + */ +class QuestionsTextContentAuthorDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuestionsTextContentAuthorDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\OpenAPI\Client\Model\QuestionsTextContentAuthorType', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\QuestionsTextContentAuthorType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\QuestionsTextContentAuthorType|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Имя автора или название кабинета. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/QuestionsTextContentAuthorType.php b/erp24/lib/yandex_market_api/Model/QuestionsTextContentAuthorType.php new file mode 100644 index 00000000..7bc85a6c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/QuestionsTextContentAuthorType.php @@ -0,0 +1,69 @@ + 'int', 'name' => 'string', 'type' => '\OpenAPI\Client\Model\RegionType', - 'parent' => '\OpenAPI\Client\Model\RegionDTO', - 'children' => '\OpenAPI\Client\Model\RegionDTO[]' + 'parent' => '\OpenAPI\Client\Model\RegionDTO' ]; /** @@ -76,8 +75,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'int64', 'name' => null, 'type' => null, - 'parent' => null, - 'children' => null + 'parent' => null ]; /** @@ -89,8 +87,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'name' => false, 'type' => false, - 'parent' => false, - 'children' => true + 'parent' => false ]; /** @@ -182,8 +179,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'id', 'name' => 'name', 'type' => 'type', - 'parent' => 'parent', - 'children' => 'children' + 'parent' => 'parent' ]; /** @@ -195,8 +191,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'setId', 'name' => 'setName', 'type' => 'setType', - 'parent' => 'setParent', - 'children' => 'setChildren' + 'parent' => 'setParent' ]; /** @@ -208,8 +203,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'getId', 'name' => 'getName', 'type' => 'getType', - 'parent' => 'getParent', - 'children' => 'getChildren' + 'parent' => 'getParent' ]; /** @@ -264,16 +258,15 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); $this->setIfExists('parent', $data ?? [], null); - $this->setIfExists('children', $data ?? [], null); } /** @@ -303,6 +296,9 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } @@ -327,7 +323,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets id * - * @return int|null + * @return int */ public function getId() { @@ -337,7 +333,7 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int|null $id Идентификатор региона. + * @param int $id Идентификатор региона. * * @return self */ @@ -431,48 +427,14 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } - - /** - * Gets children - * - * @return \OpenAPI\Client\Model\RegionDTO[]|null - */ - public function getChildren() - { - return $this->container['children']; - } - - /** - * Sets children - * - * @param \OpenAPI\Client\Model\RegionDTO[]|null $children Дочерние регионы. - * - * @return self - */ - public function setChildren($children) - { - if (is_null($children)) { - array_push($this->openAPINullablesSetToNull, 'children'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('children', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['children'] = $children; - - return $this; - } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -480,12 +442,12 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -510,11 +472,11 @@ class RegionDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/RegionType.php b/erp24/lib/yandex_market_api/Model/RegionType.php index 0d1b5c90..d568a99c 100644 --- a/erp24/lib/yandex_market_api/Model/RegionType.php +++ b/erp24/lib/yandex_market_api/Model/RegionType.php @@ -2,7 +2,7 @@ /** * RegionType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/RegionWithChildrenDTO.php b/erp24/lib/yandex_market_api/Model/RegionWithChildrenDTO.php new file mode 100644 index 00000000..402bf2e6 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/RegionWithChildrenDTO.php @@ -0,0 +1,571 @@ + + */ +class RegionWithChildrenDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RegionWithChildrenDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'type' => '\OpenAPI\Client\Model\RegionType', + 'parent' => '\OpenAPI\Client\Model\RegionDTO', + 'children' => '\OpenAPI\Client\Model\RegionDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'name' => null, + 'type' => null, + 'parent' => null, + 'children' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'type' => false, + 'parent' => false, + 'children' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'type' => 'type', + 'parent' => 'parent', + 'children' => 'children' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'type' => 'setType', + 'parent' => 'setParent', + 'children' => 'setChildren' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'type' => 'getType', + 'parent' => 'getParent', + 'children' => 'getChildren' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('parent', $data ?? [], null); + $this->setIfExists('children', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if (!is_null($this->container['children']) && (count($this->container['children']) < 1)) { + $invalidProperties[] = "invalid value for 'children', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор региона. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Название региона. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\RegionType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\RegionType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets parent + * + * @return \OpenAPI\Client\Model\RegionDTO|null + */ + public function getParent() + { + return $this->container['parent']; + } + + /** + * Sets parent + * + * @param \OpenAPI\Client\Model\RegionDTO|null $parent parent + * + * @return self + */ + public function setParent($parent) + { + if (is_null($parent)) { + throw new \InvalidArgumentException('non-nullable parent cannot be null'); + } + $this->container['parent'] = $parent; + + return $this; + } + + /** + * Gets children + * + * @return \OpenAPI\Client\Model\RegionDTO[]|null + */ + public function getChildren() + { + return $this->container['children']; + } + + /** + * Sets children + * + * @param \OpenAPI\Client\Model\RegionDTO[]|null $children Дочерние регионы. + * + * @return self + */ + public function setChildren($children) + { + if (is_null($children)) { + array_push($this->openAPINullablesSetToNull, 'children'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('children', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($children) && (count($children) < 1)) { + throw new \InvalidArgumentException('invalid length for $children when calling RegionWithChildrenDTO., number of items must be greater than or equal to 1.'); + } + $this->container['children'] = $children; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteDTO.php b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteDTO.php index cc7edcfc..a597eec3 100644 --- a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteDTO.php +++ b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteDTO.php @@ -2,7 +2,7 @@ /** * RejectedPromoOfferDeleteDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); @@ -293,8 +293,8 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['reason'] === null) { @@ -328,7 +328,7 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -343,8 +343,8 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling RejectedPromoOfferDeleteDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling RejectedPromoOfferDeleteDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling RejectedPromoOfferDeleteDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -381,11 +381,11 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -393,12 +393,12 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -423,11 +423,11 @@ class RejectedPromoOfferDeleteDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteReasonType.php b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteReasonType.php index cd9bc7b2..6ef1382a 100644 --- a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteReasonType.php +++ b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferDeleteReasonType.php @@ -2,7 +2,7 @@ /** * RejectedPromoOfferDeleteReasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateDTO.php b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateDTO.php index d6758936..ec7f6f18 100644 --- a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateDTO.php +++ b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateDTO.php @@ -2,7 +2,7 @@ /** * RejectedPromoOfferUpdateDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); @@ -293,8 +293,8 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['reason'] === null) { @@ -328,7 +328,7 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -343,8 +343,8 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling RejectedPromoOfferUpdateDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling RejectedPromoOfferUpdateDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling RejectedPromoOfferUpdateDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -381,11 +381,11 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -393,12 +393,12 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -423,11 +423,11 @@ class RejectedPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateReasonType.php b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateReasonType.php index 422de895..f02ec63b 100644 --- a/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateReasonType.php +++ b/erp24/lib/yandex_market_api/Model/RejectedPromoOfferUpdateReasonType.php @@ -2,7 +2,7 @@ /** * RejectedPromoOfferUpdateReasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * RejectedPromoOfferUpdateReasonType Class Doc Comment * * @category Class - * @description Причина отклонения изменения: * `OFFER_DOES_NOT_EXIST` — в кабинете нет товара с таким SKU. * `OFFER_DUPLICATION` — один и тот же товар передан несколько раз. * `OFFER_NOT_ELIGIBLE_FOR_PROMO` — товар не подходит под условия акции. * `OFFER_PROMOS_MAX_BYTE_SIZE_EXCEEDED` — товар не добавлен в акцию по техническим причинам. * `DEADLINE_FOR_FOCUS_PROMOS_EXCEEDED` — истек срок добавления товаров в акцию. * `EMPTY_OLD_PRICE` — не указана зачеркнутая цена. * `EMPTY_PROMO_PRICE` — не указана цена по акции. * `MAX_PROMO_PRICE_EXCEEDED` — цена по акции превышает максимально возможную цену для участия в акции. * `PROMO_PRICE_BIGGER_THAN_MAX` — цена по акции больше 95% от зачеркнутой цены. * `PROMO_PRICE_SMALLER_THAN_MIN` — цена по акции меньше 1% от зачеркнутой цены. + * @description Причина отклонения изменения: * `OFFER_DOES_NOT_EXIST` — в кабинете нет товара с таким SKU. * `OFFER_DUPLICATION` — один и тот же товар передан несколько раз. * `OFFER_NOT_ELIGIBLE_FOR_PROMO` — товар не подходит под условия акции. * `OFFER_PROMOS_MAX_BYTE_SIZE_EXCEEDED` — товар не добавлен в акцию по техническим причинам. * `DEADLINE_FOR_FOCUS_PROMOS_EXCEEDED` — истек срок добавления товаров в акцию. * `EMPTY_OLD_PRICE` — не указана зачеркнутая цена. * `EMPTY_PROMO_PRICE` — не указана цена по акции. * `MAX_PROMO_PRICE_EXCEEDED` — цена по акции превышает максимально возможную цену для участия в акции. * `PROMO_PRICE_BIGGER_THAN_MAX` — цена по акции больше 95% от зачеркнутой цены. * `PROMO_PRICE_SMALLER_THAN_MIN` — цена по акции меньше 1% от зачеркнутой цены. * `PRICE_TOO_BIG` — слишком большая цена по акции. * `OLD_PRICE_TOO_BIG` — слишком большая зачеркнутая цена. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -63,6 +63,10 @@ class RejectedPromoOfferUpdateReasonType public const PROMO_PRICE_SMALLER_THAN_MIN = 'PROMO_PRICE_SMALLER_THAN_MIN'; + public const PRICE_TOO_BIG = 'PRICE_TOO_BIG'; + + public const OLD_PRICE_TOO_BIG = 'OLD_PRICE_TOO_BIG'; + /** * Gets allowable values of the enum * @return string[] @@ -79,7 +83,9 @@ class RejectedPromoOfferUpdateReasonType self::EMPTY_PROMO_PRICE, self::MAX_PROMO_PRICE_EXCEEDED, self::PROMO_PRICE_BIGGER_THAN_MAX, - self::PROMO_PRICE_SMALLER_THAN_MIN + self::PROMO_PRICE_SMALLER_THAN_MIN, + self::PRICE_TOO_BIG, + self::OLD_PRICE_TOO_BIG ]; } } diff --git a/erp24/lib/yandex_market_api/Model/ReportFormatType.php b/erp24/lib/yandex_market_api/Model/ReportFormatType.php index 960b8a3d..38379703 100644 --- a/erp24/lib/yandex_market_api/Model/ReportFormatType.php +++ b/erp24/lib/yandex_market_api/Model/ReportFormatType.php @@ -2,7 +2,7 @@ /** * ReportFormatType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReportFormatType Class Doc Comment * * @category Class - * @description Формат отчета: * `FILE` — файл с электронной таблицей. * `CSV` — ZIP-архив с CSV-файлами на каждый лист отчета. + * @description Формат отчета: * `FILE` — файл с электронной таблицей (:no-translate[XLSX]). * `CSV` — ZIP-архив с CSV-файлами на каждый лист отчета. * `JSON` — ZIP-архив с JSON-файлами на каждый лист отчета. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -47,6 +47,8 @@ class ReportFormatType public const CSV = 'CSV'; + public const JSON = 'JSON'; + /** * Gets allowable values of the enum * @return string[] @@ -55,7 +57,8 @@ class ReportFormatType { return [ self::FILE, - self::CSV + self::CSV, + self::JSON ]; } } diff --git a/erp24/lib/yandex_market_api/Model/ReportInfoDTO.php b/erp24/lib/yandex_market_api/Model/ReportInfoDTO.php index a97d5f1d..3ddeffe2 100644 --- a/erp24/lib/yandex_market_api/Model/ReportInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/ReportInfoDTO.php @@ -2,7 +2,7 @@ /** * ReportInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReportInfoDTO Class Doc Comment * * @category Class - * @description Статус генерации и ссылка на готовый отчет. + * @description Статус генерации и ссылка на готовый отчет или документ. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -270,10 +270,10 @@ class ReportInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('sub_status', $data ?? [], null); @@ -452,7 +452,7 @@ class ReportInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets file * - * @param string|null $file Ссылка на готовый отчет. + * @param string|null $file Ссылка на готовый отчет или документ. {% note warning \"Срок действия ссылки\" %} Ссылка актуальна **60 минут** с момента получения ответа. При каждом запросе `GET /v2/reports/info/{reportId}` генерируется новая ссылка, срок действия которой ограничен. **Рекомендация для интеграций:** сразу после получения ссылки скачайте отчет и сохраните его у себя. Не сохраняйте ссылку для последующего использования — она станет недействительной через после истечения срока действия. {% endnote %} * * @return self */ @@ -495,11 +495,11 @@ class ReportInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -507,12 +507,12 @@ class ReportInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -537,11 +537,11 @@ class ReportInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ReportLanguageType.php b/erp24/lib/yandex_market_api/Model/ReportLanguageType.php new file mode 100644 index 00000000..89a94c26 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ReportLanguageType.php @@ -0,0 +1,63 @@ + '\DateTime', 'refund_status' => '\OpenAPI\Client\Model\RefundStatusType', 'logistic_pickup_point' => '\OpenAPI\Client\Model\LogisticPickupPointDTO', + 'pickup_till_date' => '\DateTime', 'shipment_recipient_type' => '\OpenAPI\Client\Model\RecipientType', 'shipment_status' => '\OpenAPI\Client\Model\ReturnShipmentStatusType', 'refund_amount' => 'int', + 'amount' => '\OpenAPI\Client\Model\CurrencyValueDTO', 'items' => '\OpenAPI\Client\Model\ReturnItemDTO[]', 'return_type' => '\OpenAPI\Client\Model\ReturnType', 'fast_return' => 'bool' @@ -86,9 +88,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'update_date' => 'date-time', 'refund_status' => null, 'logistic_pickup_point' => null, + 'pickup_till_date' => 'date-time', 'shipment_recipient_type' => null, 'shipment_status' => null, 'refund_amount' => 'int64', + 'amount' => null, 'items' => null, 'return_type' => null, 'fast_return' => null @@ -106,9 +110,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'update_date' => false, 'refund_status' => false, 'logistic_pickup_point' => false, + 'pickup_till_date' => false, 'shipment_recipient_type' => false, 'shipment_status' => false, 'refund_amount' => false, + 'amount' => false, 'items' => false, 'return_type' => false, 'fast_return' => false @@ -206,9 +212,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'update_date' => 'updateDate', 'refund_status' => 'refundStatus', 'logistic_pickup_point' => 'logisticPickupPoint', + 'pickup_till_date' => 'pickupTillDate', 'shipment_recipient_type' => 'shipmentRecipientType', 'shipment_status' => 'shipmentStatus', 'refund_amount' => 'refundAmount', + 'amount' => 'amount', 'items' => 'items', 'return_type' => 'returnType', 'fast_return' => 'fastReturn' @@ -226,9 +234,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'update_date' => 'setUpdateDate', 'refund_status' => 'setRefundStatus', 'logistic_pickup_point' => 'setLogisticPickupPoint', + 'pickup_till_date' => 'setPickupTillDate', 'shipment_recipient_type' => 'setShipmentRecipientType', 'shipment_status' => 'setShipmentStatus', 'refund_amount' => 'setRefundAmount', + 'amount' => 'setAmount', 'items' => 'setItems', 'return_type' => 'setReturnType', 'fast_return' => 'setFastReturn' @@ -246,9 +256,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'update_date' => 'getUpdateDate', 'refund_status' => 'getRefundStatus', 'logistic_pickup_point' => 'getLogisticPickupPoint', + 'pickup_till_date' => 'getPickupTillDate', 'shipment_recipient_type' => 'getShipmentRecipientType', 'shipment_status' => 'getShipmentStatus', 'refund_amount' => 'getRefundAmount', + 'amount' => 'getAmount', 'items' => 'getItems', 'return_type' => 'getReturnType', 'fast_return' => 'getFastReturn' @@ -306,10 +318,10 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('order_id', $data ?? [], null); @@ -317,9 +329,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('update_date', $data ?? [], null); $this->setIfExists('refund_status', $data ?? [], null); $this->setIfExists('logistic_pickup_point', $data ?? [], null); + $this->setIfExists('pickup_till_date', $data ?? [], null); $this->setIfExists('shipment_recipient_type', $data ?? [], null); $this->setIfExists('shipment_status', $data ?? [], null); $this->setIfExists('refund_amount', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('items', $data ?? [], null); $this->setIfExists('return_type', $data ?? [], null); $this->setIfExists('fast_return', $data ?? [], null); @@ -392,7 +406,7 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets id * - * @param int $id Идентификатор возврата. + * @param int $id Идентификатор невыкупа или возврата. * * @return self */ @@ -446,7 +460,7 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets creation_date * - * @param \DateTime|null $creation_date Дата создания возврата клиентом. Формат даты: ISO 8601 со смещением относительно UTC. + * @param \DateTime|null $creation_date Дата создания невыкупа или возврата. Формат даты: ISO 8601 со смещением относительно UTC. * * @return self */ @@ -473,7 +487,7 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets update_date * - * @param \DateTime|null $update_date Дата обновления возврата. Формат даты: ISO 8601 со смещением относительно UTC. + * @param \DateTime|null $update_date Дата обновления невыкупа или возврата. Формат даты: ISO 8601 со смещением относительно UTC. * * @return self */ @@ -541,6 +555,33 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets pickup_till_date + * + * @return \DateTime|null + */ + public function getPickupTillDate() + { + return $this->container['pickup_till_date']; + } + + /** + * Sets pickup_till_date + * + * @param \DateTime|null $pickup_till_date Дата, до которой можно забрать товар. Только для невыкупов и возвратов в логистическом статусе `READY_FOR_PICKUP`. Формат даты: ISO 8601 со смещением относительно UTC. + * + * @return self + */ + public function setPickupTillDate($pickup_till_date) + { + if (is_null($pickup_till_date)) { + throw new \InvalidArgumentException('non-nullable pickup_till_date cannot be null'); + } + $this->container['pickup_till_date'] = $pickup_till_date; + + return $this; + } + /** * Gets shipment_recipient_type * @@ -599,6 +640,7 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets refund_amount * * @return int|null + * @deprecated */ public function getRefundAmount() { @@ -608,9 +650,10 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets refund_amount * - * @param int|null $refund_amount Сумма возврата. + * @param int|null $refund_amount {% note warning \"Вместо него используйте `amount`.\" %}   {% endnote %} Сумма возврата в копейках. * * @return self + * @deprecated */ public function setRefundAmount($refund_amount) { @@ -622,6 +665,33 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets amount + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** * Gets items * @@ -635,7 +705,7 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets items * - * @param \OpenAPI\Client\Model\ReturnItemDTO[] $items Список товаров в возврате. + * @param \OpenAPI\Client\Model\ReturnItemDTO[] $items Список товаров в невыкупе или возврате. * * @return self */ @@ -689,7 +759,7 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets fast_return * - * @param bool|null $fast_return Используется ли опция **Быстрый возврат денег за дешевый брак**. + * @param bool|null $fast_return Используется ли опция **Быстрый возврат денег за дешевый брак**. Актуально только для `returnType=RETURN`. * * @return self */ @@ -705,11 +775,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -717,12 +787,12 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -747,11 +817,11 @@ class ReturnDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ReturnDecisionDTO.php b/erp24/lib/yandex_market_api/Model/ReturnDecisionDTO.php index 50bc63af..27f3b27b 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnDecisionDTO.php +++ b/erp24/lib/yandex_market_api/Model/ReturnDecisionDTO.php @@ -2,7 +2,7 @@ /** * ReturnDecisionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -65,7 +65,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'subreason_type' => '\OpenAPI\Client\Model\ReturnDecisionSubreasonType', 'decision_type' => '\OpenAPI\Client\Model\ReturnDecisionType', 'refund_amount' => 'int', + 'amount' => '\OpenAPI\Client\Model\CurrencyValueDTO', 'partner_compensation' => 'int', + 'partner_compensation_amount' => '\OpenAPI\Client\Model\CurrencyValueDTO', 'images' => 'string[]' ]; @@ -84,7 +86,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'subreason_type' => null, 'decision_type' => null, 'refund_amount' => 'int64', + 'amount' => null, 'partner_compensation' => 'int64', + 'partner_compensation_amount' => null, 'images' => null ]; @@ -101,7 +105,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'subreason_type' => false, 'decision_type' => false, 'refund_amount' => false, + 'amount' => false, 'partner_compensation' => false, + 'partner_compensation_amount' => false, 'images' => true ]; @@ -198,7 +204,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'subreason_type' => 'subreasonType', 'decision_type' => 'decisionType', 'refund_amount' => 'refundAmount', + 'amount' => 'amount', 'partner_compensation' => 'partnerCompensation', + 'partner_compensation_amount' => 'partnerCompensationAmount', 'images' => 'images' ]; @@ -215,7 +223,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'subreason_type' => 'setSubreasonType', 'decision_type' => 'setDecisionType', 'refund_amount' => 'setRefundAmount', + 'amount' => 'setAmount', 'partner_compensation' => 'setPartnerCompensation', + 'partner_compensation_amount' => 'setPartnerCompensationAmount', 'images' => 'setImages' ]; @@ -232,7 +242,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl 'subreason_type' => 'getSubreasonType', 'decision_type' => 'getDecisionType', 'refund_amount' => 'getRefundAmount', + 'amount' => 'getAmount', 'partner_compensation' => 'getPartnerCompensation', + 'partner_compensation_amount' => 'getPartnerCompensationAmount', 'images' => 'getImages' ]; @@ -288,10 +300,10 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('return_item_id', $data ?? [], null); $this->setIfExists('count', $data ?? [], null); @@ -300,7 +312,9 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $this->setIfExists('subreason_type', $data ?? [], null); $this->setIfExists('decision_type', $data ?? [], null); $this->setIfExists('refund_amount', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('partner_compensation', $data ?? [], null); + $this->setIfExists('partner_compensation_amount', $data ?? [], null); $this->setIfExists('images', $data ?? [], null); } @@ -331,6 +345,10 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl { $invalidProperties = []; + if (!is_null($this->container['images']) && (count($this->container['images']) < 1)) { + $invalidProperties[] = "invalid value for 'images', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -512,6 +530,7 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl * Gets refund_amount * * @return int|null + * @deprecated */ public function getRefundAmount() { @@ -521,9 +540,10 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets refund_amount * - * @param int|null $refund_amount Сумма возврата. + * @param int|null $refund_amount {% note warning \"Вместо него используйте `amount`.\" %}   {% endnote %} Сумма возврата в копейках. * * @return self + * @deprecated */ public function setRefundAmount($refund_amount) { @@ -535,10 +555,38 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl return $this; } + /** + * Gets amount + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + /** * Gets partner_compensation * * @return int|null + * @deprecated */ public function getPartnerCompensation() { @@ -548,9 +596,10 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets partner_compensation * - * @param int|null $partner_compensation Компенсация за обратную доставку. + * @param int|null $partner_compensation {% note warning \"Вместо него используйте `partnerCompensationAmount`.\" %}   {% endnote %} Компенсация за обратную доставку в копейках. * * @return self + * @deprecated */ public function setPartnerCompensation($partner_compensation) { @@ -562,6 +611,33 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl return $this; } + /** + * Gets partner_compensation_amount + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getPartnerCompensationAmount() + { + return $this->container['partner_compensation_amount']; + } + + /** + * Sets partner_compensation_amount + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $partner_compensation_amount partner_compensation_amount + * + * @return self + */ + public function setPartnerCompensationAmount($partner_compensation_amount) + { + if (is_null($partner_compensation_amount)) { + throw new \InvalidArgumentException('non-nullable partner_compensation_amount cannot be null'); + } + $this->container['partner_compensation_amount'] = $partner_compensation_amount; + + return $this; + } + /** * Gets images * @@ -591,6 +667,11 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($images) && (count($images) < 1)) { + throw new \InvalidArgumentException('invalid length for $images when calling ReturnDecisionDTO., number of items must be greater than or equal to 1.'); + } $this->container['images'] = $images; return $this; @@ -598,11 +679,11 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -610,12 +691,12 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -640,11 +721,11 @@ class ReturnDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ReturnDecisionReasonType.php b/erp24/lib/yandex_market_api/Model/ReturnDecisionReasonType.php index 4d7161b0..bfe2d882 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnDecisionReasonType.php +++ b/erp24/lib/yandex_market_api/Model/ReturnDecisionReasonType.php @@ -2,7 +2,7 @@ /** * ReturnDecisionReasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReturnDecisionReasonType Class Doc Comment * * @category Class - * @description Причины возврата: * `BAD_QUALITY` — бракованный товар (есть недостатки). * `DO_NOT_FIT` — товар не подошел. * `WRONG_ITEM` — привезли не тот товар. * `DAMAGE_DELIVERY` — товар поврежден при доставке. * `LOYALTY_FAIL` — невозможно установить виновного в браке/пересорте. * `CONTENT_FAIL` — ошибочное описание товара по вине Маркета. * `UNKNOWN` — причина не известна. + * @description Причины возврата: * `BAD_QUALITY` — бракованный товар (есть недостатки). * `DOES_NOT_FIT` — товар не подошел. * `WRONG_ITEM` — привезли не тот товар. * `DAMAGE_DELIVERY` — товар поврежден при доставке. * `LOYALTY_FAIL` — невозможно установить виновного в браке/пересорте. * `CONTENT_FAIL` — ошибочное описание товара по вине Маркета. * `DELIVERY_FAIL` — товар не привезли. * `UNKNOWN` — причина не известна. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -55,6 +55,8 @@ class ReturnDecisionReasonType public const CONTENT_FAIL = 'CONTENT_FAIL'; + public const DELIVERY_FAIL = 'DELIVERY_FAIL'; + public const UNKNOWN = 'UNKNOWN'; /** @@ -70,6 +72,7 @@ class ReturnDecisionReasonType self::DAMAGE_DELIVERY, self::LOYALTY_FAIL, self::CONTENT_FAIL, + self::DELIVERY_FAIL, self::UNKNOWN ]; } diff --git a/erp24/lib/yandex_market_api/Model/ReturnDecisionSubreasonType.php b/erp24/lib/yandex_market_api/Model/ReturnDecisionSubreasonType.php index c3c729ce..32ed4a0c 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnDecisionSubreasonType.php +++ b/erp24/lib/yandex_market_api/Model/ReturnDecisionSubreasonType.php @@ -2,7 +2,7 @@ /** * ReturnDecisionSubreasonType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReturnDecisionSubreasonType Class Doc Comment * * @category Class - * @description Детали причин возврата: * `DO_NOT_FIT`: * `USER_DID_NOT_LIKE` — товар не понравился. * `USER_CHANGED_MIND` — передумал покупать. * `DELIVERED_TOO_LONG` — длительный срок доставки, поэтому передумал. * `BAD_QUALITY`: * `BAD_PACKAGE` — упаковка товара была нарушена. * `DAMAGED` — царапины, сколы. * `NOT_WORKING` — не включается / не работает. * `INCOMPLETENESS` — некомплект (не хватает детали в наборе, к товару). * `WRONG_ITEM`: * `WRONG_ITEM` — не тот товар. * `WRONG_COLOR` — не соответствует по цвету. * `DID_NOT_MATCH_DESCRIPTION` — не соответствует заявленным характеристикам/описанию. + * @description Детали причин возврата: * `DOES_NOT_FIT`: * `USER_DID_NOT_LIKE` — товар не понравился. * `USER_CHANGED_MIND` — передумал покупать. * `DELIVERED_TOO_LONG` — передумал покупать из-за длительного срока доставки. * `BAD_QUALITY`: * `BAD_PACKAGE` — заводская упаковка повреждена. * `DAMAGED` — царапины, сколы. * `NOT_WORKING` — не включается, не работает. * `INCOMPLETENESS` — некомплект (не хватает детали в наборе, к товару). * `WRAPPING_DAMAGED` — транспортная упаковка повреждена. * `ITEM_WAS_USED` — следы использования на товаре. * `BROKEN` — товар разбит. * `BAD_FLOWERS` — некачественные цветы. * `WRONG_ITEM`: * `WRONG_ITEM` — не тот товар. * `WRONG_COLOR` — цвет не соответствует заявленному. * `DID_NOT_MATCH_DESCRIPTION` — описание или характеристики не соответствуют заявленным. * `WRONG_ORDER` — доставили чужой заказ. * `WRONG_AMOUNT_DELIVERED` — неверное количество товара. * `PARCEL_MISSING` — часть заказа отсутствует. * `INCOMPLETE` — заказ не привезли полностью. * `UNKNOWN` — детали причины не указаны. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -63,6 +63,22 @@ class ReturnDecisionSubreasonType public const DID_NOT_MATCH_DESCRIPTION = 'DID_NOT_MATCH_DESCRIPTION'; + public const WRONG_ORDER = 'WRONG_ORDER'; + + public const WRONG_AMOUNT_DELIVERED = 'WRONG_AMOUNT_DELIVERED'; + + public const WRAPPING_DAMAGED = 'WRAPPING_DAMAGED'; + + public const ITEM_WAS_USED = 'ITEM_WAS_USED'; + + public const BROKEN = 'BROKEN'; + + public const BAD_FLOWERS = 'BAD_FLOWERS'; + + public const PARCEL_MISSING = 'PARCEL_MISSING'; + + public const INCOMPLETE = 'INCOMPLETE'; + public const UNKNOWN = 'UNKNOWN'; /** @@ -82,6 +98,14 @@ class ReturnDecisionSubreasonType self::WRONG_ITEM, self::WRONG_COLOR, self::DID_NOT_MATCH_DESCRIPTION, + self::WRONG_ORDER, + self::WRONG_AMOUNT_DELIVERED, + self::WRAPPING_DAMAGED, + self::ITEM_WAS_USED, + self::BROKEN, + self::BAD_FLOWERS, + self::PARCEL_MISSING, + self::INCOMPLETE, self::UNKNOWN ]; } diff --git a/erp24/lib/yandex_market_api/Model/ReturnDecisionType.php b/erp24/lib/yandex_market_api/Model/ReturnDecisionType.php index ce723538..1bbb50a4 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnDecisionType.php +++ b/erp24/lib/yandex_market_api/Model/ReturnDecisionType.php @@ -2,7 +2,7 @@ /** * ReturnDecisionType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReturnDecisionType Class Doc Comment * * @category Class - * @description Решение по возврату: * `REFUND_MONEY` — вернуть деньги покупателю. * `REFUND_MONEY_INCLUDING_SHIPMENT` — вернуть деньги за товар и пересылку. * `REPAIR` — отремонтировать товар. * `REPLACE` — заменить товар. * `SEND_TO_EXAMINATION` — взять товар на экспертизу. * `DECLINE_REFUND` — отказать в возврате. * `OTHER_DECISION` — другое решение. + * @description Решение по возврату: * `FAST_REFUND_MONEY` — вернуть покупателю деньги без возврата товара. * `REFUND_MONEY` — вернуть покупателю деньги за товар. * `REFUND_MONEY_INCLUDING_SHIPMENT` — вернуть покупателю деньги за товар и обратную пересылку. * `REPAIR` — отремонтировать товар. * `REPLACE` — заменить товар. * `SEND_TO_EXAMINATION` — взять товар на экспертизу. * `DECLINE_REFUND` — отказать в возврате. * `OTHER_DECISION` — другое решение. * `UNKNOWN` — не указано. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -43,6 +43,8 @@ class ReturnDecisionType /** * Possible values of this enum */ + public const FAST_REFUND_MONEY = 'FAST_REFUND_MONEY'; + public const REFUND_MONEY = 'REFUND_MONEY'; public const REFUND_MONEY_INCLUDING_SHIPMENT = 'REFUND_MONEY_INCLUDING_SHIPMENT'; @@ -66,6 +68,7 @@ class ReturnDecisionType public static function getAllowableEnumValues() { return [ + self::FAST_REFUND_MONEY, self::REFUND_MONEY, self::REFUND_MONEY_INCLUDING_SHIPMENT, self::REPAIR, diff --git a/erp24/lib/yandex_market_api/Model/ReturnInstanceDTO.php b/erp24/lib/yandex_market_api/Model/ReturnInstanceDTO.php index 86c56578..d0f7e4f2 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnInstanceDTO.php +++ b/erp24/lib/yandex_market_api/Model/ReturnInstanceDTO.php @@ -2,7 +2,7 @@ /** * ReturnInstanceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class ReturnInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('stock_type', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -378,7 +378,7 @@ class ReturnInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets cis * - * @param string|null $cis Код идентификации единицы товара [в системе «Честный ЗНАК»](https://честныйзнак.рф/). + * @param string|null $cis Код идентификации единицы товара в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]). * * @return self */ @@ -421,11 +421,11 @@ class ReturnInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ class ReturnInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ class ReturnInstanceDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ReturnInstanceStatusType.php b/erp24/lib/yandex_market_api/Model/ReturnInstanceStatusType.php index f4d83ebf..b6fb5572 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnInstanceStatusType.php +++ b/erp24/lib/yandex_market_api/Model/ReturnInstanceStatusType.php @@ -2,7 +2,7 @@ /** * ReturnInstanceStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReturnInstanceStatusType Class Doc Comment * * @category Class - * @description Логистический статус конкретного товара. + * @description Логистический статус конкретного товара: * `CREATED` — возврат создан. * `RECEIVED` — возврат принят у отправителя. * `IN_TRANSIT` — возврат в пути. * `READY_FOR_PICKUP` — возврат готов к выдаче магазину. * `PICKED` — возврат выдан магазину. * `RECEIVED_ON_FULFILLMENT` — возврат принят на складе Маркета. * `CANCELLED` — возврат отменен. * `LOST` — возврат утерян. * `UTILIZED` — возврат утилизирован. * `PREPARED_FOR_UTILIZATION` — возврат готов к утилизации. * `EXPROPRIATED` — товары в возврате направлены на перепродажу. * `NOT_IN_DEMAND` — возврат не забрали с почты. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/ReturnInstanceStockType.php b/erp24/lib/yandex_market_api/Model/ReturnInstanceStockType.php index 7365a75b..a3e528cd 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnInstanceStockType.php +++ b/erp24/lib/yandex_market_api/Model/ReturnInstanceStockType.php @@ -2,7 +2,7 @@ /** * ReturnInstanceStockType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReturnInstanceStockType Class Doc Comment * * @category Class - * @description Тип остатка на складе. + * @description Тип остатка на складе: * `FIT` — годный. * `DEFECT` — бракованный. * `ANOMALY` — аномалия. * `SURPLUS` — лишний. * `EXPIRED` — просроченный. * `MISGRADING` — пересортица. * `UNDEFINED` — с неизвестным статусом. * `INCORRECT_IMEI` — товар с некорректным [:no-translate[IMEI]](https://ru.wikipedia.org/wiki/IMEI). * `INCORRECT_SERIAL_NUMBER` — товар с некорректным серийным номером. * `INCORRECT_CIS` — товар с некорректным кодом идентификации единицы товара в системе [:no-translate[«Честный ЗНАК»]](https://честныйзнак.рф/) или [:no-translate[«ASL BELGISI»]](https://aslbelgisi.uz) (для продавцов :no-translate[Market Yandex Go]). * `PART_MISSING` — недостача. * `NON_COMPLIENT` — товар с множественными несоответствиями. * `NOT_ACCEPTABLE` — товар, который Маркет не принимает. * `SERVICE` — сервисный сток. * `MARKDOWN` — уценка. * `DEMO` — демо. * `REPAIR` — ремонт. * `FIRMWARE` — прошивка. * `UNKNOWN` — неизвестный тип товара. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/ReturnItemDTO.php b/erp24/lib/yandex_market_api/Model/ReturnItemDTO.php index 9701b7c4..51a29ade 100644 --- a/erp24/lib/yandex_market_api/Model/ReturnItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/ReturnItemDTO.php @@ -2,7 +2,7 @@ /** * ReturnItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * ReturnItemDTO Class Doc Comment * * @category Class - * @description Список товаров в возврате. + * @description Список товаров в невыкупе или возврате. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -270,10 +270,10 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('market_sku', $data ?? [], null); $this->setIfExists('shop_sku', $data ?? [], null); @@ -325,13 +325,25 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['count'] === null) { $invalidProperties[] = "'count' can't be null"; } + if (!is_null($this->container['decisions']) && (count($this->container['decisions']) < 1)) { + $invalidProperties[] = "invalid value for 'decisions', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['instances']) && (count($this->container['instances']) < 1)) { + $invalidProperties[] = "invalid value for 'instances', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tracks']) && (count($this->container['tracks']) < 1)) { + $invalidProperties[] = "invalid value for 'tracks', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -360,7 +372,7 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -392,7 +404,7 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets shop_sku * - * @param string $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -407,8 +419,8 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling ReturnItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling ReturnItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling ReturnItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -472,6 +484,11 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($decisions) && (count($decisions) < 1)) { + throw new \InvalidArgumentException('invalid length for $decisions when calling ReturnItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['decisions'] = $decisions; return $this; @@ -506,6 +523,11 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($instances) && (count($instances) < 1)) { + throw new \InvalidArgumentException('invalid length for $instances when calling ReturnItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['instances'] = $instances; return $this; @@ -540,6 +562,11 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($tracks) && (count($tracks) < 1)) { + throw new \InvalidArgumentException('invalid length for $tracks when calling ReturnItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['tracks'] = $tracks; return $this; @@ -547,11 +574,11 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -559,12 +586,12 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -589,11 +616,11 @@ class ReturnItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ReturnItemDecisionDTO.php b/erp24/lib/yandex_market_api/Model/ReturnItemDecisionDTO.php new file mode 100644 index 00000000..004b2ec0 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ReturnItemDecisionDTO.php @@ -0,0 +1,518 @@ + + */ +class ReturnItemDecisionDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReturnItemDecisionDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'return_item_id' => 'int', + 'decision_type' => '\OpenAPI\Client\Model\ReturnRequestDecisionType', + 'decision_reason_type' => '\OpenAPI\Client\Model\ReturnRequestDecisionReasonType', + 'comment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'return_item_id' => 'int64', + 'decision_type' => null, + 'decision_reason_type' => null, + 'comment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'return_item_id' => false, + 'decision_type' => false, + 'decision_reason_type' => false, + 'comment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'return_item_id' => 'returnItemId', + 'decision_type' => 'decisionType', + 'decision_reason_type' => 'decisionReasonType', + 'comment' => 'comment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'return_item_id' => 'setReturnItemId', + 'decision_type' => 'setDecisionType', + 'decision_reason_type' => 'setDecisionReasonType', + 'comment' => 'setComment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'return_item_id' => 'getReturnItemId', + 'decision_type' => 'getDecisionType', + 'decision_reason_type' => 'getDecisionReasonType', + 'comment' => 'getComment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('return_item_id', $data ?? [], null); + $this->setIfExists('decision_type', $data ?? [], null); + $this->setIfExists('decision_reason_type', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['return_item_id'] === null) { + $invalidProperties[] = "'return_item_id' can't be null"; + } + if ($this->container['decision_type'] === null) { + $invalidProperties[] = "'decision_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets return_item_id + * + * @return int + */ + public function getReturnItemId() + { + return $this->container['return_item_id']; + } + + /** + * Sets return_item_id + * + * @param int $return_item_id Идентификатор товара в возврате. + * + * @return self + */ + public function setReturnItemId($return_item_id) + { + if (is_null($return_item_id)) { + throw new \InvalidArgumentException('non-nullable return_item_id cannot be null'); + } + $this->container['return_item_id'] = $return_item_id; + + return $this; + } + + /** + * Gets decision_type + * + * @return \OpenAPI\Client\Model\ReturnRequestDecisionType + */ + public function getDecisionType() + { + return $this->container['decision_type']; + } + + /** + * Sets decision_type + * + * @param \OpenAPI\Client\Model\ReturnRequestDecisionType $decision_type decision_type + * + * @return self + */ + public function setDecisionType($decision_type) + { + if (is_null($decision_type)) { + throw new \InvalidArgumentException('non-nullable decision_type cannot be null'); + } + $this->container['decision_type'] = $decision_type; + + return $this; + } + + /** + * Gets decision_reason_type + * + * @return \OpenAPI\Client\Model\ReturnRequestDecisionReasonType|null + */ + public function getDecisionReasonType() + { + return $this->container['decision_reason_type']; + } + + /** + * Sets decision_reason_type + * + * @param \OpenAPI\Client\Model\ReturnRequestDecisionReasonType|null $decision_reason_type decision_reason_type + * + * @return self + */ + public function setDecisionReasonType($decision_reason_type) + { + if (is_null($decision_reason_type)) { + throw new \InvalidArgumentException('non-nullable decision_reason_type cannot be null'); + } + $this->container['decision_reason_type'] = $decision_reason_type; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment Комментарий к решению. Укажите: * для `REFUND_MONEY_INCLUDING_SHIPMENT`— стоимость обратной пересылки. * для `REPAIR` — когда вы устраните недостатки товара. * для `DECLINE_REFUND` — причину отказа. * для `OTHER_DECISION` — какое решение вы предлагаете. + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ReturnRequestDecisionReasonType.php b/erp24/lib/yandex_market_api/Model/ReturnRequestDecisionReasonType.php new file mode 100644 index 00000000..40fb144a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ReturnRequestDecisionReasonType.php @@ -0,0 +1,78 @@ +setIfExists('next_page_token', $data ?? [], null); $this->setIfExists('prev_page_token', $data ?? [], null); @@ -353,11 +353,11 @@ class ScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class ScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class ScrollingPagerDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SearchShipmentsRequest.php b/erp24/lib/yandex_market_api/Model/SearchShipmentsRequest.php index aadfdecd..ff9631ab 100644 --- a/erp24/lib/yandex_market_api/Model/SearchShipmentsRequest.php +++ b/erp24/lib/yandex_market_api/Model/SearchShipmentsRequest.php @@ -2,7 +2,7 @@ /** * SearchShipmentsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class SearchShipmentsRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('date_from', $data ?? [], null); $this->setIfExists('date_to', $data ?? [], null); @@ -477,7 +477,7 @@ class SearchShipmentsRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets cancelled_orders * - * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию — `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. + * @param bool|null $cancelled_orders Возвращать ли отмененные заказы. Значение по умолчанию: `true`. Если возвращать отмененные заказы не нужно, передайте значение `false`. * * @return self */ @@ -493,11 +493,11 @@ class SearchShipmentsRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -505,12 +505,12 @@ class SearchShipmentsRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -535,11 +535,11 @@ class SearchShipmentsRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SearchShipmentsResponse.php b/erp24/lib/yandex_market_api/Model/SearchShipmentsResponse.php index 532e1695..58163034 100644 --- a/erp24/lib/yandex_market_api/Model/SearchShipmentsResponse.php +++ b/erp24/lib/yandex_market_api/Model/SearchShipmentsResponse.php @@ -2,7 +2,7 @@ /** * SearchShipmentsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class SearchShipmentsResponse implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SearchShipmentsResponseDTO.php b/erp24/lib/yandex_market_api/Model/SearchShipmentsResponseDTO.php index e4c45220..a8ff673d 100644 --- a/erp24/lib/yandex_market_api/Model/SearchShipmentsResponseDTO.php +++ b/erp24/lib/yandex_market_api/Model/SearchShipmentsResponseDTO.php @@ -2,7 +2,7 @@ /** * SearchShipmentsResponseDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class SearchShipmentsResponseDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('shipments', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); @@ -356,11 +356,11 @@ class SearchShipmentsResponseDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class SearchShipmentsResponseDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class SearchShipmentsResponseDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SellingProgramType.php b/erp24/lib/yandex_market_api/Model/SellingProgramType.php index d6a22f15..c2b6c8a6 100644 --- a/erp24/lib/yandex_market_api/Model/SellingProgramType.php +++ b/erp24/lib/yandex_market_api/Model/SellingProgramType.php @@ -2,7 +2,7 @@ /** * SellingProgramType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * SellingProgramType Class Doc Comment * * @category Class - * @description Модель размещения: * `FBY` — FBY. * `FBS` — FBS. * `DBS` — DBS. * `EXPRESS` — Экспресс. + * @description Модель работы: * `FBY` — FBY. * `FBS` — FBS. * `DBS` — DBS. * `EXPRESS` — Экспресс. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -51,6 +51,8 @@ class SellingProgramType public const EXPRESS = 'EXPRESS'; + public const LAAS = 'LAAS'; + /** * Gets allowable values of the enum * @return string[] @@ -61,7 +63,8 @@ class SellingProgramType self::FBY, self::FBS, self::DBS, - self::EXPRESS + self::EXPRESS, + self::LAAS ]; } } diff --git a/erp24/lib/yandex_market_api/Model/SendMessageToChatRequest.php b/erp24/lib/yandex_market_api/Model/SendMessageToChatRequest.php index 4babb33c..4a35fc80 100644 --- a/erp24/lib/yandex_market_api/Model/SendMessageToChatRequest.php +++ b/erp24/lib/yandex_market_api/Model/SendMessageToChatRequest.php @@ -2,7 +2,7 @@ /** * SendMessageToChatRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class SendMessageToChatRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('message', $data ?? [], null); } @@ -337,11 +337,11 @@ class SendMessageToChatRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class SendMessageToChatRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class SendMessageToChatRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutRequest.php b/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutRequest.php index a45641d3..e0f76fd9 100644 --- a/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutRequest.php +++ b/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutRequest.php @@ -2,7 +2,7 @@ /** * SetOrderBoxLayoutRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class SetOrderBoxLayoutRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('boxes', $data ?? [], null); $this->setIfExists('allow_remove', $data ?? [], false); @@ -364,11 +364,11 @@ class SetOrderBoxLayoutRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -376,12 +376,12 @@ class SetOrderBoxLayoutRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -406,11 +406,11 @@ class SetOrderBoxLayoutRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutResponse.php b/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutResponse.php index 237deaa9..d31faff6 100644 --- a/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutResponse.php +++ b/erp24/lib/yandex_market_api/Model/SetOrderBoxLayoutResponse.php @@ -2,7 +2,7 @@ /** * SetOrderBoxLayoutResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class SetOrderBoxLayoutResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetOrderDeliveryDateRequest.php b/erp24/lib/yandex_market_api/Model/SetOrderDeliveryDateRequest.php index 4a2f6f71..abc23bf3 100644 --- a/erp24/lib/yandex_market_api/Model/SetOrderDeliveryDateRequest.php +++ b/erp24/lib/yandex_market_api/Model/SetOrderDeliveryDateRequest.php @@ -2,7 +2,7 @@ /** * SetOrderDeliveryDateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class SetOrderDeliveryDateRequest implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('dates', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); @@ -358,11 +358,11 @@ class SetOrderDeliveryDateRequest implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ class SetOrderDeliveryDateRequest implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ class SetOrderDeliveryDateRequest implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetOrderDeliveryTrackCodeRequest.php b/erp24/lib/yandex_market_api/Model/SetOrderDeliveryTrackCodeRequest.php index 5c4cd6b5..4fa1ead7 100644 --- a/erp24/lib/yandex_market_api/Model/SetOrderDeliveryTrackCodeRequest.php +++ b/erp24/lib/yandex_market_api/Model/SetOrderDeliveryTrackCodeRequest.php @@ -2,7 +2,7 @@ /** * SetOrderDeliveryTrackCodeRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class SetOrderDeliveryTrackCodeRequest implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('track_code', $data ?? [], null); $this->setIfExists('delivery_service_id', $data ?? [], null); @@ -342,7 +342,7 @@ class SetOrderDeliveryTrackCodeRequest implements ModelInterface, ArrayAccess, \ /** * Sets delivery_service_id * - * @param int $delivery_service_id Идентификатор службы доставки. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). + * @param int $delivery_service_id Идентификатор службы доставки. Информацию о службе доставки можно получить с помощью запроса [GET delivery/services](../../reference/orders/getDeliveryServices.md). * * @return self */ @@ -358,11 +358,11 @@ class SetOrderDeliveryTrackCodeRequest implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ class SetOrderDeliveryTrackCodeRequest implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ class SetOrderDeliveryTrackCodeRequest implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesRequest.php b/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesRequest.php index a5e9ca6d..4ce4e08b 100644 --- a/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesRequest.php +++ b/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesRequest.php @@ -2,7 +2,7 @@ /** * SetOrderShipmentBoxesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -57,7 +57,7 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'boxes' => '\OpenAPI\Client\Model\ParcelBoxDTO[]' + 'boxes' => '\OpenAPI\Client\Model\ParcelBoxRequestDTO[]' ]; /** @@ -239,10 +239,10 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('boxes', $data ?? [], null); } @@ -299,7 +299,7 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json /** * Gets boxes * - * @return \OpenAPI\Client\Model\ParcelBoxDTO[] + * @return \OpenAPI\Client\Model\ParcelBoxRequestDTO[] */ public function getBoxes() { @@ -309,7 +309,7 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json /** * Sets boxes * - * @param \OpenAPI\Client\Model\ParcelBoxDTO[] $boxes Список грузовых мест. Маркет определяет количество мест по длине этого списка. + * @param \OpenAPI\Client\Model\ParcelBoxRequestDTO[] $boxes Список грузовых мест. По его длине Маркет определяет количество мест. * * @return self */ @@ -330,11 +330,11 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -342,12 +342,12 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -372,11 +372,11 @@ class SetOrderShipmentBoxesRequest implements ModelInterface, ArrayAccess, \Json /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesResponse.php b/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesResponse.php index 7c6bf595..a033f276 100644 --- a/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesResponse.php +++ b/erp24/lib/yandex_market_api/Model/SetOrderShipmentBoxesResponse.php @@ -2,7 +2,7 @@ /** * SetOrderShipmentBoxesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class SetOrderShipmentBoxesResponse implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetReturnDecisionRequest.php b/erp24/lib/yandex_market_api/Model/SetReturnDecisionRequest.php index c0a8c02d..00db9eb1 100644 --- a/erp24/lib/yandex_market_api/Model/SetReturnDecisionRequest.php +++ b/erp24/lib/yandex_market_api/Model/SetReturnDecisionRequest.php @@ -2,7 +2,7 @@ /** * SetReturnDecisionRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * SetReturnDecisionRequest Class Doc Comment * * @category Class - * @description Решения по позиции в возврате. + * @description Решения по товару в возврате. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -252,10 +252,10 @@ class SetReturnDecisionRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('return_item_id', $data ?? [], null); $this->setIfExists('decision_type', $data ?? [], null); @@ -377,7 +377,7 @@ class SetReturnDecisionRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Sets comment * - * @param string|null $comment Комментарий к решению. Укажите: * для `REFUND_MONEY_INCLUDING_SHIPMENT`— стоимость обратной пересылки; * для `REPAIR` — когда вы устраните недостатки товара; * для `DECLINE_REFUND` — причину отказа; * для `OTHER_DECISION` — какое решение вы предлагаете. + * @param string|null $comment Комментарий к решению. Укажите: * для `REFUND_MONEY_INCLUDING_SHIPMENT`— стоимость обратной пересылки. * для `REPAIR` — когда вы устраните недостатки товара. * для `DECLINE_REFUND` — причину отказа. * для `OTHER_DECISION` — какое решение вы предлагаете. * * @return self */ @@ -393,11 +393,11 @@ class SetReturnDecisionRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +405,12 @@ class SetReturnDecisionRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +435,11 @@ class SetReturnDecisionRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SetShipmentPalletsCountRequest.php b/erp24/lib/yandex_market_api/Model/SetShipmentPalletsCountRequest.php index 0e7c5586..b81e800b 100644 --- a/erp24/lib/yandex_market_api/Model/SetShipmentPalletsCountRequest.php +++ b/erp24/lib/yandex_market_api/Model/SetShipmentPalletsCountRequest.php @@ -2,7 +2,7 @@ /** * SetShipmentPalletsCountRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class SetShipmentPalletsCountRequest implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('places_count', $data ?? [], null); } @@ -331,11 +331,11 @@ class SetShipmentPalletsCountRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -343,12 +343,12 @@ class SetShipmentPalletsCountRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -373,11 +373,11 @@ class SetShipmentPalletsCountRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ShipmentActionType.php b/erp24/lib/yandex_market_api/Model/ShipmentActionType.php index cc5649a0..2543cecb 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentActionType.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentActionType.php @@ -2,7 +2,7 @@ /** * ShipmentActionType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ShipmentActionType Class Doc Comment * * @category Class - * @description Действия с отгрузкой: * `CONFIRM` — подтвердить отгрузку. * `DOWNLOAD_ACT` — скачать акт приема-передачи отгрузки. * `DOWNLOAD_INBOUND_ACT` — скачать список принятых заказов. * `DOWNLOAD_DISCREPANCY_ACT` — скачать акт расхождений. * `CHANGE_PALLETS_COUNT` — указать количество палет. + * @description Действия с отгрузкой: * `CONFIRM` — подтвердить отгрузку. * `DOWNLOAD_ACT` — скачать акт приема-передачи отгрузки. * `DOWNLOAD_INBOUND_ACT` — скачать список принятых заказов. * `DOWNLOAD_DISCREPANCY_ACT` — скачать акт расхождений. * `DOWNLOAD_TRANSPORTATION_WAYBILL` — скачать транспортную накладную. * `CHANGE_PALLETS_COUNT` — указать количество палет. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -51,6 +51,8 @@ class ShipmentActionType public const DOWNLOAD_DISCREPANCY_ACT = 'DOWNLOAD_DISCREPANCY_ACT'; + public const DOWNLOAD_TRANSPORTATION_WAYBILL = 'DOWNLOAD_TRANSPORTATION_WAYBILL'; + public const CHANGE_PALLETS_COUNT = 'CHANGE_PALLETS_COUNT'; /** @@ -64,6 +66,7 @@ class ShipmentActionType self::DOWNLOAD_ACT, self::DOWNLOAD_INBOUND_ACT, self::DOWNLOAD_DISCREPANCY_ACT, + self::DOWNLOAD_TRANSPORTATION_WAYBILL, self::CHANGE_PALLETS_COUNT ]; } diff --git a/erp24/lib/yandex_market_api/Model/ShipmentBoxesDTO.php b/erp24/lib/yandex_market_api/Model/ShipmentBoxesDTO.php index 26939268..6fbc131b 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentBoxesDTO.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentBoxesDTO.php @@ -2,7 +2,7 @@ /** * ShipmentBoxesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class ShipmentBoxesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('boxes', $data ?? [], null); } @@ -306,7 +306,7 @@ class ShipmentBoxesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets boxes * - * @param \OpenAPI\Client\Model\ParcelBoxDTO[] $boxes Список грузовых мест. Маркет определил количество мест по длине этого списка. + * @param \OpenAPI\Client\Model\ParcelBoxDTO[] $boxes Список грузовых мест. По его длине Маркет определил количество мест. * * @return self */ @@ -322,11 +322,11 @@ class ShipmentBoxesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class ShipmentBoxesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class ShipmentBoxesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ShipmentDTO.php b/erp24/lib/yandex_market_api/Model/ShipmentDTO.php index 9b32674e..5851181a 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentDTO.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentDTO.php @@ -2,7 +2,7 @@ /** * ShipmentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -71,6 +71,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'int', 'planned_count' => 'int', 'fact_count' => 'int', + 'signature' => '\OpenAPI\Client\Model\SignatureDTO', 'current_status' => '\OpenAPI\Client\Model\ShipmentStatusChangeDTO', 'available_actions' => '\OpenAPI\Client\Model\ShipmentActionType[]' ]; @@ -96,6 +97,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'int32', 'planned_count' => 'int32', 'fact_count' => 'int32', + 'signature' => null, 'current_status' => null, 'available_actions' => null ]; @@ -119,6 +121,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => false, 'planned_count' => false, 'fact_count' => false, + 'signature' => false, 'current_status' => false, 'available_actions' => false ]; @@ -222,6 +225,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'draftCount', 'planned_count' => 'plannedCount', 'fact_count' => 'factCount', + 'signature' => 'signature', 'current_status' => 'currentStatus', 'available_actions' => 'availableActions' ]; @@ -245,6 +249,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'setDraftCount', 'planned_count' => 'setPlannedCount', 'fact_count' => 'setFactCount', + 'signature' => 'setSignature', 'current_status' => 'setCurrentStatus', 'available_actions' => 'setAvailableActions' ]; @@ -268,6 +273,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'getDraftCount', 'planned_count' => 'getPlannedCount', 'fact_count' => 'getFactCount', + 'signature' => 'getSignature', 'current_status' => 'getCurrentStatus', 'available_actions' => 'getAvailableActions' ]; @@ -324,10 +330,10 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('plan_interval_from', $data ?? [], null); @@ -342,6 +348,7 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('draft_count', $data ?? [], null); $this->setIfExists('planned_count', $data ?? [], null); $this->setIfExists('fact_count', $data ?? [], null); + $this->setIfExists('signature', $data ?? [], null); $this->setIfExists('current_status', $data ?? [], null); $this->setIfExists('available_actions', $data ?? [], null); } @@ -410,6 +417,9 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'fact_count', must be bigger than or equal to 0."; } + if ($this->container['signature'] === null) { + $invalidProperties[] = "'signature' can't be null"; + } if ($this->container['available_actions'] === null) { $invalidProperties[] = "'available_actions' can't be null"; } @@ -801,6 +811,33 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets signature + * + * @return \OpenAPI\Client\Model\SignatureDTO + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param \OpenAPI\Client\Model\SignatureDTO $signature signature + * + * @return self + */ + public function setSignature($signature) + { + if (is_null($signature)) { + throw new \InvalidArgumentException('non-nullable signature cannot be null'); + } + $this->container['signature'] = $signature; + + return $this; + } + /** * Gets current_status * @@ -859,11 +896,11 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -871,12 +908,12 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -901,11 +938,11 @@ class ShipmentDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ShipmentInfoDTO.php b/erp24/lib/yandex_market_api/Model/ShipmentInfoDTO.php index d3a3f798..235d604a 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentInfoDTO.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentInfoDTO.php @@ -2,7 +2,7 @@ /** * ShipmentInfoDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -71,6 +71,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'int', 'planned_count' => 'int', 'fact_count' => 'int', + 'signature' => '\OpenAPI\Client\Model\SignatureDTO', 'status' => '\OpenAPI\Client\Model\ShipmentStatusType', 'status_description' => 'string', 'status_update_time' => '\DateTime' @@ -97,6 +98,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'int32', 'planned_count' => 'int32', 'fact_count' => 'int32', + 'signature' => null, 'status' => null, 'status_description' => null, 'status_update_time' => 'date-time' @@ -121,6 +123,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => false, 'planned_count' => false, 'fact_count' => false, + 'signature' => false, 'status' => false, 'status_description' => false, 'status_update_time' => false @@ -225,6 +228,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'draftCount', 'planned_count' => 'plannedCount', 'fact_count' => 'factCount', + 'signature' => 'signature', 'status' => 'status', 'status_description' => 'statusDescription', 'status_update_time' => 'statusUpdateTime' @@ -249,6 +253,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'setDraftCount', 'planned_count' => 'setPlannedCount', 'fact_count' => 'setFactCount', + 'signature' => 'setSignature', 'status' => 'setStatus', 'status_description' => 'setStatusDescription', 'status_update_time' => 'setStatusUpdateTime' @@ -273,6 +278,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'draft_count' => 'getDraftCount', 'planned_count' => 'getPlannedCount', 'fact_count' => 'getFactCount', + 'signature' => 'getSignature', 'status' => 'getStatus', 'status_description' => 'getStatusDescription', 'status_update_time' => 'getStatusUpdateTime' @@ -330,10 +336,10 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('plan_interval_from', $data ?? [], null); @@ -348,6 +354,7 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('draft_count', $data ?? [], null); $this->setIfExists('planned_count', $data ?? [], null); $this->setIfExists('fact_count', $data ?? [], null); + $this->setIfExists('signature', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('status_description', $data ?? [], null); $this->setIfExists('status_update_time', $data ?? [], null); @@ -417,6 +424,9 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'fact_count', must be bigger than or equal to 0."; } + if ($this->container['signature'] === null) { + $invalidProperties[] = "'signature' can't be null"; + } return $invalidProperties; } @@ -805,6 +815,33 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets signature + * + * @return \OpenAPI\Client\Model\SignatureDTO + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param \OpenAPI\Client\Model\SignatureDTO $signature signature + * + * @return self + */ + public function setSignature($signature) + { + if (is_null($signature)) { + throw new \InvalidArgumentException('non-nullable signature cannot be null'); + } + $this->container['signature'] = $signature; + + return $this; + } + /** * Gets status * @@ -888,11 +925,11 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -900,12 +937,12 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -930,11 +967,11 @@ class ShipmentInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ShipmentPalletLabelPageFormatType.php b/erp24/lib/yandex_market_api/Model/ShipmentPalletLabelPageFormatType.php index 16e30992..eca4d09e 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentPalletLabelPageFormatType.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentPalletLabelPageFormatType.php @@ -2,7 +2,7 @@ /** * ShipmentPalletLabelPageFormatType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * ShipmentPalletLabelPageFormatType Class Doc Comment * * @category Class - * @description Формат страницы: * `A4` — формат страницы A4. * `A8` — формат страницы A8. + * @description Формат страницы: * `A4` — формат страницы :no-translate[A4]. * `A8` — формат страницы :no-translate[A8]. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/ShipmentStatusChangeDTO.php b/erp24/lib/yandex_market_api/Model/ShipmentStatusChangeDTO.php index 9966f227..9efed6ec 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentStatusChangeDTO.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentStatusChangeDTO.php @@ -2,7 +2,7 @@ /** * ShipmentStatusChangeDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class ShipmentStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); @@ -387,11 +387,11 @@ class ShipmentStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -399,12 +399,12 @@ class ShipmentStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -429,11 +429,11 @@ class ShipmentStatusChangeDTO implements ModelInterface, ArrayAccess, \JsonSeria /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/ShipmentStatusType.php b/erp24/lib/yandex_market_api/Model/ShipmentStatusType.php index d7b591ce..d8b09896 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentStatusType.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentStatusType.php @@ -2,7 +2,7 @@ /** * ShipmentStatusType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/ShipmentType.php b/erp24/lib/yandex_market_api/Model/ShipmentType.php index 8d403eaf..a6574bf7 100644 --- a/erp24/lib/yandex_market_api/Model/ShipmentType.php +++ b/erp24/lib/yandex_market_api/Model/ShipmentType.php @@ -2,7 +2,7 @@ /** * ShipmentType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/ShowcaseType.php b/erp24/lib/yandex_market_api/Model/ShowcaseType.php new file mode 100644 index 00000000..33580992 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/ShowcaseType.php @@ -0,0 +1,63 @@ + + */ +class ShowcaseUrlDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShowcaseUrlDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'showcase_type' => '\OpenAPI\Client\Model\ShowcaseType', + 'showcase_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'showcase_type' => null, + 'showcase_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'showcase_type' => false, + 'showcase_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'showcase_type' => 'showcaseType', + 'showcase_url' => 'showcaseUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'showcase_type' => 'setShowcaseType', + 'showcase_url' => 'setShowcaseUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'showcase_type' => 'getShowcaseType', + 'showcase_url' => 'getShowcaseUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('showcase_type', $data ?? [], null); + $this->setIfExists('showcase_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['showcase_type'] === null) { + $invalidProperties[] = "'showcase_type' can't be null"; + } + if ($this->container['showcase_url'] === null) { + $invalidProperties[] = "'showcase_url' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets showcase_type + * + * @return \OpenAPI\Client\Model\ShowcaseType + */ + public function getShowcaseType() + { + return $this->container['showcase_type']; + } + + /** + * Sets showcase_type + * + * @param \OpenAPI\Client\Model\ShowcaseType $showcase_type showcase_type + * + * @return self + */ + public function setShowcaseType($showcase_type) + { + if (is_null($showcase_type)) { + throw new \InvalidArgumentException('non-nullable showcase_type cannot be null'); + } + $this->container['showcase_type'] = $showcase_type; + + return $this; + } + + /** + * Gets showcase_url + * + * @return string + */ + public function getShowcaseUrl() + { + return $this->container['showcase_url']; + } + + /** + * Sets showcase_url + * + * @param string $showcase_url Ссылка на товар. + * + * @return self + */ + public function setShowcaseUrl($showcase_url) + { + if (is_null($showcase_url)) { + throw new \InvalidArgumentException('non-nullable showcase_url cannot be null'); + } + $this->container['showcase_url'] = $showcase_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ShowsSalesGroupingType.php b/erp24/lib/yandex_market_api/Model/ShowsSalesGroupingType.php index a4c4ba48..027d2e91 100644 --- a/erp24/lib/yandex_market_api/Model/ShowsSalesGroupingType.php +++ b/erp24/lib/yandex_market_api/Model/ShowsSalesGroupingType.php @@ -2,7 +2,7 @@ /** * ShowsSalesGroupingType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/SignatureDTO.php b/erp24/lib/yandex_market_api/Model/SignatureDTO.php new file mode 100644 index 00000000..3e879155 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SignatureDTO.php @@ -0,0 +1,413 @@ + + */ +class SignatureDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SignatureDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'signed' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'signed' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'signed' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'signed' => 'signed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'signed' => 'setSigned' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'signed' => 'getSigned' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('signed', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['signed'] === null) { + $invalidProperties[] = "'signed' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets signed + * + * @return bool + */ + public function getSigned() + { + return $this->container['signed']; + } + + /** + * Sets signed + * + * @param bool $signed Подписан ли акт приема-передачи. + * + * @return self + */ + public function setSigned($signed) + { + if (is_null($signed)) { + throw new \InvalidArgumentException('non-nullable signed cannot be null'); + } + $this->container['signed'] = $signed; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SkipGoodsFeedbackReactionRequest.php b/erp24/lib/yandex_market_api/Model/SkipGoodsFeedbackReactionRequest.php index e7128414..4a52cb2c 100644 --- a/erp24/lib/yandex_market_api/Model/SkipGoodsFeedbackReactionRequest.php +++ b/erp24/lib/yandex_market_api/Model/SkipGoodsFeedbackReactionRequest.php @@ -2,7 +2,7 @@ /** * SkipGoodsFeedbackReactionRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class SkipGoodsFeedbackReactionRequest implements ModelInterface, ArrayAccess, \ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('feedback_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class SkipGoodsFeedbackReactionRequest implements ModelInterface, ArrayAccess, \ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class SkipGoodsFeedbackReactionRequest implements ModelInterface, ArrayAccess, \ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class SkipGoodsFeedbackReactionRequest implements ModelInterface, ArrayAccess, \ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SkuBidItemDTO.php b/erp24/lib/yandex_market_api/Model/SkuBidItemDTO.php index 1163f8d9..4125e4b6 100644 --- a/erp24/lib/yandex_market_api/Model/SkuBidItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/SkuBidItemDTO.php @@ -2,7 +2,7 @@ /** * SkuBidItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sku', $data ?? [], null); $this->setIfExists('bid', $data ?? [], null); @@ -293,8 +293,8 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'sku', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['sku'])) { - $invalidProperties[] = "invalid value for 'sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['sku'])) { + $invalidProperties[] = "invalid value for 'sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['bid'] === null) { @@ -336,7 +336,7 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets sku * - * @param string $sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -351,8 +351,8 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($sku) < 1)) { throw new \InvalidArgumentException('invalid length for $sku when calling SkuBidItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($sku)))) { - throw new \InvalidArgumentException("invalid value for \$sku when calling SkuBidItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($sku)))) { + throw new \InvalidArgumentException("invalid value for \$sku when calling SkuBidItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['sku'] = $sku; @@ -397,11 +397,11 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -409,12 +409,12 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -439,11 +439,11 @@ class SkuBidItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SkuBidRecommendationItemDTO.php b/erp24/lib/yandex_market_api/Model/SkuBidRecommendationItemDTO.php index 8121f924..34ab8475 100644 --- a/erp24/lib/yandex_market_api/Model/SkuBidRecommendationItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/SkuBidRecommendationItemDTO.php @@ -2,7 +2,7 @@ /** * SkuBidRecommendationItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sku', $data ?? [], null); $this->setIfExists('bid', $data ?? [], null); @@ -307,8 +307,8 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'sku', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['sku'])) { - $invalidProperties[] = "invalid value for 'sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['sku'])) { + $invalidProperties[] = "invalid value for 'sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['bid'] === null) { @@ -322,6 +322,14 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'bid', must be bigger than or equal to 0."; } + if (!is_null($this->container['bid_recommendations']) && (count($this->container['bid_recommendations']) < 1)) { + $invalidProperties[] = "invalid value for 'bid_recommendations', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['price_recommendations']) && (count($this->container['price_recommendations']) < 1)) { + $invalidProperties[] = "invalid value for 'price_recommendations', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -350,7 +358,7 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets sku * - * @param string $sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -365,8 +373,8 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS if ((mb_strlen($sku) < 1)) { throw new \InvalidArgumentException('invalid length for $sku when calling SkuBidRecommendationItemDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($sku)))) { - throw new \InvalidArgumentException("invalid value for \$sku when calling SkuBidRecommendationItemDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($sku)))) { + throw new \InvalidArgumentException("invalid value for \$sku when calling SkuBidRecommendationItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['sku'] = $sku; @@ -422,7 +430,7 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets bid_recommendations * - * @param \OpenAPI\Client\Model\BidRecommendationItemDTO[]|null $bid_recommendations Список рекомендованных ставок с соответствующими долями показов. Чем больше ставка, тем большую долю показов она помогает получить. + * @param \OpenAPI\Client\Model\BidRecommendationItemDTO[]|null $bid_recommendations Список рекомендованных ставок с соответствующими долями показов и доступными дополнительными инструментами продвижения. Чем больше ставка, тем большую долю показов она помогает получить и тем больше дополнительных инструментов продвижения доступно. * * @return self */ @@ -438,6 +446,11 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($bid_recommendations) && (count($bid_recommendations) < 1)) { + throw new \InvalidArgumentException('invalid length for $bid_recommendations when calling SkuBidRecommendationItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['bid_recommendations'] = $bid_recommendations; return $this; @@ -447,6 +460,7 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS * Gets price_recommendations * * @return \OpenAPI\Client\Model\PriceRecommendationItemDTO[]|null + * @deprecated */ public function getPriceRecommendations() { @@ -459,6 +473,7 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS * @param \OpenAPI\Client\Model\PriceRecommendationItemDTO[]|null $price_recommendations Рекомендованные цены. * * @return self + * @deprecated */ public function setPriceRecommendations($price_recommendations) { @@ -472,6 +487,11 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($price_recommendations) && (count($price_recommendations) < 1)) { + throw new \InvalidArgumentException('invalid length for $price_recommendations when calling SkuBidRecommendationItemDTO., number of items must be greater than or equal to 1.'); + } $this->container['price_recommendations'] = $price_recommendations; return $this; @@ -479,11 +499,11 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -491,12 +511,12 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -521,11 +541,11 @@ class SkuBidRecommendationItemDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SortOrderType.php b/erp24/lib/yandex_market_api/Model/SortOrderType.php index 4de6b0e0..3d5be4c3 100644 --- a/erp24/lib/yandex_market_api/Model/SortOrderType.php +++ b/erp24/lib/yandex_market_api/Model/SortOrderType.php @@ -2,7 +2,7 @@ /** * SortOrderType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * SortOrderType Class Doc Comment * * @category Class - * @description Направление сортировки. Возможные значения: - `ASC` — сортировка по возрастанию. - `DESC` — сортировка по убыванию. + * @description Направление сортировки: - `ASC` — сортировка по возрастанию. - `DESC` — сортировка по убыванию. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/StatisticsAttributionType.php b/erp24/lib/yandex_market_api/Model/StatisticsAttributionType.php new file mode 100644 index 00000000..9906e944 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/StatisticsAttributionType.php @@ -0,0 +1,63 @@ + + */ +class SubmitReturnDecisionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitReturnDecisionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'return_item_decisions' => '\OpenAPI\Client\Model\ReturnItemDecisionDTO[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'return_item_decisions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'return_item_decisions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'return_item_decisions' => 'returnItemDecisions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'return_item_decisions' => 'setReturnItemDecisions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'return_item_decisions' => 'getReturnItemDecisions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('return_item_decisions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['return_item_decisions'] === null) { + $invalidProperties[] = "'return_item_decisions' can't be null"; + } + if ((count($this->container['return_item_decisions']) < 1)) { + $invalidProperties[] = "invalid value for 'return_item_decisions', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets return_item_decisions + * + * @return \OpenAPI\Client\Model\ReturnItemDecisionDTO[] + */ + public function getReturnItemDecisions() + { + return $this->container['return_item_decisions']; + } + + /** + * Sets return_item_decisions + * + * @param \OpenAPI\Client\Model\ReturnItemDecisionDTO[] $return_item_decisions Решения по товарам в возврате. + * + * @return self + */ + public function setReturnItemDecisions($return_item_decisions) + { + if (is_null($return_item_decisions)) { + throw new \InvalidArgumentException('non-nullable return_item_decisions cannot be null'); + } + + + if ((count($return_item_decisions) < 1)) { + throw new \InvalidArgumentException('invalid length for $return_item_decisions when calling SubmitReturnDecisionRequest., number of items must be greater than or equal to 1.'); + } + $this->container['return_item_decisions'] = $return_item_decisions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SuggestedOfferDTO.php b/erp24/lib/yandex_market_api/Model/SuggestedOfferDTO.php index 6babc760..2c6b5782 100644 --- a/erp24/lib/yandex_market_api/Model/SuggestedOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/SuggestedOfferDTO.php @@ -2,7 +2,7 @@ /** * SuggestedOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -282,10 +282,10 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -332,14 +332,18 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['offer_id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['offer_id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) { $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256."; } + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 6000."; } @@ -372,7 +376,7 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets offer_id * - * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -387,8 +391,8 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling SuggestedOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling SuggestedOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling SuggestedOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -431,6 +435,7 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -440,9 +445,10 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -494,7 +500,7 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -510,6 +516,11 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling SuggestedOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -528,7 +539,7 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                                                                                                  , \\

                                                                                                  и так далее — для заголовков; * \\
                                                                                                  и \\

                                                                                                  — для переноса строки; * \\

                                                                                                    — для нумерованного списка; * \\
                                                                                                      — для маркированного списка; * \\
                                                                                                    • — для создания элементов списка (должен находиться внутри \\
                                                                                                        или \\
                                                                                                          ); * \\
                                                                                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                                                                          , \\

                                                                                                          и так далее — для заголовков; * \\
                                                                                                          и \\

                                                                                                          — для переноса строки; * \\

                                                                                                            — для нумерованного списка; * \\
                                                                                                              — для маркированного списка; * \\
                                                                                                            • — для создания элементов списка (должен находиться внутри \\
                                                                                                                или \\
                                                                                                                  ); * \\
                                                                                                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -602,11 +613,11 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -614,12 +625,12 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -644,11 +655,11 @@ class SuggestedOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SuggestedOfferMappingDTO.php b/erp24/lib/yandex_market_api/Model/SuggestedOfferMappingDTO.php index c76205d3..34a9ffb1 100644 --- a/erp24/lib/yandex_market_api/Model/SuggestedOfferMappingDTO.php +++ b/erp24/lib/yandex_market_api/Model/SuggestedOfferMappingDTO.php @@ -2,7 +2,7 @@ /** * SuggestedOfferMappingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class SuggestedOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer', $data ?? [], null); $this->setIfExists('mapping', $data ?? [], null); @@ -353,11 +353,11 @@ class SuggestedOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +365,12 @@ class SuggestedOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +395,11 @@ class SuggestedOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestCountersDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestCountersDTO.php new file mode 100644 index 00000000..d2c2183d --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestCountersDTO.php @@ -0,0 +1,806 @@ + + */ +class SupplyRequestCountersDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestCountersDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan_count' => 'int', + 'fact_count' => 'int', + 'undefined_count' => 'int', + 'surplus_count' => 'int', + 'shortage_count' => 'int', + 'defect_count' => 'int', + 'acceptable_count' => 'int', + 'unacceptable_count' => 'int', + 'actual_pallets_count' => 'int', + 'actual_box_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan_count' => 'int32', + 'fact_count' => 'int32', + 'undefined_count' => 'int32', + 'surplus_count' => 'int32', + 'shortage_count' => 'int32', + 'defect_count' => 'int32', + 'acceptable_count' => 'int32', + 'unacceptable_count' => 'int32', + 'actual_pallets_count' => 'int32', + 'actual_box_count' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'plan_count' => false, + 'fact_count' => false, + 'undefined_count' => false, + 'surplus_count' => false, + 'shortage_count' => false, + 'defect_count' => false, + 'acceptable_count' => false, + 'unacceptable_count' => false, + 'actual_pallets_count' => false, + 'actual_box_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan_count' => 'planCount', + 'fact_count' => 'factCount', + 'undefined_count' => 'undefinedCount', + 'surplus_count' => 'surplusCount', + 'shortage_count' => 'shortageCount', + 'defect_count' => 'defectCount', + 'acceptable_count' => 'acceptableCount', + 'unacceptable_count' => 'unacceptableCount', + 'actual_pallets_count' => 'actualPalletsCount', + 'actual_box_count' => 'actualBoxCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan_count' => 'setPlanCount', + 'fact_count' => 'setFactCount', + 'undefined_count' => 'setUndefinedCount', + 'surplus_count' => 'setSurplusCount', + 'shortage_count' => 'setShortageCount', + 'defect_count' => 'setDefectCount', + 'acceptable_count' => 'setAcceptableCount', + 'unacceptable_count' => 'setUnacceptableCount', + 'actual_pallets_count' => 'setActualPalletsCount', + 'actual_box_count' => 'setActualBoxCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan_count' => 'getPlanCount', + 'fact_count' => 'getFactCount', + 'undefined_count' => 'getUndefinedCount', + 'surplus_count' => 'getSurplusCount', + 'shortage_count' => 'getShortageCount', + 'defect_count' => 'getDefectCount', + 'acceptable_count' => 'getAcceptableCount', + 'unacceptable_count' => 'getUnacceptableCount', + 'actual_pallets_count' => 'getActualPalletsCount', + 'actual_box_count' => 'getActualBoxCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('plan_count', $data ?? [], null); + $this->setIfExists('fact_count', $data ?? [], null); + $this->setIfExists('undefined_count', $data ?? [], null); + $this->setIfExists('surplus_count', $data ?? [], null); + $this->setIfExists('shortage_count', $data ?? [], null); + $this->setIfExists('defect_count', $data ?? [], null); + $this->setIfExists('acceptable_count', $data ?? [], null); + $this->setIfExists('unacceptable_count', $data ?? [], null); + $this->setIfExists('actual_pallets_count', $data ?? [], null); + $this->setIfExists('actual_box_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['plan_count']) && ($this->container['plan_count'] < 0)) { + $invalidProperties[] = "invalid value for 'plan_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['fact_count']) && ($this->container['fact_count'] < 0)) { + $invalidProperties[] = "invalid value for 'fact_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['undefined_count']) && ($this->container['undefined_count'] < 0)) { + $invalidProperties[] = "invalid value for 'undefined_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['surplus_count']) && ($this->container['surplus_count'] < 0)) { + $invalidProperties[] = "invalid value for 'surplus_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['shortage_count']) && ($this->container['shortage_count'] < 0)) { + $invalidProperties[] = "invalid value for 'shortage_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['defect_count']) && ($this->container['defect_count'] < 0)) { + $invalidProperties[] = "invalid value for 'defect_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['acceptable_count']) && ($this->container['acceptable_count'] < 0)) { + $invalidProperties[] = "invalid value for 'acceptable_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['unacceptable_count']) && ($this->container['unacceptable_count'] < 0)) { + $invalidProperties[] = "invalid value for 'unacceptable_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['actual_pallets_count']) && ($this->container['actual_pallets_count'] < 0)) { + $invalidProperties[] = "invalid value for 'actual_pallets_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['actual_box_count']) && ($this->container['actual_box_count'] < 0)) { + $invalidProperties[] = "invalid value for 'actual_box_count', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan_count + * + * @return int|null + */ + public function getPlanCount() + { + return $this->container['plan_count']; + } + + /** + * Sets plan_count + * + * @param int|null $plan_count Количество товаров в заявке на поставку. + * + * @return self + */ + public function setPlanCount($plan_count) + { + if (is_null($plan_count)) { + throw new \InvalidArgumentException('non-nullable plan_count cannot be null'); + } + + if (($plan_count < 0)) { + throw new \InvalidArgumentException('invalid value for $plan_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['plan_count'] = $plan_count; + + return $this; + } + + /** + * Gets fact_count + * + * @return int|null + */ + public function getFactCount() + { + return $this->container['fact_count']; + } + + /** + * Sets fact_count + * + * @param int|null $fact_count Количество товаров, которые приняты на складе. + * + * @return self + */ + public function setFactCount($fact_count) + { + if (is_null($fact_count)) { + throw new \InvalidArgumentException('non-nullable fact_count cannot be null'); + } + + if (($fact_count < 0)) { + throw new \InvalidArgumentException('invalid value for $fact_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['fact_count'] = $fact_count; + + return $this; + } + + /** + * Gets undefined_count + * + * @return int|null + */ + public function getUndefinedCount() + { + return $this->container['undefined_count']; + } + + /** + * Sets undefined_count + * + * @param int|null $undefined_count Количество непринятых товаров. + * + * @return self + */ + public function setUndefinedCount($undefined_count) + { + if (is_null($undefined_count)) { + throw new \InvalidArgumentException('non-nullable undefined_count cannot be null'); + } + + if (($undefined_count < 0)) { + throw new \InvalidArgumentException('invalid value for $undefined_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['undefined_count'] = $undefined_count; + + return $this; + } + + /** + * Gets surplus_count + * + * @return int|null + */ + public function getSurplusCount() + { + return $this->container['surplus_count']; + } + + /** + * Sets surplus_count + * + * @param int|null $surplus_count Количество лишних товаров. + * + * @return self + */ + public function setSurplusCount($surplus_count) + { + if (is_null($surplus_count)) { + throw new \InvalidArgumentException('non-nullable surplus_count cannot be null'); + } + + if (($surplus_count < 0)) { + throw new \InvalidArgumentException('invalid value for $surplus_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['surplus_count'] = $surplus_count; + + return $this; + } + + /** + * Gets shortage_count + * + * @return int|null + */ + public function getShortageCount() + { + return $this->container['shortage_count']; + } + + /** + * Sets shortage_count + * + * @param int|null $shortage_count Количество товаров с недостатками. + * + * @return self + */ + public function setShortageCount($shortage_count) + { + if (is_null($shortage_count)) { + throw new \InvalidArgumentException('non-nullable shortage_count cannot be null'); + } + + if (($shortage_count < 0)) { + throw new \InvalidArgumentException('invalid value for $shortage_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['shortage_count'] = $shortage_count; + + return $this; + } + + /** + * Gets defect_count + * + * @return int|null + */ + public function getDefectCount() + { + return $this->container['defect_count']; + } + + /** + * Sets defect_count + * + * @param int|null $defect_count Количество товаров с браком. + * + * @return self + */ + public function setDefectCount($defect_count) + { + if (is_null($defect_count)) { + throw new \InvalidArgumentException('non-nullable defect_count cannot be null'); + } + + if (($defect_count < 0)) { + throw new \InvalidArgumentException('invalid value for $defect_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['defect_count'] = $defect_count; + + return $this; + } + + /** + * Gets acceptable_count + * + * @return int|null + */ + public function getAcceptableCount() + { + return $this->container['acceptable_count']; + } + + /** + * Sets acceptable_count + * + * @param int|null $acceptable_count Количество товаров, которые можно привезти дополнительно. + * + * @return self + */ + public function setAcceptableCount($acceptable_count) + { + if (is_null($acceptable_count)) { + throw new \InvalidArgumentException('non-nullable acceptable_count cannot be null'); + } + + if (($acceptable_count < 0)) { + throw new \InvalidArgumentException('invalid value for $acceptable_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['acceptable_count'] = $acceptable_count; + + return $this; + } + + /** + * Gets unacceptable_count + * + * @return int|null + */ + public function getUnacceptableCount() + { + return $this->container['unacceptable_count']; + } + + /** + * Sets unacceptable_count + * + * @param int|null $unacceptable_count Количество товаров, которые нельзя привезти дополнительно. + * + * @return self + */ + public function setUnacceptableCount($unacceptable_count) + { + if (is_null($unacceptable_count)) { + throw new \InvalidArgumentException('non-nullable unacceptable_count cannot be null'); + } + + if (($unacceptable_count < 0)) { + throw new \InvalidArgumentException('invalid value for $unacceptable_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['unacceptable_count'] = $unacceptable_count; + + return $this; + } + + /** + * Gets actual_pallets_count + * + * @return int|null + */ + public function getActualPalletsCount() + { + return $this->container['actual_pallets_count']; + } + + /** + * Sets actual_pallets_count + * + * @param int|null $actual_pallets_count Количество палет, которые приняты на складе. + * + * @return self + */ + public function setActualPalletsCount($actual_pallets_count) + { + if (is_null($actual_pallets_count)) { + throw new \InvalidArgumentException('non-nullable actual_pallets_count cannot be null'); + } + + if (($actual_pallets_count < 0)) { + throw new \InvalidArgumentException('invalid value for $actual_pallets_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['actual_pallets_count'] = $actual_pallets_count; + + return $this; + } + + /** + * Gets actual_box_count + * + * @return int|null + */ + public function getActualBoxCount() + { + return $this->container['actual_box_count']; + } + + /** + * Sets actual_box_count + * + * @param int|null $actual_box_count Количество коробок, которые приняты на складе. + * + * @return self + */ + public function setActualBoxCount($actual_box_count) + { + if (is_null($actual_box_count)) { + throw new \InvalidArgumentException('non-nullable actual_box_count cannot be null'); + } + + if (($actual_box_count < 0)) { + throw new \InvalidArgumentException('invalid value for $actual_box_count when calling SupplyRequestCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['actual_box_count'] = $actual_box_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestDTO.php new file mode 100644 index 00000000..93c47843 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestDTO.php @@ -0,0 +1,753 @@ + + */ +class SupplyRequestDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => '\OpenAPI\Client\Model\SupplyRequestIdDTO', + 'type' => '\OpenAPI\Client\Model\SupplyRequestType', + 'subtype' => '\OpenAPI\Client\Model\SupplyRequestSubType', + 'status' => '\OpenAPI\Client\Model\SupplyRequestStatusType', + 'updated_at' => '\DateTime', + 'counters' => '\OpenAPI\Client\Model\SupplyRequestCountersDTO', + 'parent_link' => '\OpenAPI\Client\Model\SupplyRequestReferenceDTO', + 'children_links' => '\OpenAPI\Client\Model\SupplyRequestReferenceDTO[]', + 'target_location' => '\OpenAPI\Client\Model\SupplyRequestLocationDTO', + 'transit_location' => '\OpenAPI\Client\Model\SupplyRequestLocationDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'subtype' => null, + 'status' => null, + 'updated_at' => 'date-time', + 'counters' => null, + 'parent_link' => null, + 'children_links' => null, + 'target_location' => null, + 'transit_location' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'subtype' => false, + 'status' => false, + 'updated_at' => false, + 'counters' => false, + 'parent_link' => false, + 'children_links' => true, + 'target_location' => false, + 'transit_location' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'subtype' => 'subtype', + 'status' => 'status', + 'updated_at' => 'updatedAt', + 'counters' => 'counters', + 'parent_link' => 'parentLink', + 'children_links' => 'childrenLinks', + 'target_location' => 'targetLocation', + 'transit_location' => 'transitLocation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'subtype' => 'setSubtype', + 'status' => 'setStatus', + 'updated_at' => 'setUpdatedAt', + 'counters' => 'setCounters', + 'parent_link' => 'setParentLink', + 'children_links' => 'setChildrenLinks', + 'target_location' => 'setTargetLocation', + 'transit_location' => 'setTransitLocation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'subtype' => 'getSubtype', + 'status' => 'getStatus', + 'updated_at' => 'getUpdatedAt', + 'counters' => 'getCounters', + 'parent_link' => 'getParentLink', + 'children_links' => 'getChildrenLinks', + 'target_location' => 'getTargetLocation', + 'transit_location' => 'getTransitLocation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('counters', $data ?? [], null); + $this->setIfExists('parent_link', $data ?? [], null); + $this->setIfExists('children_links', $data ?? [], null); + $this->setIfExists('target_location', $data ?? [], null); + $this->setIfExists('transit_location', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['subtype'] === null) { + $invalidProperties[] = "'subtype' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['updated_at'] === null) { + $invalidProperties[] = "'updated_at' can't be null"; + } + if ($this->container['counters'] === null) { + $invalidProperties[] = "'counters' can't be null"; + } + if (!is_null($this->container['children_links']) && (count($this->container['children_links']) < 1)) { + $invalidProperties[] = "invalid value for 'children_links', number of items must be greater than or equal to 1."; + } + + if ($this->container['target_location'] === null) { + $invalidProperties[] = "'target_location' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return \OpenAPI\Client\Model\SupplyRequestIdDTO + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param \OpenAPI\Client\Model\SupplyRequestIdDTO $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\SupplyRequestType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\SupplyRequestType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets subtype + * + * @return \OpenAPI\Client\Model\SupplyRequestSubType + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param \OpenAPI\Client\Model\SupplyRequestSubType $subtype subtype + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $this->container['subtype'] = $subtype; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\SupplyRequestStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\SupplyRequestStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime $updated_at Дата и время последнего обновления заявки. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets counters + * + * @return \OpenAPI\Client\Model\SupplyRequestCountersDTO + */ + public function getCounters() + { + return $this->container['counters']; + } + + /** + * Sets counters + * + * @param \OpenAPI\Client\Model\SupplyRequestCountersDTO $counters counters + * + * @return self + */ + public function setCounters($counters) + { + if (is_null($counters)) { + throw new \InvalidArgumentException('non-nullable counters cannot be null'); + } + $this->container['counters'] = $counters; + + return $this; + } + + /** + * Gets parent_link + * + * @return \OpenAPI\Client\Model\SupplyRequestReferenceDTO|null + */ + public function getParentLink() + { + return $this->container['parent_link']; + } + + /** + * Sets parent_link + * + * @param \OpenAPI\Client\Model\SupplyRequestReferenceDTO|null $parent_link parent_link + * + * @return self + */ + public function setParentLink($parent_link) + { + if (is_null($parent_link)) { + throw new \InvalidArgumentException('non-nullable parent_link cannot be null'); + } + $this->container['parent_link'] = $parent_link; + + return $this; + } + + /** + * Gets children_links + * + * @return \OpenAPI\Client\Model\SupplyRequestReferenceDTO[]|null + */ + public function getChildrenLinks() + { + return $this->container['children_links']; + } + + /** + * Sets children_links + * + * @param \OpenAPI\Client\Model\SupplyRequestReferenceDTO[]|null $children_links Ссылки на дочерние заявки. + * + * @return self + */ + public function setChildrenLinks($children_links) + { + if (is_null($children_links)) { + array_push($this->openAPINullablesSetToNull, 'children_links'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('children_links', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($children_links) && (count($children_links) < 1)) { + throw new \InvalidArgumentException('invalid length for $children_links when calling SupplyRequestDTO., number of items must be greater than or equal to 1.'); + } + $this->container['children_links'] = $children_links; + + return $this; + } + + /** + * Gets target_location + * + * @return \OpenAPI\Client\Model\SupplyRequestLocationDTO + */ + public function getTargetLocation() + { + return $this->container['target_location']; + } + + /** + * Sets target_location + * + * @param \OpenAPI\Client\Model\SupplyRequestLocationDTO $target_location target_location + * + * @return self + */ + public function setTargetLocation($target_location) + { + if (is_null($target_location)) { + throw new \InvalidArgumentException('non-nullable target_location cannot be null'); + } + $this->container['target_location'] = $target_location; + + return $this; + } + + /** + * Gets transit_location + * + * @return \OpenAPI\Client\Model\SupplyRequestLocationDTO|null + */ + public function getTransitLocation() + { + return $this->container['transit_location']; + } + + /** + * Sets transit_location + * + * @param \OpenAPI\Client\Model\SupplyRequestLocationDTO|null $transit_location transit_location + * + * @return self + */ + public function setTransitLocation($transit_location) + { + if (is_null($transit_location)) { + throw new \InvalidArgumentException('non-nullable transit_location cannot be null'); + } + $this->container['transit_location'] = $transit_location; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestDocumentDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestDocumentDTO.php new file mode 100644 index 00000000..9020823a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestDocumentDTO.php @@ -0,0 +1,502 @@ + + */ +class SupplyRequestDocumentDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestDocumentDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\OpenAPI\Client\Model\SupplyRequestDocumentType', + 'url' => 'string', + 'created_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'url' => null, + 'created_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'url' => false, + 'created_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'url' => 'url', + 'created_at' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'url' => 'setUrl', + 'created_at' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'url' => 'getUrl', + 'created_at' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ((mb_strlen($this->container['url']) > 2000)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2000."; + } + + if ((mb_strlen($this->container['url']) < 1)) { + $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1."; + } + + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\SupplyRequestDocumentType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\SupplyRequestDocumentType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + if ((mb_strlen($url) > 2000)) { + throw new \InvalidArgumentException('invalid length for $url when calling SupplyRequestDocumentDTO., must be smaller than or equal to 2000.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling SupplyRequestDocumentDTO., must be bigger than or equal to 1.'); + } + + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at Дата и время создания документа. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestDocumentType.php b/erp24/lib/yandex_market_api/Model/SupplyRequestDocumentType.php new file mode 100644 index 00000000..ba4863a0 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestDocumentType.php @@ -0,0 +1,126 @@ + + */ +class SupplyRequestIdDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestIdDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'marketplace_request_id' => 'string', + 'warehouse_request_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'marketplace_request_id' => null, + 'warehouse_request_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'marketplace_request_id' => false, + 'warehouse_request_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'marketplace_request_id' => 'marketplaceRequestId', + 'warehouse_request_id' => 'warehouseRequestId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'marketplace_request_id' => 'setMarketplaceRequestId', + 'warehouse_request_id' => 'setWarehouseRequestId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'marketplace_request_id' => 'getMarketplaceRequestId', + 'warehouse_request_id' => 'getWarehouseRequestId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('marketplace_request_id', $data ?? [], null); + $this->setIfExists('warehouse_request_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор заявки. {% note warning \"Используется только в API\" %} По нему не получится найти заявки в кабинете продавца на Маркете. Для этого используйте `marketplaceRequestId` или `warehouseRequestId`. {% endnote %} + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling SupplyRequestIdDTO., must be bigger than or equal to 1.'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets marketplace_request_id + * + * @return string|null + */ + public function getMarketplaceRequestId() + { + return $this->container['marketplace_request_id']; + } + + /** + * Sets marketplace_request_id + * + * @param string|null $marketplace_request_id Номер заявки на маркетплейсе. Также указывается в кабинете продавца на Маркете. + * + * @return self + */ + public function setMarketplaceRequestId($marketplace_request_id) + { + if (is_null($marketplace_request_id)) { + throw new \InvalidArgumentException('non-nullable marketplace_request_id cannot be null'); + } + $this->container['marketplace_request_id'] = $marketplace_request_id; + + return $this; + } + + /** + * Gets warehouse_request_id + * + * @return string|null + */ + public function getWarehouseRequestId() + { + return $this->container['warehouse_request_id']; + } + + /** + * Sets warehouse_request_id + * + * @param string|null $warehouse_request_id Номер заявки на складе. Также указывается в кабинете продавца на Маркете. + * + * @return self + */ + public function setWarehouseRequestId($warehouse_request_id) + { + if (is_null($warehouse_request_id)) { + throw new \InvalidArgumentException('non-nullable warehouse_request_id cannot be null'); + } + $this->container['warehouse_request_id'] = $warehouse_request_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestItemCountersDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestItemCountersDTO.php new file mode 100644 index 00000000..2e3939e1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestItemCountersDTO.php @@ -0,0 +1,591 @@ + + */ +class SupplyRequestItemCountersDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestItemCountersDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan_count' => 'int', + 'fact_count' => 'int', + 'surplus_count' => 'int', + 'shortage_count' => 'int', + 'defect_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan_count' => 'int32', + 'fact_count' => 'int32', + 'surplus_count' => 'int32', + 'shortage_count' => 'int32', + 'defect_count' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'plan_count' => false, + 'fact_count' => false, + 'surplus_count' => false, + 'shortage_count' => false, + 'defect_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan_count' => 'planCount', + 'fact_count' => 'factCount', + 'surplus_count' => 'surplusCount', + 'shortage_count' => 'shortageCount', + 'defect_count' => 'defectCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan_count' => 'setPlanCount', + 'fact_count' => 'setFactCount', + 'surplus_count' => 'setSurplusCount', + 'shortage_count' => 'setShortageCount', + 'defect_count' => 'setDefectCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan_count' => 'getPlanCount', + 'fact_count' => 'getFactCount', + 'surplus_count' => 'getSurplusCount', + 'shortage_count' => 'getShortageCount', + 'defect_count' => 'getDefectCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('plan_count', $data ?? [], null); + $this->setIfExists('fact_count', $data ?? [], null); + $this->setIfExists('surplus_count', $data ?? [], null); + $this->setIfExists('shortage_count', $data ?? [], null); + $this->setIfExists('defect_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['plan_count']) && ($this->container['plan_count'] < 0)) { + $invalidProperties[] = "invalid value for 'plan_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['fact_count']) && ($this->container['fact_count'] < 0)) { + $invalidProperties[] = "invalid value for 'fact_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['surplus_count']) && ($this->container['surplus_count'] < 0)) { + $invalidProperties[] = "invalid value for 'surplus_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['shortage_count']) && ($this->container['shortage_count'] < 0)) { + $invalidProperties[] = "invalid value for 'shortage_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['defect_count']) && ($this->container['defect_count'] < 0)) { + $invalidProperties[] = "invalid value for 'defect_count', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan_count + * + * @return int|null + */ + public function getPlanCount() + { + return $this->container['plan_count']; + } + + /** + * Sets plan_count + * + * @param int|null $plan_count Количество товаров в заявке на поставку. + * + * @return self + */ + public function setPlanCount($plan_count) + { + if (is_null($plan_count)) { + throw new \InvalidArgumentException('non-nullable plan_count cannot be null'); + } + + if (($plan_count < 0)) { + throw new \InvalidArgumentException('invalid value for $plan_count when calling SupplyRequestItemCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['plan_count'] = $plan_count; + + return $this; + } + + /** + * Gets fact_count + * + * @return int|null + */ + public function getFactCount() + { + return $this->container['fact_count']; + } + + /** + * Sets fact_count + * + * @param int|null $fact_count Количество товаров, которые приняты на складе. + * + * @return self + */ + public function setFactCount($fact_count) + { + if (is_null($fact_count)) { + throw new \InvalidArgumentException('non-nullable fact_count cannot be null'); + } + + if (($fact_count < 0)) { + throw new \InvalidArgumentException('invalid value for $fact_count when calling SupplyRequestItemCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['fact_count'] = $fact_count; + + return $this; + } + + /** + * Gets surplus_count + * + * @return int|null + */ + public function getSurplusCount() + { + return $this->container['surplus_count']; + } + + /** + * Sets surplus_count + * + * @param int|null $surplus_count Количество лишних товаров. + * + * @return self + */ + public function setSurplusCount($surplus_count) + { + if (is_null($surplus_count)) { + throw new \InvalidArgumentException('non-nullable surplus_count cannot be null'); + } + + if (($surplus_count < 0)) { + throw new \InvalidArgumentException('invalid value for $surplus_count when calling SupplyRequestItemCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['surplus_count'] = $surplus_count; + + return $this; + } + + /** + * Gets shortage_count + * + * @return int|null + */ + public function getShortageCount() + { + return $this->container['shortage_count']; + } + + /** + * Sets shortage_count + * + * @param int|null $shortage_count Количество товаров с недостатками. + * + * @return self + */ + public function setShortageCount($shortage_count) + { + if (is_null($shortage_count)) { + throw new \InvalidArgumentException('non-nullable shortage_count cannot be null'); + } + + if (($shortage_count < 0)) { + throw new \InvalidArgumentException('invalid value for $shortage_count when calling SupplyRequestItemCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['shortage_count'] = $shortage_count; + + return $this; + } + + /** + * Gets defect_count + * + * @return int|null + */ + public function getDefectCount() + { + return $this->container['defect_count']; + } + + /** + * Sets defect_count + * + * @param int|null $defect_count Количество товаров с браком. + * + * @return self + */ + public function setDefectCount($defect_count) + { + if (is_null($defect_count)) { + throw new \InvalidArgumentException('non-nullable defect_count cannot be null'); + } + + if (($defect_count < 0)) { + throw new \InvalidArgumentException('invalid value for $defect_count when calling SupplyRequestItemCountersDTO., must be bigger than or equal to 0.'); + } + + $this->container['defect_count'] = $defect_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestItemDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestItemDTO.php new file mode 100644 index 00000000..b7a75af2 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestItemDTO.php @@ -0,0 +1,543 @@ + + */ +class SupplyRequestItemDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestItemDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offer_id' => 'string', + 'name' => 'string', + 'price' => '\OpenAPI\Client\Model\CurrencyValueDTO', + 'counters' => '\OpenAPI\Client\Model\SupplyRequestItemCountersDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offer_id' => null, + 'name' => null, + 'price' => null, + 'counters' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_id' => false, + 'name' => false, + 'price' => false, + 'counters' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'offer_id' => 'offerId', + 'name' => 'name', + 'price' => 'price', + 'counters' => 'counters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offer_id' => 'setOfferId', + 'name' => 'setName', + 'price' => 'setPrice', + 'counters' => 'setCounters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offer_id' => 'getOfferId', + 'name' => 'getName', + 'price' => 'getPrice', + 'counters' => 'getCounters' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('offer_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('counters', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['offer_id'] === null) { + $invalidProperties[] = "'offer_id' can't be null"; + } + if ((mb_strlen($this->container['offer_id']) > 255)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['offer_id']) < 1)) { + $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['counters'] === null) { + $invalidProperties[] = "'counters' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets offer_id + * + * @return string + */ + public function getOfferId() + { + return $this->container['offer_id']; + } + + /** + * Sets offer_id + * + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * + * @return self + */ + public function setOfferId($offer_id) + { + if (is_null($offer_id)) { + throw new \InvalidArgumentException('non-nullable offer_id cannot be null'); + } + if ((mb_strlen($offer_id) > 255)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling SupplyRequestItemDTO., must be smaller than or equal to 255.'); + } + if ((mb_strlen($offer_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $offer_id when calling SupplyRequestItemDTO., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling SupplyRequestItemDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + } + + $this->container['offer_id'] = $offer_id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Название товара. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets price + * + * @return \OpenAPI\Client\Model\CurrencyValueDTO|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param \OpenAPI\Client\Model\CurrencyValueDTO|null $price price + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets counters + * + * @return \OpenAPI\Client\Model\SupplyRequestItemCountersDTO + */ + public function getCounters() + { + return $this->container['counters']; + } + + /** + * Sets counters + * + * @param \OpenAPI\Client\Model\SupplyRequestItemCountersDTO $counters counters + * + * @return self + */ + public function setCounters($counters) + { + if (is_null($counters)) { + throw new \InvalidArgumentException('non-nullable counters cannot be null'); + } + $this->container['counters'] = $counters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestLocationAddressDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestLocationAddressDTO.php new file mode 100644 index 00000000..270bc8ea --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestLocationAddressDTO.php @@ -0,0 +1,450 @@ + + */ +class SupplyRequestLocationAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestLocationAddressDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'full_address' => 'string', + 'gps' => '\OpenAPI\Client\Model\GpsDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'full_address' => null, + 'gps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'full_address' => false, + 'gps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'full_address' => 'fullAddress', + 'gps' => 'gps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'full_address' => 'setFullAddress', + 'gps' => 'setGps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'full_address' => 'getFullAddress', + 'gps' => 'getGps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('full_address', $data ?? [], null); + $this->setIfExists('gps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['full_address'] === null) { + $invalidProperties[] = "'full_address' can't be null"; + } + if ($this->container['gps'] === null) { + $invalidProperties[] = "'gps' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets full_address + * + * @return string + */ + public function getFullAddress() + { + return $this->container['full_address']; + } + + /** + * Sets full_address + * + * @param string $full_address Полный адрес склада или ПВЗ. + * + * @return self + */ + public function setFullAddress($full_address) + { + if (is_null($full_address)) { + throw new \InvalidArgumentException('non-nullable full_address cannot be null'); + } + $this->container['full_address'] = $full_address; + + return $this; + } + + /** + * Gets gps + * + * @return \OpenAPI\Client\Model\GpsDTO + */ + public function getGps() + { + return $this->container['gps']; + } + + /** + * Sets gps + * + * @param \OpenAPI\Client\Model\GpsDTO $gps gps + * + * @return self + */ + public function setGps($gps) + { + if (is_null($gps)) { + throw new \InvalidArgumentException('non-nullable gps cannot be null'); + } + $this->container['gps'] = $gps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestLocationDTO.php b/erp24/lib/yandex_market_api/Model/SupplyRequestLocationDTO.php new file mode 100644 index 00000000..a1c2bf7e --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestLocationDTO.php @@ -0,0 +1,558 @@ + + */ +class SupplyRequestLocationDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestLocationDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requested_date' => '\DateTime', + 'service_id' => 'int', + 'name' => 'string', + 'address' => '\OpenAPI\Client\Model\SupplyRequestLocationAddressDTO', + 'type' => '\OpenAPI\Client\Model\SupplyRequestLocationType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requested_date' => 'date-time', + 'service_id' => 'int64', + 'name' => null, + 'address' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'requested_date' => false, + 'service_id' => false, + 'name' => false, + 'address' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requested_date' => 'requestedDate', + 'service_id' => 'serviceId', + 'name' => 'name', + 'address' => 'address', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requested_date' => 'setRequestedDate', + 'service_id' => 'setServiceId', + 'name' => 'setName', + 'address' => 'setAddress', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requested_date' => 'getRequestedDate', + 'service_id' => 'getServiceId', + 'name' => 'getName', + 'address' => 'getAddress', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('requested_date', $data ?? [], null); + $this->setIfExists('service_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['service_id'] === null) { + $invalidProperties[] = "'service_id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets requested_date + * + * @return \DateTime|null + */ + public function getRequestedDate() + { + return $this->container['requested_date']; + } + + /** + * Sets requested_date + * + * @param \DateTime|null $requested_date Дата и время поставки на склад или в ПВЗ. + * + * @return self + */ + public function setRequestedDate($requested_date) + { + if (is_null($requested_date)) { + throw new \InvalidArgumentException('non-nullable requested_date cannot be null'); + } + $this->container['requested_date'] = $requested_date; + + return $this; + } + + /** + * Gets service_id + * + * @return int + */ + public function getServiceId() + { + return $this->container['service_id']; + } + + /** + * Sets service_id + * + * @param int $service_id Идентификатор склада или логистического партнера ПВЗ. + * + * @return self + */ + public function setServiceId($service_id) + { + if (is_null($service_id)) { + throw new \InvalidArgumentException('non-nullable service_id cannot be null'); + } + $this->container['service_id'] = $service_id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Название склада или ПВЗ. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets address + * + * @return \OpenAPI\Client\Model\SupplyRequestLocationAddressDTO + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \OpenAPI\Client\Model\SupplyRequestLocationAddressDTO $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\SupplyRequestLocationType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\SupplyRequestLocationType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestLocationType.php b/erp24/lib/yandex_market_api/Model/SupplyRequestLocationType.php new file mode 100644 index 00000000..9fb7cd53 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestLocationType.php @@ -0,0 +1,66 @@ + + */ +class SupplyRequestReferenceDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestReferenceDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => '\OpenAPI\Client\Model\SupplyRequestIdDTO', + 'type' => '\OpenAPI\Client\Model\SupplyRequestReferenceType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return \OpenAPI\Client\Model\SupplyRequestIdDTO + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param \OpenAPI\Client\Model\SupplyRequestIdDTO $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\SupplyRequestReferenceType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\SupplyRequestReferenceType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestReferenceType.php b/erp24/lib/yandex_market_api/Model/SupplyRequestReferenceType.php new file mode 100644 index 00000000..c9edcb73 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestReferenceType.php @@ -0,0 +1,69 @@ + + */ +class SupplyRequestSortingDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SupplyRequestSortingDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'direction' => '\OpenAPI\Client\Model\SortOrderType', + 'attribute' => '\OpenAPI\Client\Model\SupplyRequestSortAttributeType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'direction' => null, + 'attribute' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'direction' => false, + 'attribute' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'direction' => 'direction', + 'attribute' => 'attribute' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'direction' => 'setDirection', + 'attribute' => 'setAttribute' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'direction' => 'getDirection', + 'attribute' => 'getAttribute' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('direction', $data ?? [], null); + $this->setIfExists('attribute', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['direction'] === null) { + $invalidProperties[] = "'direction' can't be null"; + } + if ($this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets direction + * + * @return \OpenAPI\Client\Model\SortOrderType + */ + public function getDirection() + { + return $this->container['direction']; + } + + /** + * Sets direction + * + * @param \OpenAPI\Client\Model\SortOrderType $direction direction + * + * @return self + */ + public function setDirection($direction) + { + if (is_null($direction)) { + throw new \InvalidArgumentException('non-nullable direction cannot be null'); + } + $this->container['direction'] = $direction; + + return $this; + } + + /** + * Gets attribute + * + * @return \OpenAPI\Client\Model\SupplyRequestSortAttributeType + */ + public function getAttribute() + { + return $this->container['attribute']; + } + + /** + * Sets attribute + * + * @param \OpenAPI\Client\Model\SupplyRequestSortAttributeType $attribute attribute + * + * @return self + */ + public function setAttribute($attribute) + { + if (is_null($attribute)) { + throw new \InvalidArgumentException('non-nullable attribute cannot be null'); + } + $this->container['attribute'] = $attribute; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/SupplyRequestStatusType.php b/erp24/lib/yandex_market_api/Model/SupplyRequestStatusType.php new file mode 100644 index 00000000..01e8d1d6 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/SupplyRequestStatusType.php @@ -0,0 +1,111 @@ + '\OpenAPI\Client\Model\TariffType', 'percent' => 'float', 'amount' => 'float', + 'currency' => '\OpenAPI\Client\Model\CurrencyType', 'parameters' => '\OpenAPI\Client\Model\TariffParameterDTO[]' ]; @@ -75,6 +76,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => null, 'percent' => null, 'amount' => null, + 'currency' => null, 'parameters' => null ]; @@ -87,6 +89,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => false, 'percent' => false, 'amount' => false, + 'currency' => false, 'parameters' => false ]; @@ -179,6 +182,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => 'type', 'percent' => 'percent', 'amount' => 'amount', + 'currency' => 'currency', 'parameters' => 'parameters' ]; @@ -191,6 +195,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => 'setType', 'percent' => 'setPercent', 'amount' => 'setAmount', + 'currency' => 'setCurrency', 'parameters' => 'setParameters' ]; @@ -203,6 +208,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => 'getType', 'percent' => 'getPercent', 'amount' => 'getAmount', + 'currency' => 'getCurrency', 'parameters' => 'getParameters' ]; @@ -258,14 +264,15 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('type', $data ?? [], null); $this->setIfExists('percent', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('parameters', $data ?? [], null); } @@ -302,6 +309,9 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['amount'] === null) { $invalidProperties[] = "'amount' can't be null"; } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } if ($this->container['parameters'] === null) { $invalidProperties[] = "'parameters' can't be null"; } @@ -361,7 +371,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets percent * - * @param float|null $percent {% note warning \"\" %} Этот параметр устарел. Не используйте его. {% endnote %} Значение тарифа в процентах. + * @param float|null $percent Значение тарифа в процентах. * * @return self * @deprecated @@ -389,7 +399,7 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets amount * - * @param float $amount Значение тарифа в рублях. + * @param float $amount Значение тарифа. * * @return self */ @@ -403,6 +413,33 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets currency + * + * @return \OpenAPI\Client\Model\CurrencyType + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \OpenAPI\Client\Model\CurrencyType $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + /** * Gets parameters * @@ -432,11 +469,11 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -444,12 +481,12 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -474,11 +511,11 @@ class TariffDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/TariffParameterDTO.php b/erp24/lib/yandex_market_api/Model/TariffParameterDTO.php index bbd82182..a3ed72a4 100644 --- a/erp24/lib/yandex_market_api/Model/TariffParameterDTO.php +++ b/erp24/lib/yandex_market_api/Model/TariffParameterDTO.php @@ -2,7 +2,7 @@ /** * TariffParameterDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class TariffParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); @@ -359,11 +359,11 @@ class TariffParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class TariffParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class TariffParameterDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/TariffType.php b/erp24/lib/yandex_market_api/Model/TariffType.php index a0a4da18..acf7f05f 100644 --- a/erp24/lib/yandex_market_api/Model/TariffType.php +++ b/erp24/lib/yandex_market_api/Model/TariffType.php @@ -2,7 +2,7 @@ /** * TariffType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * TariffType Class Doc Comment * * @category Class - * @description Услуга Маркета или дополнительный тариф к услуге размещения: * `AGENCY_COMMISSION` — прием платежа покупателя. * `PAYMENT_TRANSFER` — перевод платежа покупателя. * `STORAGE` — хранение товара на складе Маркета в течение суток. * `SURPLUS` — хранение излишков на складе Маркета. * `WITHDRAW` — вывоз товара со склада Маркета. * `FEE` — размещение товара на Маркете. * `DELIVERY_TO_CUSTOMER` — доставка покупателю. * `CROSSREGIONAL_DELIVERY` — доставка в федеральный округ, город или населенный пункт. * `CROSSREGIONAL_DELIVERY_RETURN` — доставка невыкупов и возвратов. * `DISPOSAL` — утилизация. * `SORTING_CENTER_STORAGE` — хранение невыкупов и возвратов. * `EXPRESS_DELIVERY` — экспресс-доставка покупателю. * `FF_XDOC_SUPPLY_BOX` — поставка товара через транзитный склад (за короб). * `FF_XDOC_SUPPLY_PALLET` — поставка товара через транзитный склад (за палету). * `SORTING` — обработка заказа. * `MIDDLE_MILE` — средняя миля. * `RETURN_PROCESSING` — обработка невыкупов и возвратов. * `EXPRESS_CANCELLED_BY_PARTNER` — отмена заказа с экспресс-доставкой. * `DELIVERY_TO_CUSTOMER_RETURN` — возврат доставляемого товара на склад. * `CROSSBORDER_DELIVERY` — доставка из-за рубежа. * `INTAKE_SORTING_BULKY_CARGO` — сортировка заказов с крупногабаритными товарами, которые Маркет забрал со склада продавца. * `INTAKE_SORTING_SMALL_GOODS` — сортировка заказов с малогабаритными товарами, которые Маркет забрал со склада продавца. * `INTAKE_SORTING_DAILY` — организация забора заказов со склада продавца. * `FF_STORAGE_BILLING` — хранения товаров на складе. * `CANCELLED_ORDER_FEE_QI` — отмена заказа по вине продавца. * `LATE_ORDER_EXECUTION_FEE_QI` — несвоевременная отгрузка или доставка. Подробнее об услугах Маркета читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/introduction/rates/index.html). + * @description Услуга Маркета или дополнительный тариф к услуге размещения: * `AGENCY_COMMISSION` — прием платежа покупателя. * `PAYMENT_TRANSFER` — перевод платежа покупателя. * `STORAGE` — хранение товара на складе Маркета в течение суток. * `SURPLUS` — хранение излишков на складе Маркета. * `WITHDRAW` — вывоз товара со склада Маркета. * `FEE` — размещение товара на Маркете. * `DELIVERY_TO_CUSTOMER` — доставка покупателю. * `CROSSREGIONAL_DELIVERY` — доставка в федеральный округ, город или населенный пункт. * `CROSSREGIONAL_DELIVERY_RETURN` — доставка невыкупов и возвратов. * `DISPOSAL` — утилизация. * `SORTING_CENTER_STORAGE` — хранение невыкупов и возвратов. * `EXPRESS_DELIVERY` — экспресс-доставка покупателю. * `FF_XDOC_SUPPLY_BOX` — поставка товара через транзитный склад (за короб). * `FF_XDOC_SUPPLY_PALLET` — поставка товара через транзитный склад (за палету). * `SORTING` — обработка заказа. * `MIDDLE_MILE` — средняя миля. * `RETURN_PROCESSING` — обработка невыкупов и возвратов. * `EXPRESS_CANCELLED_BY_PARTNER` — отмена заказа с экспресс-доставкой. * `CROSSBORDER_DELIVERY` — доставка из-за рубежа. * `INTAKE_SORTING_BULKY_CARGO` — сортировка заказов с крупногабаритными товарами, которые Маркет забрал со склада продавца. * `INTAKE_SORTING_SMALL_GOODS` — сортировка заказов с малогабаритными товарами, которые Маркет забрал со склада продавца. * `INTAKE_SORTING_DAILY` — организация забора заказов со склада продавца. * `FF_STORAGE_BILLING` — хранение товаров на складе. * `CANCELLED_ORDER_FEE_QI` — отмена заказа по вине продавца. * `LATE_ORDER_EXECUTION_FEE_QI` — несвоевременная отгрузка или доставка. * `VOLUME_STORAGE` — стоимость хранения товара на складе — из расчёта за один кубический метр в сутки. * `GOODS_ACCEPTANCE` — окончательная приемка товара на складе. * `CARGO_ACCEPTANCE` — первичная приемка товара на складе. * `ORDER_PROCESSING` — обработка заказа. * `WITHDRAW_EXTERNAL` — отгрузка на внешний маркетплейс. Подробнее об услугах Маркета читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/introduction/rates/index.html). * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -79,8 +79,6 @@ class TariffType public const EXPRESS_CANCELLED_BY_PARTNER = 'EXPRESS_CANCELLED_BY_PARTNER'; - public const DELIVERY_TO_CUSTOMER_RETURN = 'DELIVERY_TO_CUSTOMER_RETURN'; - public const CROSSBORDER_DELIVERY = 'CROSSBORDER_DELIVERY'; public const INTAKE_SORTING_BULKY_CARGO = 'INTAKE_SORTING_BULKY_CARGO'; @@ -95,6 +93,16 @@ class TariffType public const LATE_ORDER_EXECUTION_FEE_QI = 'LATE_ORDER_EXECUTION_FEE_QI'; + public const VOLUME_STORAGE = 'VOLUME_STORAGE'; + + public const GOODS_ACCEPTANCE = 'GOODS_ACCEPTANCE'; + + public const CARGO_ACCEPTANCE = 'CARGO_ACCEPTANCE'; + + public const ORDER_PROCESSING = 'ORDER_PROCESSING'; + + public const WITHDRAW_EXTERNAL = 'WITHDRAW_EXTERNAL'; + /** * Gets allowable values of the enum * @return string[] @@ -120,14 +128,18 @@ class TariffType self::MIDDLE_MILE, self::RETURN_PROCESSING, self::EXPRESS_CANCELLED_BY_PARTNER, - self::DELIVERY_TO_CUSTOMER_RETURN, self::CROSSBORDER_DELIVERY, self::INTAKE_SORTING_BULKY_CARGO, self::INTAKE_SORTING_SMALL_GOODS, self::INTAKE_SORTING_DAILY, self::FF_STORAGE_BILLING, self::CANCELLED_ORDER_FEE_QI, - self::LATE_ORDER_EXECUTION_FEE_QI + self::LATE_ORDER_EXECUTION_FEE_QI, + self::VOLUME_STORAGE, + self::GOODS_ACCEPTANCE, + self::CARGO_ACCEPTANCE, + self::ORDER_PROCESSING, + self::WITHDRAW_EXTERNAL ]; } } diff --git a/erp24/lib/yandex_market_api/Model/TimePeriodDTO.php b/erp24/lib/yandex_market_api/Model/TimePeriodDTO.php index f3d05372..c2e8eee7 100644 --- a/erp24/lib/yandex_market_api/Model/TimePeriodDTO.php +++ b/erp24/lib/yandex_market_api/Model/TimePeriodDTO.php @@ -2,7 +2,7 @@ /** * TimePeriodDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class TimePeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('time_period', $data ?? [], null); $this->setIfExists('time_unit', $data ?? [], null); @@ -295,6 +295,10 @@ class TimePeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['time_unit'] === null) { $invalidProperties[] = "'time_unit' can't be null"; } + if (!is_null($this->container['comment']) && (mb_strlen($this->container['comment']) > 500)) { + $invalidProperties[] = "invalid value for 'comment', the character length must be smaller than or equal to 500."; + } + return $invalidProperties; } @@ -386,6 +390,10 @@ class TimePeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($comment)) { throw new \InvalidArgumentException('non-nullable comment cannot be null'); } + if ((mb_strlen($comment) > 500)) { + throw new \InvalidArgumentException('invalid length for $comment when calling TimePeriodDTO., must be smaller than or equal to 500.'); + } + $this->container['comment'] = $comment; return $this; @@ -393,11 +401,11 @@ class TimePeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -405,12 +413,12 @@ class TimePeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -435,11 +443,11 @@ class TimePeriodDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/TimeUnitType.php b/erp24/lib/yandex_market_api/Model/TimeUnitType.php index c6135f40..c7e46779 100644 --- a/erp24/lib/yandex_market_api/Model/TimeUnitType.php +++ b/erp24/lib/yandex_market_api/Model/TimeUnitType.php @@ -2,7 +2,7 @@ /** * TimeUnitType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/TokenDTO.php b/erp24/lib/yandex_market_api/Model/TokenDTO.php new file mode 100644 index 00000000..4a282da1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/TokenDTO.php @@ -0,0 +1,413 @@ + + */ +class TokenDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TokenDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'api_key' => '\OpenAPI\Client\Model\ApiKeyDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'api_key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'api_key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'api_key' => 'apiKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'api_key' => 'setApiKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'api_key' => 'getApiKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('api_key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['api_key'] === null) { + $invalidProperties[] = "'api_key' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets api_key + * + * @return \OpenAPI\Client\Model\ApiKeyDTO + */ + public function getApiKey() + { + return $this->container['api_key']; + } + + /** + * Sets api_key + * + * @param \OpenAPI\Client\Model\ApiKeyDTO $api_key api_key + * + * @return self + */ + public function setApiKey($api_key) + { + if (is_null($api_key)) { + throw new \InvalidArgumentException('non-nullable api_key cannot be null'); + } + $this->container['api_key'] = $api_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/TrackDTO.php b/erp24/lib/yandex_market_api/Model/TrackDTO.php index d04d9feb..d9dadaf3 100644 --- a/erp24/lib/yandex_market_api/Model/TrackDTO.php +++ b/erp24/lib/yandex_market_api/Model/TrackDTO.php @@ -2,7 +2,7 @@ /** * TrackDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class TrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('track_code', $data ?? [], null); } @@ -319,11 +319,11 @@ class TrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class TrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class TrackDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/TransferOrdersFromShipmentRequest.php b/erp24/lib/yandex_market_api/Model/TransferOrdersFromShipmentRequest.php index 9f801199..fcf5b5b0 100644 --- a/erp24/lib/yandex_market_api/Model/TransferOrdersFromShipmentRequest.php +++ b/erp24/lib/yandex_market_api/Model/TransferOrdersFromShipmentRequest.php @@ -2,7 +2,7 @@ /** * TransferOrdersFromShipmentRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class TransferOrdersFromShipmentRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order_ids', $data ?? [], null); } @@ -337,11 +337,11 @@ class TransferOrdersFromShipmentRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class TransferOrdersFromShipmentRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class TransferOrdersFromShipmentRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/TurnoverDTO.php b/erp24/lib/yandex_market_api/Model/TurnoverDTO.php index 538f6333..bd9605fc 100644 --- a/erp24/lib/yandex_market_api/Model/TurnoverDTO.php +++ b/erp24/lib/yandex_market_api/Model/TurnoverDTO.php @@ -2,7 +2,7 @@ /** * TurnoverDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * TurnoverDTO Class Doc Comment * * @category Class - * @description Информация об оборачиваемости товара. + * @description Информация об оборачиваемости товара. Подробнее о хранении и оборачиваемости товаров читайте в [Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/storage/logistics#turnover). * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +246,10 @@ class TurnoverDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('turnover', $data ?? [], null); $this->setIfExists('turnover_days', $data ?? [], null); @@ -340,7 +340,7 @@ class TurnoverDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets turnover_days * - * @param float|null $turnover_days Значение в днях. [Что это за число?](https://yandex.ru/support/marketplace/analytics/turnover.html) + * @param float|null $turnover_days Значение в днях. * * @return self */ @@ -356,11 +356,11 @@ class TurnoverDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class TurnoverDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class TurnoverDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/TurnoverType.php b/erp24/lib/yandex_market_api/Model/TurnoverType.php index 2ac6897d..349db073 100644 --- a/erp24/lib/yandex_market_api/Model/TurnoverType.php +++ b/erp24/lib/yandex_market_api/Model/TurnoverType.php @@ -2,7 +2,7 @@ /** * TurnoverType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -33,7 +33,7 @@ use \OpenAPI\Client\ObjectSerializer; * TurnoverType Class Doc Comment * * @category Class - * @description Оценка оборачиваемости. |enum|Диапазон оборачиваемости|Комментарий| |-|-|-| |`LOW`|`turnoverDays` ≥ 120|| |`ALMOST_LOW`|100 ≤ `turnoverDays` < 120|| |`HIGH`|45 ≤ `turnoverDays` < 100|| |`VERY_HIGH`|0 ≤ `turnoverDays` < 45|| |`NO_SALES`|—|Продаж нет.| |`FREE_STORE`|Любое значение.|Товары этой категории сейчас хранятся бесплатно.| + * @description Оценка оборачиваемости. |enum|Диапазон оборачиваемости|Комментарий| |-|-|-| |`LOW`|`turnoverDays` ≥ 120|| |`ALMOST_LOW`|100 ≤ `turnoverDays` < 120|| |`HIGH`|45 ≤ `turnoverDays` < 100|| |`VERY_HIGH`|0 ≤ `turnoverDays` < 45|| |`NO_SALES`|—|Продаж нет.| |`FREE_STORE`|Любое значение.|Платить за хранение товаров этой категории не требуется.| * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/erp24/lib/yandex_market_api/Model/TypedQuestionsTextEntityIdDTO.php b/erp24/lib/yandex_market_api/Model/TypedQuestionsTextEntityIdDTO.php new file mode 100644 index 00000000..636deff1 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/TypedQuestionsTextEntityIdDTO.php @@ -0,0 +1,459 @@ + + */ +class TypedQuestionsTextEntityIdDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TypedQuestionsTextEntityIdDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => '\OpenAPI\Client\Model\QuestionsTextEntityType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if (($this->container['id'] < 1)) { + $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 1."; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор вопроса, ответа или комментария. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + if (($id < 1)) { + throw new \InvalidArgumentException('invalid value for $id when calling TypedQuestionsTextEntityIdDTO., must be bigger than or equal to 1.'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\QuestionsTextEntityType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\QuestionsTextEntityType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UinDTO.php b/erp24/lib/yandex_market_api/Model/UinDTO.php new file mode 100644 index 00000000..8649447c --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UinDTO.php @@ -0,0 +1,484 @@ + + */ +class UinDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UinDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'status' => '\OpenAPI\Client\Model\UinStatusType', + 'substatus' => '\OpenAPI\Client\Model\UinSubstatusType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'status' => null, + 'substatus' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => false, + 'status' => false, + 'substatus' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'status' => 'status', + 'substatus' => 'substatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'status' => 'setStatus', + 'substatus' => 'setSubstatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'status' => 'getStatus', + 'substatus' => 'getSubstatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('substatus', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value УИН товара. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\UinStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\UinStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets substatus + * + * @return \OpenAPI\Client\Model\UinSubstatusType|null + */ + public function getSubstatus() + { + return $this->container['substatus']; + } + + /** + * Sets substatus + * + * @param \OpenAPI\Client\Model\UinSubstatusType|null $substatus substatus + * + * @return self + */ + public function setSubstatus($substatus) + { + if (is_null($substatus)) { + throw new \InvalidArgumentException('non-nullable substatus cannot be null'); + } + $this->container['substatus'] = $substatus; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UinStatusType.php b/erp24/lib/yandex_market_api/Model/UinStatusType.php new file mode 100644 index 00000000..1cffa50e --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UinStatusType.php @@ -0,0 +1,69 @@ +setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -396,11 +396,11 @@ class UnitDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +408,12 @@ class UnitDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +438,11 @@ class UnitDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateBusinessOfferPriceDTO.php b/erp24/lib/yandex_market_api/Model/UpdateBusinessOfferPriceDTO.php index 0e208b5c..b73ac74f 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateBusinessOfferPriceDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateBusinessOfferPriceDTO.php @@ -2,7 +2,7 @@ /** * UpdateBusinessOfferPriceDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -59,7 +59,7 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPITypes = [ 'offer_id' => 'string', - 'price' => '\OpenAPI\Client\Model\UpdatePriceWithDiscountDTO' + 'price' => '\OpenAPI\Client\Model\UpdateBusinessPricesDTO' ]; /** @@ -246,10 +246,10 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); @@ -293,8 +293,8 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['price'] === null) { @@ -328,7 +328,7 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -343,8 +343,8 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling UpdateBusinessOfferPriceDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateBusinessOfferPriceDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateBusinessOfferPriceDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -355,7 +355,7 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets price * - * @return \OpenAPI\Client\Model\UpdatePriceWithDiscountDTO + * @return \OpenAPI\Client\Model\UpdateBusinessPricesDTO */ public function getPrice() { @@ -365,7 +365,7 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets price * - * @param \OpenAPI\Client\Model\UpdatePriceWithDiscountDTO $price price + * @param \OpenAPI\Client\Model\UpdateBusinessPricesDTO $price price * * @return self */ @@ -381,11 +381,11 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -393,12 +393,12 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -423,11 +423,11 @@ class UpdateBusinessOfferPriceDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesDTO.php b/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesDTO.php new file mode 100644 index 00000000..706ee800 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesDTO.php @@ -0,0 +1,552 @@ + + */ +class UpdateBusinessPricesDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateBusinessPricesDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'float', + 'currency_id' => '\OpenAPI\Client\Model\CurrencyType', + 'discount_base' => 'float', + 'minimum_for_bestseller' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'currency_id' => null, + 'discount_base' => null, + 'minimum_for_bestseller' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => false, + 'currency_id' => false, + 'discount_base' => false, + 'minimum_for_bestseller' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'currency_id' => 'currencyId', + 'discount_base' => 'discountBase', + 'minimum_for_bestseller' => 'minimumForBestseller' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'currency_id' => 'setCurrencyId', + 'discount_base' => 'setDiscountBase', + 'minimum_for_bestseller' => 'setMinimumForBestseller' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'currency_id' => 'getCurrencyId', + 'discount_base' => 'getDiscountBase', + 'minimum_for_bestseller' => 'getMinimumForBestseller' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('currency_id', $data ?? [], null); + $this->setIfExists('discount_base', $data ?? [], null); + $this->setIfExists('minimum_for_bestseller', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if (($this->container['value'] <= 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than 0."; + } + + if ($this->container['currency_id'] === null) { + $invalidProperties[] = "'currency_id' can't be null"; + } + if (!is_null($this->container['discount_base']) && ($this->container['discount_base'] <= 0)) { + $invalidProperties[] = "invalid value for 'discount_base', must be bigger than 0."; + } + + if (!is_null($this->container['minimum_for_bestseller']) && ($this->container['minimum_for_bestseller'] > 100000000)) { + $invalidProperties[] = "invalid value for 'minimum_for_bestseller', must be smaller than or equal to 100000000."; + } + + if (!is_null($this->container['minimum_for_bestseller']) && ($this->container['minimum_for_bestseller'] <= 0)) { + $invalidProperties[] = "invalid value for 'minimum_for_bestseller', must be bigger than 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return float + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float $value Цена товара. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value <= 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling UpdateBusinessPricesDTO., must be bigger than 0.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency_id + * + * @return \OpenAPI\Client\Model\CurrencyType + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param \OpenAPI\Client\Model\CurrencyType $currency_id currency_id + * + * @return self + */ + public function setCurrencyId($currency_id) + { + if (is_null($currency_id)) { + throw new \InvalidArgumentException('non-nullable currency_id cannot be null'); + } + $this->container['currency_id'] = $currency_id; + + return $this; + } + + /** + * Gets discount_base + * + * @return float|null + */ + public function getDiscountBase() + { + return $this->container['discount_base']; + } + + /** + * Sets discount_base + * + * @param float|null $discount_base Зачеркнутая цена. Число должно быть целым. Вы можете указать цену со скидкой от 5 до 99%. Передавайте этот параметр при каждом обновлении цены, если предоставляете скидку на товар. + * + * @return self + */ + public function setDiscountBase($discount_base) + { + if (is_null($discount_base)) { + throw new \InvalidArgumentException('non-nullable discount_base cannot be null'); + } + + if (($discount_base <= 0)) { + throw new \InvalidArgumentException('invalid value for $discount_base when calling UpdateBusinessPricesDTO., must be bigger than 0.'); + } + + $this->container['discount_base'] = $discount_base; + + return $this; + } + + /** + * Gets minimum_for_bestseller + * + * @return float|null + */ + public function getMinimumForBestseller() + { + return $this->container['minimum_for_bestseller']; + } + + /** + * Sets minimum_for_bestseller + * + * @param float|null $minimum_for_bestseller Минимальная цена товара для попадания в акцию «Бестселлеры Маркета». Подробнее об этом способе участия читайте [в Справке Маркета для продавцов](https://yandex.ru/support/marketplace/ru/marketing/promos/market/bestsellers#minimum). При передаче цены ориентируйтесь на значение параметра `maxPromoPrice` (максимально возможная цена для участия в акции) в методе [POST v2/businesses/{businessId}/promos/offers](../../reference/promos/getPromoOffers.md). Товар не попадет в акцию с помощью этого способа, если: * Не передать этот параметр. Удалится значение, которое вы указали ранее. * В методе [POST v2/businesses/{businessId}/offer-prices](../../reference/prices/getDefaultPrices.md) для этого товара возвращается параметр `excludedFromBestsellers` со значением `true`. Но товар по-прежнему сможет попасть в акцию через [автоматическое участие](*auto) или [ручное добавление](*updatePromoOffers). + * + * @return self + */ + public function setMinimumForBestseller($minimum_for_bestseller) + { + if (is_null($minimum_for_bestseller)) { + throw new \InvalidArgumentException('non-nullable minimum_for_bestseller cannot be null'); + } + + if (($minimum_for_bestseller > 100000000)) { + throw new \InvalidArgumentException('invalid value for $minimum_for_bestseller when calling UpdateBusinessPricesDTO., must be smaller than or equal to 100000000.'); + } + if (($minimum_for_bestseller <= 0)) { + throw new \InvalidArgumentException('invalid value for $minimum_for_bestseller when calling UpdateBusinessPricesDTO., must be bigger than 0.'); + } + + $this->container['minimum_for_bestseller'] = $minimum_for_bestseller; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesRequest.php b/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesRequest.php index 0060ec42..933bbe8b 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateBusinessPricesRequest.php @@ -2,7 +2,7 @@ /** * UpdateBusinessPricesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * UpdateBusinessPricesRequest Class Doc Comment * * @category Class - * @description Запрос на установку базовых цен на товары. + * @description Запрос на установку цен, которые действуют во всех магазинах. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -240,10 +240,10 @@ class UpdateBusinessPricesRequest implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -314,7 +314,7 @@ class UpdateBusinessPricesRequest implements ModelInterface, ArrayAccess, \JsonS /** * Sets offers * - * @param \OpenAPI\Client\Model\UpdateBusinessOfferPriceDTO[] $offers Список товаров с ценами. + * @param \OpenAPI\Client\Model\UpdateBusinessOfferPriceDTO[] $offers Список товаров с ценами. В рамках одного запроса все значения `offerId` должны быть уникальными. Не допускается передача двух объектов с одинаковым `offerId`. * * @return self */ @@ -337,11 +337,11 @@ class UpdateBusinessPricesRequest implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdateBusinessPricesRequest implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdateBusinessPricesRequest implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateCampaignOfferDTO.php b/erp24/lib/yandex_market_api/Model/UpdateCampaignOfferDTO.php index 281150f0..2ec661f8 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateCampaignOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateCampaignOfferDTO.php @@ -2,7 +2,7 @@ /** * UpdateCampaignOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('quantum', $data ?? [], null); @@ -307,8 +307,8 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -339,7 +339,7 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -354,8 +354,8 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling UpdateCampaignOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateCampaignOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateCampaignOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -367,6 +367,7 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * Gets quantum * * @return \OpenAPI\Client\Model\QuantumDTO|null + * @deprecated */ public function getQuantum() { @@ -379,6 +380,7 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * @param \OpenAPI\Client\Model\QuantumDTO|null $quantum quantum * * @return self + * @deprecated */ public function setQuantum($quantum) { @@ -394,6 +396,7 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * Gets available * * @return bool|null + * @deprecated */ public function getAvailable() { @@ -403,9 +406,10 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets available * - * @param bool|null $available Есть ли товар в продаже. + * @param bool|null $available {% note warning \"Вместо него используйте методы скрытия товаров с витрины\" %} * [GET v2/campaigns/{campaignId}/hidden-offers](../../reference/assortment/getHiddenOffers.md) — просмотр скрытых товаров; * [POST v2/campaigns/{campaignId}/hidden-offers](../../reference/assortment/addHiddenOffers.md) — скрытие товаров; * [POST v2/campaigns/{campaignId}/hidden-offers/delete](../../reference/assortment/deleteHiddenOffers.md) — возобновление показа. {% endnote %} Есть ли товар в продаже. * * @return self + * @deprecated */ public function setAvailable($available) { @@ -430,7 +434,7 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets vat * - * @param int|null $vat Ставка НДС, применяемая для товара. Задается цифрой: * `2` — 10%. * `5` — 0%. * `6` — не облагается НДС. * `7` — 20%. Если параметр не указан, используется ставка НДС, установленная в кабинете продавца на Маркете. + * @param int|null $vat Идентификатор НДС, применяемый для товара: * `2` — НДС 10%. Например, используется при реализации отдельных продовольственных и медицинских товаров. * `5` — НДС 0%. Например, используется при продаже товаров, вывезенных в таможенной процедуре экспорта, или при оказании услуг по международной перевозке товаров. * `6` — НДС не облагается, используется только для отдельных видов услуг. * `7` — НДС 20%. Основной НДС с 2019 года до 1 января 2026 года. * `10` — НДС 5%. НДС для упрощенной системы налогообложения (УСН). * `11` — НДС 7%. НДС для упрощенной системы налогообложения (УСН). * `14` — НДС 22%. Основной НДС с 1 января 2026 года. Если параметр не указан, используется НДС, установленный в кабинете. **Для продавцов :no-translate[Market Yandex Go]** недоступна передача и получение НДС. * * @return self */ @@ -446,11 +450,11 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -458,12 +462,12 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -488,11 +492,11 @@ class UpdateCampaignOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateCampaignOffersRequest.php b/erp24/lib/yandex_market_api/Model/UpdateCampaignOffersRequest.php index 8ffed9d8..e2ccd0f9 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateCampaignOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateCampaignOffersRequest.php @@ -2,7 +2,7 @@ /** * UpdateCampaignOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -337,11 +337,11 @@ class UpdateCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdateCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdateCampaignOffersRequest implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateExternalOrderIdRequest.php b/erp24/lib/yandex_market_api/Model/UpdateExternalOrderIdRequest.php new file mode 100644 index 00000000..1bff940a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateExternalOrderIdRequest.php @@ -0,0 +1,422 @@ + + */ +class UpdateExternalOrderIdRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateExternalOrderIdRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'external_order_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'external_order_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'external_order_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'external_order_id' => 'externalOrderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'external_order_id' => 'setExternalOrderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'external_order_id' => 'getExternalOrderId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('external_order_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['external_order_id'] === null) { + $invalidProperties[] = "'external_order_id' can't be null"; + } + if ((mb_strlen($this->container['external_order_id']) < 1)) { + $invalidProperties[] = "invalid value for 'external_order_id', the character length must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets external_order_id + * + * @return string + */ + public function getExternalOrderId() + { + return $this->container['external_order_id']; + } + + /** + * Sets external_order_id + * + * @param string $external_order_id Внешний идентификатор заказа. + * + * @return self + */ + public function setExternalOrderId($external_order_id) + { + if (is_null($external_order_id)) { + throw new \InvalidArgumentException('non-nullable external_order_id cannot be null'); + } + + if ((mb_strlen($external_order_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $external_order_id when calling UpdateExternalOrderIdRequest., must be bigger than or equal to 1.'); + } + + $this->container['external_order_id'] = $external_order_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentDTO.php b/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentDTO.php index 1cceeea6..67856cf7 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentDTO.php @@ -2,7 +2,7 @@ /** * UpdateGoodsFeedbackCommentDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class UpdateGoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \Jso /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('parent_id', $data ?? [], null); @@ -355,7 +355,7 @@ class UpdateGoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \Jso /** * Sets parent_id * - * @param int|null $parent_id Идентификатор комментария к отзыву. + * @param int|null $parent_id Идентификатор родительского комментария, на который нужно ответить. * * @return self */ @@ -382,7 +382,7 @@ class UpdateGoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \Jso /** * Sets text * - * @param string $text Текст комментария. + * @param string $text Текст комментария. Не должен содержать контакты магазина и ссылки на сайты, кроме Маркета. * * @return self */ @@ -405,11 +405,11 @@ class UpdateGoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \Jso /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -417,12 +417,12 @@ class UpdateGoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \Jso /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -447,11 +447,11 @@ class UpdateGoodsFeedbackCommentDTO implements ModelInterface, ArrayAccess, \Jso /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentRequest.php b/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentRequest.php index 3f86ea49..0de8871e 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentRequest.php @@ -2,7 +2,7 @@ /** * UpdateGoodsFeedbackCommentRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('feedback_id', $data ?? [], null); $this->setIfExists('comment', $data ?? [], null); @@ -359,11 +359,11 @@ class UpdateGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class UpdateGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class UpdateGoodsFeedbackCommentRequest implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentResponse.php b/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentResponse.php index 95f8739f..a664c62c 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentResponse.php +++ b/erp24/lib/yandex_market_api/Model/UpdateGoodsFeedbackCommentResponse.php @@ -2,7 +2,7 @@ /** * UpdateGoodsFeedbackCommentResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class UpdateGoodsFeedbackCommentResponse implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityDTO.php b/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityDTO.php new file mode 100644 index 00000000..e67c8017 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityDTO.php @@ -0,0 +1,413 @@ + + */ +class UpdateGoodsQuestionTextEntityDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateGoodsQuestionTextEntityDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entity' => '\OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'entity' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity' => 'entity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity' => 'setEntity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity' => 'getEntity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entity', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entity'] === null) { + $invalidProperties[] = "'entity' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entity + * + * @return \OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param \OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO $entity entity + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $this->container['entity'] = $entity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityRequest.php b/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityRequest.php new file mode 100644 index 00000000..56ade176 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityRequest.php @@ -0,0 +1,530 @@ + + */ +class UpdateGoodsQuestionTextEntityRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateGoodsQuestionTextEntityRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entity_id' => '\OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO', + 'parent_entity_id' => '\OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO', + 'text' => 'string', + 'operation_type' => '\OpenAPI\Client\Model\QuestionsTextEntityOperationType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entity_id' => null, + 'parent_entity_id' => null, + 'text' => null, + 'operation_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'entity_id' => false, + 'parent_entity_id' => false, + 'text' => false, + 'operation_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity_id' => 'entityId', + 'parent_entity_id' => 'parentEntityId', + 'text' => 'text', + 'operation_type' => 'operationType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity_id' => 'setEntityId', + 'parent_entity_id' => 'setParentEntityId', + 'text' => 'setText', + 'operation_type' => 'setOperationType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity_id' => 'getEntityId', + 'parent_entity_id' => 'getParentEntityId', + 'text' => 'getText', + 'operation_type' => 'getOperationType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entity_id', $data ?? [], null); + $this->setIfExists('parent_entity_id', $data ?? [], null); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['text']) && (mb_strlen($this->container['text']) > 5000)) { + $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 5000."; + } + + if (!is_null($this->container['text']) && (mb_strlen($this->container['text']) < 1)) { + $invalidProperties[] = "invalid value for 'text', the character length must be bigger than or equal to 1."; + } + + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entity_id + * + * @return \OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO|null + */ + public function getEntityId() + { + return $this->container['entity_id']; + } + + /** + * Sets entity_id + * + * @param \OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO|null $entity_id entity_id + * + * @return self + */ + public function setEntityId($entity_id) + { + if (is_null($entity_id)) { + throw new \InvalidArgumentException('non-nullable entity_id cannot be null'); + } + $this->container['entity_id'] = $entity_id; + + return $this; + } + + /** + * Gets parent_entity_id + * + * @return \OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO|null + */ + public function getParentEntityId() + { + return $this->container['parent_entity_id']; + } + + /** + * Sets parent_entity_id + * + * @param \OpenAPI\Client\Model\TypedQuestionsTextEntityIdDTO|null $parent_entity_id parent_entity_id + * + * @return self + */ + public function setParentEntityId($parent_entity_id) + { + if (is_null($parent_entity_id)) { + throw new \InvalidArgumentException('non-nullable parent_entity_id cannot be null'); + } + $this->container['parent_entity_id'] = $parent_entity_id; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text Текстовое содержимое. + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + if ((mb_strlen($text) > 5000)) { + throw new \InvalidArgumentException('invalid length for $text when calling UpdateGoodsQuestionTextEntityRequest., must be smaller than or equal to 5000.'); + } + if ((mb_strlen($text) < 1)) { + throw new \InvalidArgumentException('invalid length for $text when calling UpdateGoodsQuestionTextEntityRequest., must be bigger than or equal to 1.'); + } + + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets operation_type + * + * @return \OpenAPI\Client\Model\QuestionsTextEntityOperationType + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param \OpenAPI\Client\Model\QuestionsTextEntityOperationType $operation_type operation_type + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityResponse.php b/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityResponse.php new file mode 100644 index 00000000..a08f7499 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateGoodsQuestionTextEntityResponse.php @@ -0,0 +1,447 @@ + + */ +class UpdateGoodsQuestionTextEntityResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateGoodsQuestionTextEntityResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\UpdateGoodsQuestionTextEntityDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UpdateMappingDTO.php b/erp24/lib/yandex_market_api/Model/UpdateMappingDTO.php index 37836488..ee18df6e 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateMappingDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateMappingDTO.php @@ -2,7 +2,7 @@ /** * UpdateMappingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('market_sku', $data ?? [], null); } @@ -307,7 +307,7 @@ class UpdateMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_sku * - * @param int|null $market_sku SKU на Маркете. + * @param int|null $market_sku Идентификатор карточки товара на Маркете. * * @return self */ @@ -328,11 +328,11 @@ class UpdateMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -340,12 +340,12 @@ class UpdateMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -370,11 +370,11 @@ class UpdateMappingDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateMappingsOfferDTO.php b/erp24/lib/yandex_market_api/Model/UpdateMappingsOfferDTO.php index e913c0ea..76ac7fbb 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateMappingsOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateMappingsOfferDTO.php @@ -2,7 +2,7 @@ /** * UpdateMappingsOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -414,10 +414,10 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('shop_sku', $data ?? [], null); @@ -490,8 +490,8 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $invalidProperties[] = "invalid value for 'shop_sku', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['shop_sku']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { - $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['shop_sku']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['shop_sku'])) { + $invalidProperties[] = "invalid value for 'shop_sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { @@ -506,8 +506,40 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 1."; } - if (!is_null($this->container['id']) && !preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { - $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!is_null($this->container['id']) && !preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['id'])) { + $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['urls']) && (count($this->container['urls']) < 1)) { + $invalidProperties[] = "invalid value for 'urls', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) > 30)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be less than or equal to 30."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) > 5)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be less than or equal to 5."; + } + + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['customs_commodity_codes']) && (count($this->container['customs_commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'customs_commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['supply_schedule_days']) && (count($this->container['supply_schedule_days']) < 1)) { + $invalidProperties[] = "invalid value for 'supply_schedule_days', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -569,7 +601,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets shop_sku * - * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $shop_sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -584,8 +616,8 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial if ((mb_strlen($shop_sku) < 1)) { throw new \InvalidArgumentException('invalid length for $shop_sku when calling UpdateMappingsOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { - throw new \InvalidArgumentException("invalid value for \$shop_sku when calling UpdateMappingsOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($shop_sku)))) { + throw new \InvalidArgumentException("invalid value for \$shop_sku when calling UpdateMappingsOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['shop_sku'] = $shop_sku; @@ -597,6 +629,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -606,9 +639,10 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -687,7 +721,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                                                                                                                  , \\

                                                                                                                  и так далее — для заголовков; * \\
                                                                                                                  и \\

                                                                                                                  — для переноса строки; * \\

                                                                                                                    — для нумерованного списка; * \\
                                                                                                                      — для маркированного списка; * \\
                                                                                                                    • — для создания элементов списка (должен находиться внутри \\
                                                                                                                        или \\
                                                                                                                          ); * \\
                                                                                                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                                                                                          , \\

                                                                                                                          и так далее — для заголовков; * \\
                                                                                                                          и \\

                                                                                                                          — для переноса строки; * \\

                                                                                                                            — для нумерованного списка; * \\
                                                                                                                              — для маркированного списка; * \\
                                                                                                                            • — для создания элементов списка (должен находиться внутри \\
                                                                                                                                или \\
                                                                                                                                  ); * \\
                                                                                                                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -718,7 +752,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets id * - * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string|null $id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -733,8 +767,8 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial if ((mb_strlen($id) < 1)) { throw new \InvalidArgumentException('invalid length for $id when calling UpdateMappingsOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { - throw new \InvalidArgumentException("invalid value for \$id when calling UpdateMappingsOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling UpdateMappingsOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['id'] = $id; @@ -782,7 +816,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -798,6 +832,11 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling UpdateMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -816,7 +855,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets urls * - * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр url. + * @param string[]|null $urls URL фотографии товара или страницы с описанием на вашем сайте. Переданные данные не будут отображаться на витрине, но они помогут специалистам Маркета найти карточку для вашего товара. Должен содержать один вложенный параметр `url`. * * @return self */ @@ -832,6 +871,11 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($urls) && (count($urls) < 1)) { + throw new \InvalidArgumentException('invalid length for $urls when calling UpdateMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['urls'] = $urls; return $this; @@ -850,7 +894,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets pictures * - * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. Обязательный параметр. Должен содержать хотя бы один вложенный параметр `picture`. + * @param string[]|null $pictures Ссылки (URL) изображений товара в хорошем качестве. Можно указать до 30 ссылок. При этом изображение по первой ссылке будет основным. Оно используется в качестве изображения товара в поиске Маркета и на карточке товара. Другие изображения товара доступны в режиме просмотра увеличенных изображений. * * @return self */ @@ -866,6 +910,13 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($pictures) && (count($pictures) > 30)) { + throw new \InvalidArgumentException('invalid value for $pictures when calling UpdateMappingsOfferDTO., number of items must be less than or equal to 30.'); + } + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling UpdateMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -927,6 +978,13 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) > 5)) { + throw new \InvalidArgumentException('invalid value for $manufacturer_countries when calling UpdateMappingsOfferDTO., number of items must be less than or equal to 5.'); + } + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling UpdateMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -990,6 +1048,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * Gets quantum_of_supply * * @return int|null + * @deprecated */ public function getQuantumOfSupply() { @@ -999,9 +1058,10 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets quantum_of_supply * - * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству minShipment. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. + * @param int|null $quantum_of_supply Добавочная партия: по сколько единиц товара можно добавлять к минимальному количеству `minShipment`. Например, если вы поставляете детское питание партиями минимум по 10 коробок и хотите добавлять к минимальной партии по 2 коробки, а в каждой коробке по 6 баночек, укажите значение 12. * * @return self + * @deprecated */ public function setQuantumOfSupply($quantum_of_supply) { @@ -1096,6 +1156,11 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($customs_commodity_codes) && (count($customs_commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $customs_commodity_codes when calling UpdateMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['customs_commodity_codes'] = $customs_commodity_codes; return $this; @@ -1157,6 +1222,11 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($supply_schedule_days) && (count($supply_schedule_days) < 1)) { + throw new \InvalidArgumentException('invalid length for $supply_schedule_days when calling UpdateMappingsOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['supply_schedule_days'] = $supply_schedule_days; return $this; @@ -1166,6 +1236,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * Gets shelf_life_days * * @return int|null + * @deprecated */ public function getShelfLifeDays() { @@ -1175,9 +1246,10 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets shelf_life_days * - * @param int|null $shelf_life_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. + * @param int|null $shelf_life_days {% note warning \"Вместо него используйте `shelfLife`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок годности: через сколько дней товар станет непригоден для использования. * * @return self + * @deprecated */ public function setShelfLifeDays($shelf_life_days) { @@ -1193,6 +1265,7 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial * Gets life_time_days * * @return int|null + * @deprecated */ public function getLifeTimeDays() { @@ -1202,9 +1275,10 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets life_time_days * - * @param int|null $life_time_days {% note warning \"\" %} Этот параметр устарел. Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке. {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. + * @param int|null $life_time_days {% note warning \"Вместо него используйте `lifeTime`. Совместное использование обоих параметров приведет к ошибке.\" %}   {% endnote %} Срок службы: сколько дней товар будет исправно выполнять свою функцию, а изготовитель — нести ответственность за его существенные недостатки. * * @return self + * @deprecated */ public function setLifeTimeDays($life_time_days) { @@ -1407,11 +1481,11 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1419,12 +1493,12 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1449,11 +1523,11 @@ class UpdateMappingsOfferDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferContentRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOfferContentRequest.php index 25bab85f..37760277 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferContentRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferContentRequest.php @@ -2,7 +2,7 @@ /** * UpdateOfferContentRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOfferContentRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers_content', $data ?? [], null); } @@ -337,11 +337,11 @@ class UpdateOfferContentRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdateOfferContentRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdateOfferContentRequest implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferContentResponse.php b/erp24/lib/yandex_market_api/Model/UpdateOfferContentResponse.php index 8295c58c..9ea85288 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferContentResponse.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferContentResponse.php @@ -2,7 +2,7 @@ /** * UpdateOfferContentResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); @@ -282,6 +282,13 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['results']) && (count($this->container['results']) < 1)) { + $invalidProperties[] = "invalid value for 'results', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($results) && (count($results) < 1)) { + throw new \InvalidArgumentException('invalid length for $results when calling UpdateOfferContentResponse., number of items must be greater than or equal to 1.'); + } $this->container['results'] = $results; return $this; @@ -360,11 +372,11 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class UpdateOfferContentResponse implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferContentResultDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOfferContentResultDTO.php index 9f249db9..860ddd0b 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferContentResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferContentResultDTO.php @@ -2,7 +2,7 @@ /** * UpdateOfferContentResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -300,8 +300,16 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['warnings']) && (count($this->container['warnings']) < 1)) { + $invalidProperties[] = "invalid value for 'warnings', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -332,7 +340,7 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -347,8 +355,8 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling UpdateOfferContentResultDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateOfferContentResultDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateOfferContentResultDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -369,7 +377,7 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets errors * - * @param \OpenAPI\Client\Model\OfferContentErrorDTO[]|null $errors Ошибки — информация в каталоге не обновится. + * @param \OpenAPI\Client\Model\OfferContentErrorDTO[]|null $errors Ошибки. Если хотя бы по одному товару есть ошибка, информация в каталоге не обновится по всем переданным товарам. * * @return self */ @@ -385,6 +393,11 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling UpdateOfferContentResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -403,7 +416,7 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets warnings * - * @param \OpenAPI\Client\Model\OfferContentErrorDTO[]|null $warnings Предупреждения — информация в каталоге обновится. + * @param \OpenAPI\Client\Model\OfferContentErrorDTO[]|null $warnings Предупреждения. Информация в каталоге обновится. * * @return self */ @@ -419,6 +432,11 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warnings) && (count($warnings) < 1)) { + throw new \InvalidArgumentException('invalid length for $warnings when calling UpdateOfferContentResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['warnings'] = $warnings; return $this; @@ -426,11 +444,11 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -438,12 +456,12 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -468,11 +486,11 @@ class UpdateOfferContentResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOfferDTO.php index f1bbad7c..234ce52d 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferDTO.php @@ -2,7 +2,7 @@ /** * UpdateOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -76,6 +76,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => '\OpenAPI\Client\Model\TimePeriodDTO', 'guarantee_period' => '\OpenAPI\Client\Model\TimePeriodDTO', 'customs_commodity_code' => 'string', + 'commodity_codes' => '\OpenAPI\Client\Model\CommodityCodeDTO[]', 'certificates' => 'string[]', 'box_count' => 'int', 'condition' => '\OpenAPI\Client\Model\OfferConditionDTO', @@ -85,10 +86,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'age' => '\OpenAPI\Client\Model\AgeDTO', 'params' => '\OpenAPI\Client\Model\OfferParamDTO[]', 'parameter_values' => '\OpenAPI\Client\Model\ParameterValueDTO[]', - 'basic_price' => '\OpenAPI\Client\Model\UpdatePriceWithDiscountDTO', + 'basic_price' => '\OpenAPI\Client\Model\PriceWithDiscountDTO', 'purchase_price' => '\OpenAPI\Client\Model\BasePriceDTO', 'additional_expenses' => '\OpenAPI\Client\Model\BasePriceDTO', - 'cofinance_price' => '\OpenAPI\Client\Model\BasePriceDTO' + 'first_video_as_cover' => 'bool', + 'delete_parameters' => '\OpenAPI\Client\Model\DeleteOfferParameterType[]' ]; /** @@ -117,6 +119,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => null, 'guarantee_period' => null, 'customs_commodity_code' => null, + 'commodity_codes' => null, 'certificates' => null, 'box_count' => 'int32', 'condition' => null, @@ -129,7 +132,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => null, 'purchase_price' => null, 'additional_expenses' => null, - 'cofinance_price' => null + 'first_video_as_cover' => null, + 'delete_parameters' => null ]; /** @@ -156,6 +160,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => false, 'guarantee_period' => false, 'customs_commodity_code' => false, + 'commodity_codes' => true, 'certificates' => true, 'box_count' => false, 'condition' => false, @@ -168,7 +173,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => false, 'purchase_price' => false, 'additional_expenses' => false, - 'cofinance_price' => false + 'first_video_as_cover' => false, + 'delete_parameters' => true ]; /** @@ -275,6 +281,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'lifeTime', 'guarantee_period' => 'guaranteePeriod', 'customs_commodity_code' => 'customsCommodityCode', + 'commodity_codes' => 'commodityCodes', 'certificates' => 'certificates', 'box_count' => 'boxCount', 'condition' => 'condition', @@ -287,7 +294,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => 'basicPrice', 'purchase_price' => 'purchasePrice', 'additional_expenses' => 'additionalExpenses', - 'cofinance_price' => 'cofinancePrice' + 'first_video_as_cover' => 'firstVideoAsCover', + 'delete_parameters' => 'deleteParameters' ]; /** @@ -314,6 +322,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'setLifeTime', 'guarantee_period' => 'setGuaranteePeriod', 'customs_commodity_code' => 'setCustomsCommodityCode', + 'commodity_codes' => 'setCommodityCodes', 'certificates' => 'setCertificates', 'box_count' => 'setBoxCount', 'condition' => 'setCondition', @@ -326,7 +335,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => 'setBasicPrice', 'purchase_price' => 'setPurchasePrice', 'additional_expenses' => 'setAdditionalExpenses', - 'cofinance_price' => 'setCofinancePrice' + 'first_video_as_cover' => 'setFirstVideoAsCover', + 'delete_parameters' => 'setDeleteParameters' ]; /** @@ -353,6 +363,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'life_time' => 'getLifeTime', 'guarantee_period' => 'getGuaranteePeriod', 'customs_commodity_code' => 'getCustomsCommodityCode', + 'commodity_codes' => 'getCommodityCodes', 'certificates' => 'getCertificates', 'box_count' => 'getBoxCount', 'condition' => 'getCondition', @@ -365,7 +376,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable 'basic_price' => 'getBasicPrice', 'purchase_price' => 'getPurchasePrice', 'additional_expenses' => 'getAdditionalExpenses', - 'cofinance_price' => 'getCofinancePrice' + 'first_video_as_cover' => 'getFirstVideoAsCover', + 'delete_parameters' => 'getDeleteParameters' ]; /** @@ -420,10 +432,10 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -443,6 +455,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('life_time', $data ?? [], null); $this->setIfExists('guarantee_period', $data ?? [], null); $this->setIfExists('customs_commodity_code', $data ?? [], null); + $this->setIfExists('commodity_codes', $data ?? [], null); $this->setIfExists('certificates', $data ?? [], null); $this->setIfExists('box_count', $data ?? [], null); $this->setIfExists('condition', $data ?? [], null); @@ -455,7 +468,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setIfExists('basic_price', $data ?? [], null); $this->setIfExists('purchase_price', $data ?? [], null); $this->setIfExists('additional_expenses', $data ?? [], null); - $this->setIfExists('cofinance_price', $data ?? [], null); + $this->setIfExists('first_video_as_cover', $data ?? [], null); + $this->setIfExists('delete_parameters', $data ?? [], null); } /** @@ -496,30 +510,94 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 256)) { $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256."; } + if (!is_null($this->container['market_category_id']) && ($this->container['market_category_id'] <= 0)) { + $invalidProperties[] = "invalid value for 'market_category_id', must be bigger than 0."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) > 30)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be less than or equal to 30."; + } + + if (!is_null($this->container['pictures']) && (count($this->container['pictures']) < 1)) { + $invalidProperties[] = "invalid value for 'pictures', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['videos']) && (count($this->container['videos']) > 6)) { $invalidProperties[] = "invalid value for 'videos', number of items must be less than or equal to 6."; } + if (!is_null($this->container['videos']) && (count($this->container['videos']) < 1)) { + $invalidProperties[] = "invalid value for 'videos', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) > 6)) { $invalidProperties[] = "invalid value for 'manuals', number of items must be less than or equal to 6."; } + if (!is_null($this->container['manuals']) && (count($this->container['manuals']) < 1)) { + $invalidProperties[] = "invalid value for 'manuals', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['barcodes']) && (count($this->container['barcodes']) < 1)) { + $invalidProperties[] = "invalid value for 'barcodes', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 6000)) { $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 6000."; } + if (!is_null($this->container['manufacturer_countries']) && (count($this->container['manufacturer_countries']) < 1)) { + $invalidProperties[] = "invalid value for 'manufacturer_countries', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) > 50)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 50."; + } + + if (!is_null($this->container['tags']) && (count($this->container['tags']) < 1)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['commodity_codes']) && (count($this->container['commodity_codes']) < 1)) { + $invalidProperties[] = "invalid value for 'commodity_codes', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['certificates']) && (count($this->container['certificates']) > 6)) { + $invalidProperties[] = "invalid value for 'certificates', number of items must be less than or equal to 6."; + } + + if (!is_null($this->container['certificates']) && (count($this->container['certificates']) < 1)) { + $invalidProperties[] = "invalid value for 'certificates', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['box_count']) && ($this->container['box_count'] < 1)) { + $invalidProperties[] = "invalid value for 'box_count', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['params']) && (count($this->container['params']) < 1)) { + $invalidProperties[] = "invalid value for 'params', number of items must be greater than or equal to 1."; + } + if (!is_null($this->container['parameter_values']) && (count($this->container['parameter_values']) > 300)) { $invalidProperties[] = "invalid value for 'parameter_values', number of items must be less than or equal to 300."; } + if (!is_null($this->container['parameter_values']) && (count($this->container['parameter_values']) < 1)) { + $invalidProperties[] = "invalid value for 'parameter_values', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['delete_parameters']) && (count($this->container['delete_parameters']) < 1)) { + $invalidProperties[] = "invalid value for 'delete_parameters', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -548,7 +626,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -563,8 +641,8 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling UpdateOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -616,7 +694,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets market_category_id * - * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. Если не указать `marketCategoryId`, то маркетная категория будет определена автоматически. При изменении информации о товаре передавайте тот же идентификатор категории. Если вы укажете другой, категория товара не поменяется. Изменить ее можно только в кабинете продавца на Маркете. Список категорий Маркета можно получить с помощью запроса [POST categories/tree](../../reference/categories/getCategoriesTree.md). + * @param int|null $market_category_id Идентификатор категории на Маркете, к которой вы относите свой товар. {% note warning \"Всегда указывайте, когда передаете `parameterValues`\" %} Если при изменении характеристик передать `parameterValues` и не указать `marketCategoryId`, характеристики обновятся, но в ответе придет предупреждение (параметр `warnings`). Если не передать их оба, будет использована информация из устаревших параметров `params` и `category`, а `marketCategoryId` будет определен автоматически. {% endnote %} При изменении категории убедитесь, что характеристики товара и их значения в параметре `parameterValues` вы передаете для новой категории. Список категорий Маркета можно получить с помощью запроса [POST v2/categories/tree](../../reference/categories/getCategoriesTree.md). * * @return self */ @@ -625,6 +703,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($market_category_id)) { throw new \InvalidArgumentException('non-nullable market_category_id cannot be null'); } + + if (($market_category_id <= 0)) { + throw new \InvalidArgumentException('invalid value for $market_category_id when calling UpdateOfferDTO., must be bigger than 0.'); + } + $this->container['market_category_id'] = $market_category_id; return $this; @@ -634,6 +717,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets category * * @return string|null + * @deprecated */ public function getCategory() { @@ -643,9 +727,10 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets category * - * @param string|null $category Категория товара в вашем магазине. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. Указывайте конкретные категории — например, набор ножей лучше отнести к категории **Столовые приборы**, а не просто **Посуда**. Выбирайте категории, которые описывают товар, а не абстрактный признак — например, **Духи**, а не **Подарки**. Значение будет использовано для определения категории товара на Маркете в случае, если вы не передали категорию в параметре `marketCategoryId`. + * @param string|null $category {% note warning \"Вместо него используйте `marketCategoryId`.\" %}   {% endnote %} Категория товара в вашем магазине. * * @return self + * @deprecated */ public function setCategory($category) { @@ -670,7 +755,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets pictures * - * @param string[]|null $pictures Ссылки на изображения товара. Изображение по первой ссылке считается основным, остальные дополнительными. **Требования к ссылкам** * Ссылок может быть до 30. * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на изображения и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/images/sku12345.jpg` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/images/sku12345.jpg` ❌ `https://www.dropbox.com/s/818f/tovar.jpg` Ссылки на изображение должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить изображение, выложите новое изображение по новой ссылке, а ссылку на старое удалите. Если просто заменить изображение по старой ссылке, оно не обновится. [Требования к изображениям](https://yandex.ru/support/marketplace/assortment/fields/images.html) + * @param string[]|null $pictures Ссылки на изображения товара. Изображение по первой ссылке считается основным, остальные дополнительными. **Требования к ссылкам** * Указывайте ссылку целиком, включая протокол http или https. * Русские буквы в URL можно. * Можно использовать прямые ссылки на изображения и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/images/sku12345.jpg` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/images/sku12345.jpg` ❌ `https://www.dropbox.com/s/818f/tovar.jpg` Ссылки на изображение должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить изображение, выложите новое изображение по новой ссылке, а ссылку на старое удалите. Если просто заменить изображение по старой ссылке, оно не обновится. [Требования к изображениям](https://yandex.ru/support/marketplace/assortment/fields/images.html) * * @return self */ @@ -686,6 +771,13 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($pictures) && (count($pictures) > 30)) { + throw new \InvalidArgumentException('invalid value for $pictures when calling UpdateOfferDTO., number of items must be less than or equal to 30.'); + } + if (!is_null($pictures) && (count($pictures) < 1)) { + throw new \InvalidArgumentException('invalid length for $pictures when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['pictures'] = $pictures; return $this; @@ -704,7 +796,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets videos * - * @param string[]|null $videos Ссылка (URL) на видео товара. Максимальное количество ссылок — 6. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Максимальная длина — 512 символов. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) + * @param string[]|null $videos Ссылки (URL) на видео товара. **Требования к ссылке** * Указывайте ссылку целиком, включая протокол http или https. * Русские буквы в URL можно. * Можно использовать прямые ссылки на видео и на Яндекс Диск. Ссылки на Яндекс Диске нужно копировать с помощью функции **Поделиться**. Относительные ссылки и ссылки на другие облачные хранилища — не работают. ✅ `https://example-shop.ru/video/sku12345.avi` ✅ `https://yadi.sk/i/NaBoRsimVOLov` ❌ `/video/sku12345.avi` ❌ `https://www.dropbox.com/s/818f/super-tovar.avi` Ссылки на видео должны быть постоянными. Нельзя использовать динамические ссылки, меняющиеся от выгрузки к выгрузке. Если нужно заменить видео, выложите новое видео по новой ссылке, а ссылку на старое удалите. Если просто заменить видео по старой ссылке, оно не обновится. [Требования к видео](https://yandex.ru/support/marketplace/assortment/fields/video.html) * * @return self */ @@ -724,6 +816,9 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (!is_null($videos) && (count($videos) > 6)) { throw new \InvalidArgumentException('invalid value for $videos when calling UpdateOfferDTO., number of items must be less than or equal to 6.'); } + if (!is_null($videos) && (count($videos) < 1)) { + throw new \InvalidArgumentException('invalid length for $videos when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['videos'] = $videos; return $this; @@ -742,7 +837,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets manuals * - * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. Максимальное количество инструкций — 6. Если вы передадите пустое поле `manuals`, загруженные ранее инструкции удалятся. + * @param \OpenAPI\Client\Model\OfferManualDTO[]|null $manuals Список инструкций по использованию товара. * * @return self */ @@ -762,6 +857,9 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (!is_null($manuals) && (count($manuals) > 6)) { throw new \InvalidArgumentException('invalid value for $manuals when calling UpdateOfferDTO., number of items must be less than or equal to 6.'); } + if (!is_null($manuals) && (count($manuals) < 1)) { + throw new \InvalidArgumentException('invalid length for $manuals when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manuals'] = $manuals; return $this; @@ -807,7 +905,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets barcodes * - * @param string[]|null $barcodes Указывайте в виде последовательности цифр. Подойдут коды EAN-13, EAN-8, UPC-A, UPC-E или Code 128. Для книг указывайте ISBN. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом GTIN. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата Code 128 не являются GTIN. [Что такое GTIN](*gtin) + * @param string[]|null $barcodes Штрихкод. Указывайте в виде последовательности цифр. Подойдут коды :no-translate[EAN-13, EAN-8, UPC-A, UPC-E] или :no-translate[Code 128]. Для книг — :no-translate[ISBN]. Для товаров [определенных категорий и торговых марок](https://yastatic.net/s3/doc-binary/src/support/market/ru/yandex-market-list-for-gtin.xlsx) штрихкод должен быть действительным кодом :no-translate[GTIN]. Обратите внимание: внутренние штрихкоды, начинающиеся на 2 или 02, и коды формата :no-translate[Code 128] не являются :no-translate[GTIN]. [Что такое :no-translate[GTIN]](*gtin) * * @return self */ @@ -823,6 +921,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($barcodes) && (count($barcodes) < 1)) { + throw new \InvalidArgumentException('invalid length for $barcodes when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['barcodes'] = $barcodes; return $this; @@ -841,7 +944,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets description * - * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Можно использовать теги: * \\, \\

                                                                                                                                  , \\

                                                                                                                                  и так далее — для заголовков; * \\
                                                                                                                                  и \\

                                                                                                                                  — для переноса строки; * \\

                                                                                                                                    — для нумерованного списка; * \\
                                                                                                                                      — для маркированного списка; * \\
                                                                                                                                    • — для создания элементов списка (должен находиться внутри \\
                                                                                                                                        или \\
                                                                                                                                          ); * \\
                                                                                                                                          — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) + * @param string|null $description Подробное описание товара: например, его преимущества и особенности. Не давайте в описании инструкций по установке и сборке. Не используйте слова «скидка», «распродажа», «дешевый», «подарок» (кроме подарочных категорий), «бесплатно», «акция», «специальная цена», «новинка», «new», «аналог», «заказ», «хит». Не указывайте никакой контактной информации и не давайте ссылок. Для форматирования текста можно использовать теги HTML: * \\, \\

                                                                                                                                          , \\

                                                                                                                                          и так далее — для заголовков; * \\
                                                                                                                                          и \\

                                                                                                                                          — для переноса строки; * \\

                                                                                                                                            — для нумерованного списка; * \\
                                                                                                                                              — для маркированного списка; * \\
                                                                                                                                            • — для создания элементов списка (должен находиться внутри \\
                                                                                                                                                или \\
                                                                                                                                                  ); * \\
                                                                                                                                                  — поддерживается, но не влияет на отображение текста. Оптимальная длина — 400–600 символов. [Рекомендации и правила](https://yandex.ru/support/marketplace/assortment/fields/description.html) * * @return self */ @@ -888,6 +991,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($manufacturer_countries) && (count($manufacturer_countries) < 1)) { + throw new \InvalidArgumentException('invalid length for $manufacturer_countries when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['manufacturer_countries'] = $manufacturer_countries; return $this; @@ -960,7 +1068,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets tags * - * @param string[]|null $tags Метки товара, используемые магазином. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега 20 символов. У одного товара может быть максимум 10 тегов. Всего можно создать не больше 50 разных тегов. + * @param string[]|null $tags Метки товара, которые использует магазин. Покупателям теги не видны. По тегам можно группировать и фильтровать разные товары в каталоге — например, товары одной серии, коллекции или линейки. Максимальная длина тега — 20 символов. У одного товара может быть максимум 10 тегов. * * @return self */ @@ -976,6 +1084,13 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($tags) && (count($tags) > 50)) { + throw new \InvalidArgumentException('invalid value for $tags when calling UpdateOfferDTO., number of items must be less than or equal to 50.'); + } + if (!is_null($tags) && (count($tags) < 1)) { + throw new \InvalidArgumentException('invalid length for $tags when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['tags'] = $tags; return $this; @@ -1066,6 +1181,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable * Gets customs_commodity_code * * @return string|null + * @deprecated */ public function getCustomsCommodityCode() { @@ -1075,9 +1191,10 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets customs_commodity_code * - * @param string|null $customs_commodity_code Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. + * @param string|null $customs_commodity_code {% note warning \"Вместо него используйте `commodityCodes` с типом `CUSTOMS_COMMODITY_CODE`.\" %}   {% endnote %} Код товара в единой Товарной номенклатуре внешнеэкономической деятельности (ТН ВЭД) — 10 или 14 цифр без пробелов. Обязательно укажите, если он есть. * * @return self + * @deprecated */ public function setCustomsCommodityCode($customs_commodity_code) { @@ -1089,6 +1206,45 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable return $this; } + /** + * Gets commodity_codes + * + * @return \OpenAPI\Client\Model\CommodityCodeDTO[]|null + */ + public function getCommodityCodes() + { + return $this->container['commodity_codes']; + } + + /** + * Sets commodity_codes + * + * @param \OpenAPI\Client\Model\CommodityCodeDTO[]|null $commodity_codes Товарные коды. + * + * @return self + */ + public function setCommodityCodes($commodity_codes) + { + if (is_null($commodity_codes)) { + array_push($this->openAPINullablesSetToNull, 'commodity_codes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('commodity_codes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($commodity_codes) && (count($commodity_codes) < 1)) { + throw new \InvalidArgumentException('invalid length for $commodity_codes when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } + $this->container['commodity_codes'] = $commodity_codes; + + return $this; + } + /** * Gets certificates * @@ -1118,6 +1274,13 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + if (!is_null($certificates) && (count($certificates) > 6)) { + throw new \InvalidArgumentException('invalid value for $certificates when calling UpdateOfferDTO., number of items must be less than or equal to 6.'); + } + if (!is_null($certificates) && (count($certificates) < 1)) { + throw new \InvalidArgumentException('invalid length for $certificates when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['certificates'] = $certificates; return $this; @@ -1145,6 +1308,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($box_count)) { throw new \InvalidArgumentException('non-nullable box_count cannot be null'); } + + if (($box_count < 1)) { + throw new \InvalidArgumentException('invalid value for $box_count when calling UpdateOfferDTO., must be bigger than or equal to 1.'); + } + $this->container['box_count'] = $box_count; return $this; @@ -1299,7 +1467,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets params * - * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"\" %} Этот параметр устарел. При передаче характеристик используйте `parameterValues`. {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. + * @param \OpenAPI\Client\Model\OfferParamDTO[]|null $params {% note warning \"При передаче характеристик используйте `parameterValues`.\" %}   {% endnote %} Характеристики, которые есть только у товаров конкретной категории — например, диаметр колес велосипеда или материал подошвы обуви. * * @return self * @deprecated @@ -1316,6 +1484,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($params) && (count($params) < 1)) { + throw new \InvalidArgumentException('invalid length for $params when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['params'] = $params; return $this; @@ -1334,7 +1507,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets parameter_values * - * @param \OpenAPI\Client\Model\ParameterValueDTO[]|null $parameter_values Список характеристик с их значениями. С `parameterValues` обязательно передавайте `marketCategoryId` — идентификатор категории на Маркете, к которой относятся указанные характеристики товара. При **изменении** характеристик передавайте только те, значение которых нужно обновить. Чтобы **удалить** значение заданной характеристики, передайте ее `parameterId` с пустым `value`. Максимальное количество характеристик — 300. + * @param \OpenAPI\Client\Model\ParameterValueDTO[]|null $parameter_values Список характеристик с их значениями. {% note warning \"Всегда передавайте вместе с `marketCategoryId`\" %} Если не передать `marketCategoryId` при изменении характеристик, они обновятся, но в ответе придет предупреждение (параметр `warnings`). Если не передать их оба, будет использована информация из устаревших параметров `params` и `category`, а `marketCategoryId` будет определен автоматически. {% endnote %} При **изменении** характеристик передавайте только те, значение которых нужно обновить. Если в `marketCategoryId` вы меняете категорию, значения общих характеристик для старой и новой категории сохранятся, передавать их не нужно. Подробнее читайте в [«Передача значений характеристики»](../../step-by-step/parameter-values.md). * * @return self */ @@ -1354,6 +1527,9 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (!is_null($parameter_values) && (count($parameter_values) > 300)) { throw new \InvalidArgumentException('invalid value for $parameter_values when calling UpdateOfferDTO., number of items must be less than or equal to 300.'); } + if (!is_null($parameter_values) && (count($parameter_values) < 1)) { + throw new \InvalidArgumentException('invalid length for $parameter_values when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); + } $this->container['parameter_values'] = $parameter_values; return $this; @@ -1362,7 +1538,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets basic_price * - * @return \OpenAPI\Client\Model\UpdatePriceWithDiscountDTO|null + * @return \OpenAPI\Client\Model\PriceWithDiscountDTO|null */ public function getBasicPrice() { @@ -1372,7 +1548,7 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets basic_price * - * @param \OpenAPI\Client\Model\UpdatePriceWithDiscountDTO|null $basic_price basic_price + * @param \OpenAPI\Client\Model\PriceWithDiscountDTO|null $basic_price basic_price * * @return self */ @@ -1441,39 +1617,80 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable } /** - * Gets cofinance_price + * Gets first_video_as_cover * - * @return \OpenAPI\Client\Model\BasePriceDTO|null + * @return bool|null + * @deprecated */ - public function getCofinancePrice() + public function getFirstVideoAsCover() { - return $this->container['cofinance_price']; + return $this->container['first_video_as_cover']; } /** - * Sets cofinance_price + * Sets first_video_as_cover * - * @param \OpenAPI\Client\Model\BasePriceDTO|null $cofinance_price cofinance_price + * @param bool|null $first_video_as_cover Использовать первое видео в карточке как видеообложку. Передайте `true`, чтобы первое видео использовалось как видеообложка, или `false`, чтобы видеообложка не отображалась в карточке товара. * * @return self + * @deprecated */ - public function setCofinancePrice($cofinance_price) + public function setFirstVideoAsCover($first_video_as_cover) { - if (is_null($cofinance_price)) { - throw new \InvalidArgumentException('non-nullable cofinance_price cannot be null'); + if (is_null($first_video_as_cover)) { + throw new \InvalidArgumentException('non-nullable first_video_as_cover cannot be null'); + } + $this->container['first_video_as_cover'] = $first_video_as_cover; + + return $this; + } + + /** + * Gets delete_parameters + * + * @return \OpenAPI\Client\Model\DeleteOfferParameterType[]|null + */ + public function getDeleteParameters() + { + return $this->container['delete_parameters']; + } + + /** + * Sets delete_parameters + * + * @param \OpenAPI\Client\Model\DeleteOfferParameterType[]|null $delete_parameters Параметры, которые вы ранее передали в `UpdateOfferDTO`, а теперь хотите удалить. Если передать `adult`, `downloadable` и `firstVideoAsCover`, они не удалятся — их значение изменится на `false`. Можно передать сразу несколько значений. Не используйте вместе с соответствующим параметром в `UpdateOfferDTO`. Это приведет к ошибке `400`. + * + * @return self + */ + public function setDeleteParameters($delete_parameters) + { + if (is_null($delete_parameters)) { + array_push($this->openAPINullablesSetToNull, 'delete_parameters'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('delete_parameters', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + + if (!is_null($delete_parameters) && (count($delete_parameters) < 1)) { + throw new \InvalidArgumentException('invalid length for $delete_parameters when calling UpdateOfferDTO., number of items must be greater than or equal to 1.'); } - $this->container['cofinance_price'] = $cofinance_price; + $this->container['delete_parameters'] = $delete_parameters; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -1481,12 +1698,12 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -1511,11 +1728,11 @@ class UpdateOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingDTO.php index 4b199c19..b0c8ece1 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingDTO.php @@ -2,7 +2,7 @@ /** * UpdateOfferMappingDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer', $data ?? [], null); $this->setIfExists('mapping', $data ?? [], null); @@ -356,11 +356,11 @@ class UpdateOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -368,12 +368,12 @@ class UpdateOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -398,11 +398,11 @@ class UpdateOfferMappingDTO implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryDTO.php index 06160eb4..a52873a7 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryDTO.php @@ -2,7 +2,7 @@ /** * UpdateOfferMappingEntryDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -35,7 +35,7 @@ use \OpenAPI\Client\ObjectSerializer; * UpdateOfferMappingEntryDTO Class Doc Comment * * @category Class - * @description Список товаров. В теле запроса можно передать от одного до 500 товаров. Обязательный параметр. + * @description Список товаров. * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -258,10 +258,10 @@ class UpdateOfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('mapping', $data ?? [], null); $this->setIfExists('awaiting_moderation_mapping', $data ?? [], null); @@ -421,11 +421,11 @@ class UpdateOfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -433,12 +433,12 @@ class UpdateOfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -463,11 +463,11 @@ class UpdateOfferMappingEntryDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryRequest.php index 090eb7d7..eafd4b5b 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingEntryRequest.php @@ -2,7 +2,7 @@ /** * UpdateOfferMappingEntryRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOfferMappingEntryRequest implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_mapping_entries', $data ?? [], null); } @@ -337,11 +337,11 @@ class UpdateOfferMappingEntryRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdateOfferMappingEntryRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdateOfferMappingEntryRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingResultDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingResultDTO.php index 030d9266..7bed6339 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingResultDTO.php @@ -2,7 +2,7 @@ /** * UpdateOfferMappingResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); @@ -300,8 +300,16 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + } + + if (!is_null($this->container['errors']) && (count($this->container['errors']) < 1)) { + $invalidProperties[] = "invalid value for 'errors', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['warnings']) && (count($this->container['warnings']) < 1)) { + $invalidProperties[] = "invalid value for 'warnings', number of items must be greater than or equal to 1."; } return $invalidProperties; @@ -332,7 +340,7 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -347,8 +355,8 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling UpdateOfferMappingResultDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateOfferMappingResultDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdateOfferMappingResultDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -369,7 +377,7 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets errors * - * @param \OpenAPI\Client\Model\OfferMappingErrorDTO[]|null $errors Ошибки — информация в каталоге не обновится. + * @param \OpenAPI\Client\Model\OfferMappingErrorDTO[]|null $errors Ошибки. Если хотя бы по одному товару есть ошибка, информация в каталоге не обновится по всем переданным товарам. * * @return self */ @@ -385,6 +393,11 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($errors) && (count($errors) < 1)) { + throw new \InvalidArgumentException('invalid length for $errors when calling UpdateOfferMappingResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['errors'] = $errors; return $this; @@ -403,7 +416,7 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Sets warnings * - * @param \OpenAPI\Client\Model\OfferMappingErrorDTO[]|null $warnings Предупреждения — информация в каталоге обновится. + * @param \OpenAPI\Client\Model\OfferMappingErrorDTO[]|null $warnings Предупреждения. Информация в каталоге обновится. * * @return self */ @@ -419,6 +432,11 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warnings) && (count($warnings) < 1)) { + throw new \InvalidArgumentException('invalid length for $warnings when calling UpdateOfferMappingResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['warnings'] = $warnings; return $this; @@ -426,11 +444,11 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -438,12 +456,12 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -468,11 +486,11 @@ class UpdateOfferMappingResultDTO implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsRequest.php index 7085f416..7353dada 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsRequest.php @@ -2,7 +2,7 @@ /** * UpdateOfferMappingsRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class UpdateOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_mappings', $data ?? [], null); $this->setIfExists('only_partner_media_content', $data ?? [], null); @@ -320,7 +320,7 @@ class UpdateOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Sets offer_mappings * - * @param \OpenAPI\Client\Model\UpdateOfferMappingDTO[] $offer_mappings Перечень товаров, которые нужно добавить или обновить. + * @param \OpenAPI\Client\Model\UpdateOfferMappingDTO[] $offer_mappings Список товаров, которые нужно добавить или обновить. {% note warning \"Скоро мы уменьшим максимальное количество товаров в запросе\" %} Уже сейчас не передавайте больше 100. {% endnote %}   * * @return self */ @@ -354,7 +354,7 @@ class UpdateOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Sets only_partner_media_content * - * @param bool|null $only_partner_media_content Будут использоваться только переданные вами изображения товаров. Значение по умолчанию — `false`. Если вы хотите заменить изображения, которые добавил Маркет, передайте значение `true`. + * @param bool|null $only_partner_media_content Будут ли использоваться только переданные вами данные о товарах. Значение по умолчанию: `false`. Чтобы удалить данные, которые добавил Маркет, передайте значение `true`. * * @return self */ @@ -370,11 +370,11 @@ class UpdateOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -382,12 +382,12 @@ class UpdateOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -412,11 +412,11 @@ class UpdateOfferMappingsRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsResponse.php b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsResponse.php index ee8f730b..896ebd80 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsResponse.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOfferMappingsResponse.php @@ -2,7 +2,7 @@ /** * UpdateOfferMappingsResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); @@ -282,6 +282,13 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!is_null($this->container['results']) && (count($this->container['results']) < 1)) { + $invalidProperties[] = "invalid value for 'results', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -300,7 +307,7 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +317,7 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,6 +360,11 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($results) && (count($results) < 1)) { + throw new \InvalidArgumentException('invalid length for $results when calling UpdateOfferMappingsResponse., number of items must be greater than or equal to 1.'); + } $this->container['results'] = $results; return $this; @@ -360,11 +372,11 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -372,12 +384,12 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -402,11 +414,11 @@ class UpdateOfferMappingsResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderItemRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOrderItemRequest.php index dccda1cc..786aa385 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderItemRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderItemRequest.php @@ -2,7 +2,7 @@ /** * UpdateOrderItemRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateOrderItemRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('items', $data ?? [], null); $this->setIfExists('reason', $data ?? [], null); @@ -365,11 +365,11 @@ class UpdateOrderItemRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -377,12 +377,12 @@ class UpdateOrderItemRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -407,11 +407,11 @@ class UpdateOrderItemRequest implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusDTO.php index 048ad990..51ef74e3 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusDTO.php @@ -2,7 +2,7 @@ /** * UpdateOrderStatusDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -264,10 +264,10 @@ class UpdateOrderStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); @@ -455,11 +455,11 @@ class UpdateOrderStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -467,12 +467,12 @@ class UpdateOrderStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -497,11 +497,11 @@ class UpdateOrderStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializ /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusRequest.php index c373684d..b4654177 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusRequest.php @@ -2,7 +2,7 @@ /** * UpdateOrderStatusRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -239,10 +239,10 @@ class UpdateOrderStatusRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order', $data ?? [], null); } @@ -321,11 +321,11 @@ class UpdateOrderStatusRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -333,12 +333,12 @@ class UpdateOrderStatusRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -363,11 +363,11 @@ class UpdateOrderStatusRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusResponse.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusResponse.php index fda86be9..4f43090d 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusResponse.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusResponse.php @@ -2,7 +2,7 @@ /** * UpdateOrderStatusResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOrderStatusResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('order', $data ?? [], null); } @@ -319,11 +319,11 @@ class UpdateOrderStatusResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class UpdateOrderStatusResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class UpdateOrderStatusResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesDTO.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesDTO.php index a5545222..34722fe4 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesDTO.php @@ -2,7 +2,7 @@ /** * UpdateOrderStatusesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOrderStatusesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('orders', $data ?? [], null); } @@ -322,11 +322,11 @@ class UpdateOrderStatusesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class UpdateOrderStatusesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class UpdateOrderStatusesDTO implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesRequest.php index 7d58909c..fe3aae2e 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesRequest.php @@ -2,7 +2,7 @@ /** * UpdateOrderStatusesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOrderStatusesRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('orders', $data ?? [], null); } @@ -337,11 +337,11 @@ class UpdateOrderStatusesRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdateOrderStatusesRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdateOrderStatusesRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesResponse.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesResponse.php index d705a1f1..4ce314bc 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesResponse.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStatusesResponse.php @@ -2,7 +2,7 @@ /** * UpdateOrderStatusesResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class UpdateOrderStatusesResponse implements ModelInterface, ArrayAccess, \JsonS /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOrderStorageLimitRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOrderStorageLimitRequest.php index 05014880..78ed3a90 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOrderStorageLimitRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOrderStorageLimitRequest.php @@ -2,7 +2,7 @@ /** * UpdateOrderStorageLimitRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOrderStorageLimitRequest implements ModelInterface, ArrayAccess, \Js /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('new_date', $data ?? [], null); } @@ -322,11 +322,11 @@ class UpdateOrderStorageLimitRequest implements ModelInterface, ArrayAccess, \Js /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class UpdateOrderStorageLimitRequest implements ModelInterface, ArrayAccess, \Js /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class UpdateOrderStorageLimitRequest implements ModelInterface, ArrayAccess, \Js /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateOutletLicenseRequest.php b/erp24/lib/yandex_market_api/Model/UpdateOutletLicenseRequest.php index d9b9e1a6..fad6b5ec 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateOutletLicenseRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateOutletLicenseRequest.php @@ -2,7 +2,7 @@ /** * UpdateOutletLicenseRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateOutletLicenseRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('licenses', $data ?? [], null); } @@ -278,6 +278,10 @@ class UpdateOutletLicenseRequest implements ModelInterface, ArrayAccess, \JsonSe if ($this->container['licenses'] === null) { $invalidProperties[] = "'licenses' can't be null"; } + if ((count($this->container['licenses']) > 500)) { + $invalidProperties[] = "invalid value for 'licenses', number of items must be less than or equal to 500."; + } + if ((count($this->container['licenses']) < 1)) { $invalidProperties[] = "invalid value for 'licenses', number of items must be greater than or equal to 1."; } @@ -320,7 +324,9 @@ class UpdateOutletLicenseRequest implements ModelInterface, ArrayAccess, \JsonSe throw new \InvalidArgumentException('non-nullable licenses cannot be null'); } - + if ((count($licenses) > 500)) { + throw new \InvalidArgumentException('invalid value for $licenses when calling UpdateOutletLicenseRequest., number of items must be less than or equal to 500.'); + } if ((count($licenses) < 1)) { throw new \InvalidArgumentException('invalid length for $licenses when calling UpdateOutletLicenseRequest., number of items must be greater than or equal to 1.'); } @@ -331,11 +337,11 @@ class UpdateOutletLicenseRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -343,12 +349,12 @@ class UpdateOutletLicenseRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -373,11 +379,11 @@ class UpdateOutletLicenseRequest implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePricesRequest.php b/erp24/lib/yandex_market_api/Model/UpdatePricesRequest.php index 60534006..977b3639 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePricesRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePricesRequest.php @@ -2,7 +2,7 @@ /** * UpdatePricesRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdatePricesRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offers', $data ?? [], null); } @@ -337,11 +337,11 @@ class UpdatePricesRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdatePricesRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdatePricesRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDTO.php b/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDTO.php index 11a3cced..2a5269e9 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDTO.php @@ -2,7 +2,7 @@ /** * UpdatePromoOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('params', $data ?? [], null); @@ -293,8 +293,8 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } return $invalidProperties; @@ -325,7 +325,7 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -340,8 +340,8 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling UpdatePromoOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdatePromoOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling UpdatePromoOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -378,11 +378,11 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -390,12 +390,12 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -420,11 +420,11 @@ class UpdatePromoOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDiscountParamsDTO.php b/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDiscountParamsDTO.php index c23bebf1..5a319efe 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDiscountParamsDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePromoOfferDiscountParamsDTO.php @@ -2,7 +2,7 @@ /** * UpdatePromoOfferDiscountParamsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdatePromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('price', $data ?? [], null); $this->setIfExists('promo_price', $data ?? [], null); @@ -371,11 +371,11 @@ class UpdatePromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -383,12 +383,12 @@ class UpdatePromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -413,11 +413,11 @@ class UpdatePromoOfferDiscountParamsDTO implements ModelInterface, ArrayAccess, /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePromoOfferParamsDTO.php b/erp24/lib/yandex_market_api/Model/UpdatePromoOfferParamsDTO.php index db630ef0..ccb19549 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePromoOfferParamsDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePromoOfferParamsDTO.php @@ -2,7 +2,7 @@ /** * UpdatePromoOfferParamsDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdatePromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('discount_params', $data ?? [], null); } @@ -319,11 +319,11 @@ class UpdatePromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -331,12 +331,12 @@ class UpdatePromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -361,11 +361,11 @@ class UpdatePromoOfferParamsDTO implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePromoOffersRequest.php b/erp24/lib/yandex_market_api/Model/UpdatePromoOffersRequest.php index 256c4bf9..a84f72a1 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePromoOffersRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePromoOffersRequest.php @@ -2,7 +2,7 @@ /** * UpdatePromoOffersRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdatePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('promo_id', $data ?? [], null); $this->setIfExists('offers', $data ?? [], null); @@ -374,11 +374,11 @@ class UpdatePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -386,12 +386,12 @@ class UpdatePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -416,11 +416,11 @@ class UpdatePromoOffersRequest implements ModelInterface, ArrayAccess, \JsonSeri /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResponse.php b/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResponse.php index 05071aab..7f096fda 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResponse.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResponse.php @@ -2,7 +2,7 @@ /** * UpdatePromoOffersResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -282,6 +282,9 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -300,7 +303,7 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -310,7 +313,7 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -353,11 +356,11 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -365,12 +368,12 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -395,11 +398,11 @@ class UpdatePromoOffersResponse implements ModelInterface, ArrayAccess, \JsonSer /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResultDTO.php b/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResultDTO.php index 61fce652..426da386 100644 --- a/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResultDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdatePromoOffersResultDTO.php @@ -2,7 +2,7 @@ /** * UpdatePromoOffersResultDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('rejected_offers', $data ?? [], null); $this->setIfExists('warning_offers', $data ?? [], null); @@ -282,6 +282,14 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe { $invalidProperties = []; + if (!is_null($this->container['rejected_offers']) && (count($this->container['rejected_offers']) < 1)) { + $invalidProperties[] = "invalid value for 'rejected_offers', number of items must be greater than or equal to 1."; + } + + if (!is_null($this->container['warning_offers']) && (count($this->container['warning_offers']) < 1)) { + $invalidProperties[] = "invalid value for 'warning_offers', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -326,6 +334,11 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($rejected_offers) && (count($rejected_offers) < 1)) { + throw new \InvalidArgumentException('invalid length for $rejected_offers when calling UpdatePromoOffersResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['rejected_offers'] = $rejected_offers; return $this; @@ -360,6 +373,11 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } + + + if (!is_null($warning_offers) && (count($warning_offers) < 1)) { + throw new \InvalidArgumentException('invalid length for $warning_offers when calling UpdatePromoOffersResultDTO., number of items must be greater than or equal to 1.'); + } $this->container['warning_offers'] = $warning_offers; return $this; @@ -367,11 +385,11 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -379,12 +397,12 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -409,11 +427,11 @@ class UpdatePromoOffersResultDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateStockDTO.php b/erp24/lib/yandex_market_api/Model/UpdateStockDTO.php index 7e11c7cc..6becc1e2 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateStockDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateStockDTO.php @@ -2,7 +2,7 @@ /** * UpdateStockDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sku', $data ?? [], null); $this->setIfExists('items', $data ?? [], null); @@ -293,8 +293,8 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable $invalidProperties[] = "invalid value for 'sku', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['sku'])) { - $invalidProperties[] = "invalid value for 'sku', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['sku'])) { + $invalidProperties[] = "invalid value for 'sku', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['items'] === null) { @@ -336,7 +336,7 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets sku * - * @param string $sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $sku Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -351,8 +351,8 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ((mb_strlen($sku) < 1)) { throw new \InvalidArgumentException('invalid length for $sku when calling UpdateStockDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($sku)))) { - throw new \InvalidArgumentException("invalid value for \$sku when calling UpdateStockDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($sku)))) { + throw new \InvalidArgumentException("invalid value for \$sku when calling UpdateStockDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['sku'] = $sku; @@ -396,11 +396,11 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +408,12 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +438,11 @@ class UpdateStockDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateStockItemDTO.php b/erp24/lib/yandex_market_api/Model/UpdateStockItemDTO.php index bb2424b8..387fc1a5 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateStockItemDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateStockItemDTO.php @@ -2,7 +2,7 @@ /** * UpdateStockItemDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class UpdateStockItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('count', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); @@ -372,11 +372,11 @@ class UpdateStockItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -384,12 +384,12 @@ class UpdateStockItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -414,11 +414,11 @@ class UpdateStockItemDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateStocksRequest.php b/erp24/lib/yandex_market_api/Model/UpdateStocksRequest.php index 9474a5d8..a5a0780d 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateStocksRequest.php +++ b/erp24/lib/yandex_market_api/Model/UpdateStocksRequest.php @@ -2,7 +2,7 @@ /** * UpdateStocksRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateStocksRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('skus', $data ?? [], null); } @@ -314,7 +314,7 @@ class UpdateStocksRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Sets skus * - * @param \OpenAPI\Client\Model\UpdateStockDTO[] $skus Данные об остатках товаров. + * @param \OpenAPI\Client\Model\UpdateStockDTO[] $skus Данные об остатках товаров. В рамках одного запроса все значения `sku` должны быть уникальными. Не допускается передача двух объектов с одинаковым `sku`. * * @return self */ @@ -337,11 +337,11 @@ class UpdateStocksRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -349,12 +349,12 @@ class UpdateStocksRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -379,11 +379,11 @@ class UpdateStocksRequest implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateTimeDTO.php b/erp24/lib/yandex_market_api/Model/UpdateTimeDTO.php index 805b9fcd..d73d1dc9 100644 --- a/erp24/lib/yandex_market_api/Model/UpdateTimeDTO.php +++ b/erp24/lib/yandex_market_api/Model/UpdateTimeDTO.php @@ -2,7 +2,7 @@ /** * UpdateTimeDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -240,10 +240,10 @@ class UpdateTimeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('updated_at', $data ?? [], null); } @@ -322,11 +322,11 @@ class UpdateTimeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -334,12 +334,12 @@ class UpdateTimeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -364,11 +364,11 @@ class UpdateTimeDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/UpdateWarehouseStatusRequest.php b/erp24/lib/yandex_market_api/Model/UpdateWarehouseStatusRequest.php new file mode 100644 index 00000000..7220073e --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateWarehouseStatusRequest.php @@ -0,0 +1,413 @@ + + */ +class UpdateWarehouseStatusRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateWarehouseStatusRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['enabled'] === null) { + $invalidProperties[] = "'enabled' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled Статус склада: * `true` — включен. * `false` — отключен. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/UpdateWarehouseStatusResponse.php b/erp24/lib/yandex_market_api/Model/UpdateWarehouseStatusResponse.php new file mode 100644 index 00000000..d43c97f5 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/UpdateWarehouseStatusResponse.php @@ -0,0 +1,446 @@ + + */ +class UpdateWarehouseStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateWarehouseStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\ApiResponseStatusType', + 'result' => '\OpenAPI\Client\Model\WarehouseStatusDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ApiResponseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets result + * + * @return \OpenAPI\Client\Model\WarehouseStatusDTO|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \OpenAPI\Client\Model\WarehouseStatusDTO|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/ValueRestrictionDTO.php b/erp24/lib/yandex_market_api/Model/ValueRestrictionDTO.php index 9a2c7992..d171d79a 100644 --- a/erp24/lib/yandex_market_api/Model/ValueRestrictionDTO.php +++ b/erp24/lib/yandex_market_api/Model/ValueRestrictionDTO.php @@ -2,7 +2,7 @@ /** * ValueRestrictionDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class ValueRestrictionDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('limiting_parameter_id', $data ?? [], null); $this->setIfExists('limited_values', $data ?? [], null); @@ -368,11 +368,11 @@ class ValueRestrictionDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -380,12 +380,12 @@ class ValueRestrictionDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -410,11 +410,11 @@ class ValueRestrictionDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/VerifyOrderEacRequest.php b/erp24/lib/yandex_market_api/Model/VerifyOrderEacRequest.php index 29644b18..832cc2ed 100644 --- a/erp24/lib/yandex_market_api/Model/VerifyOrderEacRequest.php +++ b/erp24/lib/yandex_market_api/Model/VerifyOrderEacRequest.php @@ -2,7 +2,7 @@ /** * VerifyOrderEacRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -239,10 +239,10 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('code', $data ?? [], null); } @@ -274,6 +274,9 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali { $invalidProperties = []; + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } return $invalidProperties; } @@ -292,7 +295,7 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets code * - * @return string|null + * @return string */ public function getCode() { @@ -302,7 +305,7 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Sets code * - * @param string|null $code Код для подтверждения ЭАПП. + * @param string $code Код для подтверждения ЭАПП. * * @return self */ @@ -318,11 +321,11 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -330,12 +333,12 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -360,11 +363,11 @@ class VerifyOrderEacRequest implements ModelInterface, ArrayAccess, \JsonSeriali /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/VerifyOrderEacResponse.php b/erp24/lib/yandex_market_api/Model/VerifyOrderEacResponse.php index 9a09ee58..4cd11c54 100644 --- a/erp24/lib/yandex_market_api/Model/VerifyOrderEacResponse.php +++ b/erp24/lib/yandex_market_api/Model/VerifyOrderEacResponse.php @@ -2,7 +2,7 @@ /** * VerifyOrderEacResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -245,10 +245,10 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('status', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); @@ -281,6 +281,9 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } return $invalidProperties; } @@ -299,7 +302,7 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets status * - * @return \OpenAPI\Client\Model\ApiResponseStatusType|null + * @return \OpenAPI\Client\Model\ApiResponseStatusType */ public function getStatus() { @@ -309,7 +312,7 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Sets status * - * @param \OpenAPI\Client\Model\ApiResponseStatusType|null $status status + * @param \OpenAPI\Client\Model\ApiResponseStatusType $status status * * @return self */ @@ -352,11 +355,11 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -364,12 +367,12 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -394,11 +397,11 @@ class VerifyOrderEacResponse implements ModelInterface, ArrayAccess, \JsonSerial /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/VotesDTO.php b/erp24/lib/yandex_market_api/Model/VotesDTO.php new file mode 100644 index 00000000..3168d9f2 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/VotesDTO.php @@ -0,0 +1,450 @@ + + */ +class VotesDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VotesDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'likes' => 'int', + 'dislikes' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'likes' => 'int64', + 'dislikes' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'likes' => false, + 'dislikes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'likes' => 'likes', + 'dislikes' => 'dislikes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'likes' => 'setLikes', + 'dislikes' => 'setDislikes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'likes' => 'getLikes', + 'dislikes' => 'getDislikes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('likes', $data ?? [], null); + $this->setIfExists('dislikes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['likes'] === null) { + $invalidProperties[] = "'likes' can't be null"; + } + if ($this->container['dislikes'] === null) { + $invalidProperties[] = "'dislikes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets likes + * + * @return int + */ + public function getLikes() + { + return $this->container['likes']; + } + + /** + * Sets likes + * + * @param int $likes Количество лайков. + * + * @return self + */ + public function setLikes($likes) + { + if (is_null($likes)) { + throw new \InvalidArgumentException('non-nullable likes cannot be null'); + } + $this->container['likes'] = $likes; + + return $this; + } + + /** + * Gets dislikes + * + * @return int + */ + public function getDislikes() + { + return $this->container['dislikes']; + } + + /** + * Sets dislikes + * + * @param int $dislikes Количество дизлайков. + * + * @return self + */ + public function setDislikes($dislikes) + { + if (is_null($dislikes)) { + throw new \InvalidArgumentException('non-nullable dislikes cannot be null'); + } + $this->container['dislikes'] = $dislikes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/WarehouseAddressDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseAddressDTO.php index d337f89e..314469f8 100644 --- a/erp24/lib/yandex_market_api/Model/WarehouseAddressDTO.php +++ b/erp24/lib/yandex_market_api/Model/WarehouseAddressDTO.php @@ -2,7 +2,7 @@ /** * WarehouseAddressDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -270,10 +270,10 @@ class WarehouseAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('city', $data ?? [], null); $this->setIfExists('street', $data ?? [], null); @@ -535,11 +535,11 @@ class WarehouseAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -547,12 +547,12 @@ class WarehouseAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -577,11 +577,11 @@ class WarehouseAddressDTO implements ModelInterface, ArrayAccess, \JsonSerializa /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarehouseComponentType.php b/erp24/lib/yandex_market_api/Model/WarehouseComponentType.php new file mode 100644 index 00000000..131d9d04 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/WarehouseComponentType.php @@ -0,0 +1,63 @@ +setIfExists('id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); @@ -312,6 +312,10 @@ class WarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerializable if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + if ($this->container['express'] === null) { $invalidProperties[] = "'express' can't be null"; } @@ -397,7 +401,7 @@ class WarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Sets campaign_id * - * @param int $campaign_id Идентификатор кампании в API и идентификатор магазина. + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. * * @return self */ @@ -406,6 +410,11 @@ class WarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerializable if (is_null($campaign_id)) { throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling WarehouseDTO., must be bigger than or equal to 1.'); + } + $this->container['campaign_id'] = $campaign_id; return $this; @@ -467,11 +476,11 @@ class WarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -479,12 +488,12 @@ class WarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -509,11 +518,11 @@ class WarehouseDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarehouseDetailsDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseDetailsDTO.php new file mode 100644 index 00000000..1deb028a --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/WarehouseDetailsDTO.php @@ -0,0 +1,635 @@ + + */ +class WarehouseDetailsDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WarehouseDetailsDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'campaign_id' => 'int', + 'express' => 'bool', + 'group_info' => '\OpenAPI\Client\Model\WarehouseGroupInfoDTO', + 'address' => '\OpenAPI\Client\Model\WarehouseAddressDTO', + 'status' => '\OpenAPI\Client\Model\WarehouseStatusDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'name' => null, + 'campaign_id' => 'int64', + 'express' => null, + 'group_info' => null, + 'address' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'campaign_id' => false, + 'express' => false, + 'group_info' => false, + 'address' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'campaign_id' => 'campaignId', + 'express' => 'express', + 'group_info' => 'groupInfo', + 'address' => 'address', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'campaign_id' => 'setCampaignId', + 'express' => 'setExpress', + 'group_info' => 'setGroupInfo', + 'address' => 'setAddress', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'campaign_id' => 'getCampaignId', + 'express' => 'getExpress', + 'group_info' => 'getGroupInfo', + 'address' => 'getAddress', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('express', $data ?? [], null); + $this->setIfExists('group_info', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['campaign_id'] === null) { + $invalidProperties[] = "'campaign_id' can't be null"; + } + if (($this->container['campaign_id'] < 1)) { + $invalidProperties[] = "invalid value for 'campaign_id', must be bigger than or equal to 1."; + } + + if ($this->container['express'] === null) { + $invalidProperties[] = "'express' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор склада. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Название склада. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets campaign_id + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaign_id']; + } + + /** + * Sets campaign_id + * + * @param int $campaign_id Идентификатор кампании (магазина) — технический идентификатор, который представляет ваш магазин в системе Яндекс Маркета при работе через API. Он однозначно связывается с вашим магазином, но предназначен только для автоматизированного взаимодействия. Его можно узнать с помощью запроса [GET v2/campaigns](../../reference/campaigns/getCampaigns.md) или найти в кабинете продавца на Маркете. Нажмите на иконку вашего аккаунта → **Настройки** и в меню слева выберите **API и модули**: * блок **Идентификатор кампании**; * вкладка **Лог запросов** → выпадающий список в блоке **Показывать логи**. ⚠️ Не путайте его с: - идентификатором магазина, который отображается в личном кабинете продавца; - рекламными кампаниями. + * + * @return self + */ + public function setCampaignId($campaign_id) + { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } + + if (($campaign_id < 1)) { + throw new \InvalidArgumentException('invalid value for $campaign_id when calling WarehouseDetailsDTO., must be bigger than or equal to 1.'); + } + + $this->container['campaign_id'] = $campaign_id; + + return $this; + } + + /** + * Gets express + * + * @return bool + */ + public function getExpress() + { + return $this->container['express']; + } + + /** + * Sets express + * + * @param bool $express Возможна ли доставка для модели Экспресс. + * + * @return self + */ + public function setExpress($express) + { + if (is_null($express)) { + throw new \InvalidArgumentException('non-nullable express cannot be null'); + } + $this->container['express'] = $express; + + return $this; + } + + /** + * Gets group_info + * + * @return \OpenAPI\Client\Model\WarehouseGroupInfoDTO|null + */ + public function getGroupInfo() + { + return $this->container['group_info']; + } + + /** + * Sets group_info + * + * @param \OpenAPI\Client\Model\WarehouseGroupInfoDTO|null $group_info group_info + * + * @return self + */ + public function setGroupInfo($group_info) + { + if (is_null($group_info)) { + throw new \InvalidArgumentException('non-nullable group_info cannot be null'); + } + $this->container['group_info'] = $group_info; + + return $this; + } + + /** + * Gets address + * + * @return \OpenAPI\Client\Model\WarehouseAddressDTO|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \OpenAPI\Client\Model\WarehouseAddressDTO|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\WarehouseStatusDTO|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\WarehouseStatusDTO|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/WarehouseGroupDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseGroupDTO.php index 2db7a3c4..ecb73354 100644 --- a/erp24/lib/yandex_market_api/Model/WarehouseGroupDTO.php +++ b/erp24/lib/yandex_market_api/Model/WarehouseGroupDTO.php @@ -2,7 +2,7 @@ /** * WarehouseGroupDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -252,10 +252,10 @@ class WarehouseGroupDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('main_warehouse', $data ?? [], null); @@ -396,11 +396,11 @@ class WarehouseGroupDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -408,12 +408,12 @@ class WarehouseGroupDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -438,11 +438,11 @@ class WarehouseGroupDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarehouseGroupInfoDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseGroupInfoDTO.php new file mode 100644 index 00000000..88304339 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/WarehouseGroupInfoDTO.php @@ -0,0 +1,450 @@ + + */ +class WarehouseGroupInfoDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WarehouseGroupInfoDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'id' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Название группы, к которой принадлежит склад. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Идентификатор группы складов. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/WarehouseOfferDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseOfferDTO.php index caaa46e6..1df4004f 100644 --- a/erp24/lib/yandex_market_api/Model/WarehouseOfferDTO.php +++ b/erp24/lib/yandex_market_api/Model/WarehouseOfferDTO.php @@ -2,7 +2,7 @@ /** * WarehouseOfferDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -258,10 +258,10 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('turnover_summary', $data ?? [], null); @@ -307,8 +307,8 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['stocks'] === null) { @@ -342,7 +342,7 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -357,8 +357,8 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling WarehouseOfferDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling WarehouseOfferDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling WarehouseOfferDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -449,11 +449,11 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -461,12 +461,12 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -491,11 +491,11 @@ class WarehouseOfferDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarehouseOffersDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseOffersDTO.php index ca42ffa5..8a4fdddf 100644 --- a/erp24/lib/yandex_market_api/Model/WarehouseOffersDTO.php +++ b/erp24/lib/yandex_market_api/Model/WarehouseOffersDTO.php @@ -2,7 +2,7 @@ /** * WarehouseOffersDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class WarehouseOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('warehouse_id', $data ?? [], null); $this->setIfExists('offers', $data ?? [], null); @@ -316,7 +316,7 @@ class WarehouseOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets warehouse_id * - * @param int $warehouse_id Идентификатор склада. + * @param int $warehouse_id Идентификатор склада. **Для модели FBY:** возвращается идентификатор склада Маркета. **Для модели FBS:** может возвращаться идентификатор как партнерского склада, так и склада возвратов Маркета. * * @return self */ @@ -359,11 +359,11 @@ class WarehouseOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class WarehouseOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class WarehouseOffersDTO implements ModelInterface, ArrayAccess, \JsonSerializab /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarehouseStatusDTO.php b/erp24/lib/yandex_market_api/Model/WarehouseStatusDTO.php new file mode 100644 index 00000000..a2d59e27 --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/WarehouseStatusDTO.php @@ -0,0 +1,413 @@ + + */ +class WarehouseStatusDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WarehouseStatusDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => '\OpenAPI\Client\Model\WarehouseStatusType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\WarehouseStatusType + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\WarehouseStatusType $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/erp24/lib/yandex_market_api/Model/WarehouseStatusType.php b/erp24/lib/yandex_market_api/Model/WarehouseStatusType.php new file mode 100644 index 00000000..c28783ab --- /dev/null +++ b/erp24/lib/yandex_market_api/Model/WarehouseStatusType.php @@ -0,0 +1,63 @@ +setIfExists('type', $data ?? [], null); $this->setIfExists('count', $data ?? [], null); @@ -359,11 +359,11 @@ class WarehouseStockDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class WarehouseStockDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class WarehouseStockDTO implements ModelInterface, ArrayAccess, \JsonSerializabl /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarehouseStockType.php b/erp24/lib/yandex_market_api/Model/WarehouseStockType.php index 4dda8f73..746f9062 100644 --- a/erp24/lib/yandex_market_api/Model/WarehouseStockType.php +++ b/erp24/lib/yandex_market_api/Model/WarehouseStockType.php @@ -2,7 +2,7 @@ /** * WarehouseStockType * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** diff --git a/erp24/lib/yandex_market_api/Model/WarehousesDTO.php b/erp24/lib/yandex_market_api/Model/WarehousesDTO.php index f08fdfb9..515b5071 100644 --- a/erp24/lib/yandex_market_api/Model/WarehousesDTO.php +++ b/erp24/lib/yandex_market_api/Model/WarehousesDTO.php @@ -2,7 +2,7 @@ /** * WarehousesDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class WarehousesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('warehouses', $data ?? [], null); $this->setIfExists('warehouse_groups', $data ?? [], null); @@ -359,11 +359,11 @@ class WarehousesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -371,12 +371,12 @@ class WarehousesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -401,11 +401,11 @@ class WarehousesDTO implements ModelInterface, ArrayAccess, \JsonSerializable /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/Model/WarningPromoOfferUpdateDTO.php b/erp24/lib/yandex_market_api/Model/WarningPromoOfferUpdateDTO.php index 2c9ce612..aac5614d 100644 --- a/erp24/lib/yandex_market_api/Model/WarningPromoOfferUpdateDTO.php +++ b/erp24/lib/yandex_market_api/Model/WarningPromoOfferUpdateDTO.php @@ -2,7 +2,7 @@ /** * WarningPromoOfferUpdateDTO * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -246,10 +246,10 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('offer_id', $data ?? [], null); $this->setIfExists('warnings', $data ?? [], null); @@ -293,8 +293,8 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe $invalidProperties[] = "invalid value for 'offer_id', the character length must be bigger than or equal to 1."; } - if (!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { - $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; + if (!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", $this->container['offer_id'])) { + $invalidProperties[] = "invalid value for 'offer_id', must be conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."; } if ($this->container['warnings'] === null) { @@ -328,7 +328,7 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Sets offer_id * - * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * SKU товара нельзя менять — можно только удалить товар и добавить заново с новым SKU. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) + * @param string $offer_id Ваш SKU — идентификатор товара в вашей системе. Правила использования SKU: * У каждого товара SKU должен быть свой. * Уже заданный SKU нельзя освободить и использовать заново для другого товара. Каждый товар должен получать новый идентификатор, до того никогда не использовавшийся в вашем каталоге. SKU товара можно изменить в кабинете продавца на Маркете. О том, как это сделать, читайте [в Справке Маркета для продавцов](https://yandex.ru/support2/marketplace/ru/assortment/operations/edit-sku). {% note warning %} Пробельные символы в начале и конце значения автоматически удаляются. Например, `\" SKU123 \"` и `\"SKU123\"` будут обработаны как одинаковые значения. {% endnote %} [Что такое SKU и как его назначать](https://yandex.ru/support/marketplace/assortment/add/index.html#fields) * * @return self */ @@ -343,8 +343,8 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe if ((mb_strlen($offer_id) < 1)) { throw new \InvalidArgumentException('invalid length for $offer_id when calling WarningPromoOfferUpdateDTO., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { - throw new \InvalidArgumentException("invalid value for \$offer_id when calling WarningPromoOfferUpdateDTO., must conform to the pattern /^[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); + if ((!preg_match("/^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/", ObjectSerializer::toString($offer_id)))) { + throw new \InvalidArgumentException("invalid value for \$offer_id when calling WarningPromoOfferUpdateDTO., must conform to the pattern /^(?=.*\\S.*)[^\\x00-\\x08\\x0A-\\x1f\\x7f]{1,255}$/."); } $this->container['offer_id'] = $offer_id; @@ -381,11 +381,11 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -393,12 +393,12 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -423,11 +423,11 @@ class WarningPromoOfferUpdateDTO implements ModelInterface, ArrayAccess, \JsonSe /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/erp24/lib/yandex_market_api/ObjectSerializer.php b/erp24/lib/yandex_market_api/ObjectSerializer.php index a605cde7..1c710817 100644 --- a/erp24/lib/yandex_market_api/ObjectSerializer.php +++ b/erp24/lib/yandex_market_api/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package OpenAPI\Client @@ -11,13 +11,13 @@ */ /** - * Партнерский API Маркета + * API Яндекс Маркета для продавцов * * API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. * * The version of the OpenAPI document: LATEST * Generated by: https://openapi-generator.tech - * Generator version: 7.9.0 + * Generator version: 7.18.0 */ /** @@ -58,8 +58,8 @@ class ObjectSerializer * Serialize data * * @param mixed $data the data to serialize - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @param string|null $type the OpenAPIToolsType of the data + * @param string|null $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -323,24 +323,6 @@ class ObjectSerializer return self::toString($value); } - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged @@ -404,7 +386,7 @@ class ObjectSerializer * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ @@ -612,6 +594,6 @@ class ObjectSerializer } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? substr($qs, 0, -1) : ''; } }